diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2020-10-25 20:30:04 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2020-10-25 20:30:04 -0700 |
commit | dac214c3ac6066a6f23cf92807da89cc1a86c105 (patch) | |
tree | 9456d629943dcb8187c0c6c21f0c55afca1cf5e8 /modern/src/DevicePage.js | |
parent | 43ff7c49ba1c8cfeca148055765b16b10a4f0c44 (diff) | |
download | trackermap-web-dac214c3ac6066a6f23cf92807da89cc1a86c105.tar.gz trackermap-web-dac214c3ac6066a6f23cf92807da89cc1a86c105.tar.bz2 trackermap-web-dac214c3ac6066a6f23cf92807da89cc1a86c105.zip |
Implement linking field
Diffstat (limited to 'modern/src/DevicePage.js')
-rw-r--r-- | modern/src/DevicePage.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/modern/src/DevicePage.js b/modern/src/DevicePage.js index 7c9b5671..a8a3de65 100644 --- a/modern/src/DevicePage.js +++ b/modern/src/DevicePage.js @@ -9,6 +9,8 @@ import EditAttributesView from './attributes/EditAttributesView'; import deviceAttributes from './attributes/deviceAttributes'; import SelectField from './form/SelectField'; import { deviceCategories } from './common/deviceCategories'; +import LinkField from './form/LinkField'; +import { prefixString } from './common/stringUtils'; const useStyles = makeStyles(() => ({ details: { @@ -107,6 +109,36 @@ const DevicePage = () => { /> </AccordionDetails> </Accordion> + {item.id && + <Accordion> + <AccordionSummary expandIcon={<ExpandMoreIcon />}> + <Typography variant="subtitle1"> + {t('sharedConnections')} + </Typography> + </AccordionSummary> + <AccordionDetails className={classes.details}> + <LinkField + margin="normal" + endpointAll="/api/geofences" + endpointLinked={"/api/geofences?deviceId=" + item.id} + baseId={item.id} + keyBase="deviceId" + keyLink="geofenceId" + label={t('sharedGeofences')} + variant="filled" /> + <LinkField + margin="normal" + endpointAll="/api/notifications" + endpointLinked={"/api/notifications?deviceId=" + item.id} + baseId={item.id} + keyBase="deviceId" + keyLink="notificationId" + titleGetter={it => t(prefixString('event', it.type))} + label={t('sharedNotifications')} + variant="filled" /> + </AccordionDetails> + </Accordion> + } </> } </EditItemView> |