diff options
author | Anton Tananaev <anton@traccar.org> | 2022-05-22 13:25:57 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-05-22 13:25:57 -0700 |
commit | aae582bd582cd7bd596a23e699ffad13c38a06c8 (patch) | |
tree | c61a125d40ff847c181774dd64a0fcb9ef7a97ee /modern/src | |
parent | 9be7c49b2c59160e12f1787ab91f010b22fa6844 (diff) | |
download | trackermap-web-aae582bd582cd7bd596a23e699ffad13c38a06c8.tar.gz trackermap-web-aae582bd582cd7bd596a23e699ffad13c38a06c8.tar.bz2 trackermap-web-aae582bd582cd7bd596a23e699ffad13c38a06c8.zip |
Missing group connections
Diffstat (limited to 'modern/src')
-rw-r--r-- | modern/src/settings/GroupPage.js | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/modern/src/settings/GroupPage.js b/modern/src/settings/GroupPage.js index 3d4769f3..9dcd65c9 100644 --- a/modern/src/settings/GroupPage.js +++ b/modern/src/settings/GroupPage.js @@ -8,10 +8,12 @@ import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import EditItemView from './components/EditItemView'; import EditAttributesView from './components/EditAttributesView'; import SelectField from '../common/components/SelectField'; +import LinkField from '../common/components/LinkField'; import { useTranslation } from '../common/components/LocalizationProvider'; import SettingsMenu from './components/SettingsMenu'; import useCommonDeviceAttributes from '../common/attributes/useCommonDeviceAttributes'; import useGroupAttributes from '../common/attributes/useGroupAttributes'; +import { prefixString } from '../common/util/stringUtils'; const useStyles = makeStyles(() => ({ details: { @@ -88,6 +90,80 @@ const GroupPage = () => { /> </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?groupId=${item.id}`} + baseId={item.id} + keyBase="groupId" + keyLink="geofenceId" + label={t('sharedGeofences')} + variant="filled" + /> + <LinkField + margin="normal" + endpointAll="/api/notifications" + endpointLinked={`/api/notifications?groupId=${item.id}`} + baseId={item.id} + keyBase="groupId" + keyLink="notificationId" + titleGetter={(it) => t(prefixString('event', it.type))} + label={t('sharedNotifications')} + variant="filled" + /> + <LinkField + margin="normal" + endpointAll="/api/drivers" + endpointLinked={`/api/drivers?groupId=${item.id}`} + baseId={item.id} + keyBase="groupId" + keyLink="driverId" + label={t('sharedDrivers')} + variant="filled" + /> + <LinkField + margin="normal" + endpointAll="/api/attributes/computed" + endpointLinked={`/api/attributes/computed?groupId=${item.id}`} + baseId={item.id} + keyBase="groupId" + keyLink="attributeId" + titleGetter={(it) => it.description} + label={t('sharedComputedAttributes')} + variant="filled" + /> + <LinkField + margin="normal" + endpointAll="/api/commands" + endpointLinked={`/api/commands?groupId=${item.id}`} + baseId={item.id} + keyBase="groupId" + keyLink="commandId" + titleGetter={(it) => it.description} + label={t('sharedSavedCommands')} + variant="filled" + /> + <LinkField + margin="normal" + endpointAll="/api/maintenance" + endpointLinked={`/api/maintenance?groupId=${item.id}`} + baseId={item.id} + keyBase="groupId" + keyLink="maintenanceId" + label={t('sharedMaintenance')} + variant="filled" + /> + </AccordionDetails> + </Accordion> + )} </> )} </EditItemView> |