diff options
Diffstat (limited to 'modern/src/settings/DevicePage.js')
-rw-r--r-- | modern/src/settings/DevicePage.js | 75 |
1 files changed, 1 insertions, 74 deletions
diff --git a/modern/src/settings/DevicePage.js b/modern/src/settings/DevicePage.js index b080d8ce..a0a6c2b8 100644 --- a/modern/src/settings/DevicePage.js +++ b/modern/src/settings/DevicePage.js @@ -16,15 +16,12 @@ import EditItemView from './components/EditItemView'; import EditAttributesAccordion from './components/EditAttributesAccordion'; import SelectField from '../common/components/SelectField'; import deviceCategories from '../common/util/deviceCategories'; -import LinkField from '../common/components/LinkField'; import { useTranslation } from '../common/components/LocalizationProvider'; import useDeviceAttributes from '../common/attributes/useDeviceAttributes'; import { useAdministrator } from '../common/util/permissions'; import SettingsMenu from './components/SettingsMenu'; import useCommonDeviceAttributes from '../common/attributes/useCommonDeviceAttributes'; -import useFeatures from '../common/util/useFeatures'; import { useCatch } from '../reactHelper'; -import { formatNotificationTitle } from '../common/util/formatter'; const useStyles = makeStyles((theme) => ({ details: { @@ -44,8 +41,6 @@ const DevicePage = () => { const commonDeviceAttributes = useCommonDeviceAttributes(t); const deviceAttributes = useDeviceAttributes(t); - const features = useFeatures(); - const [item, setItem] = useState(); const handleFiles = useCatch(async (files) => { @@ -71,7 +66,7 @@ const DevicePage = () => { setItem={setItem} validate={validate} menu={<SettingsMenu />} - breadcrumbs={['sharedDevice']} + breadcrumbs={['settingsTitle', 'sharedDevice']} > {item && ( <> @@ -170,74 +165,6 @@ const DevicePage = () => { setAttributes={(attributes) => setItem({ ...item, attributes })} definitions={{ ...commonDeviceAttributes, ...deviceAttributes }} /> - {item.id && ( - <Accordion> - <AccordionSummary expandIcon={<ExpandMoreIcon />}> - <Typography variant="subtitle1"> - {t('sharedConnections')} - </Typography> - </AccordionSummary> - <AccordionDetails className={classes.details}> - <LinkField - endpointAll="/api/geofences" - endpointLinked={`/api/geofences?deviceId=${item.id}`} - baseId={item.id} - keyBase="deviceId" - keyLink="geofenceId" - label={t('sharedGeofences')} - /> - <LinkField - endpointAll="/api/notifications" - endpointLinked={`/api/notifications?deviceId=${item.id}`} - baseId={item.id} - keyBase="deviceId" - keyLink="notificationId" - titleGetter={(it) => formatNotificationTitle(t, it)} - label={t('sharedNotifications')} - /> - {!features.disableDrivers && ( - <LinkField - endpointAll="/api/drivers" - endpointLinked={`/api/drivers?deviceId=${item.id}`} - baseId={item.id} - keyBase="deviceId" - keyLink="driverId" - label={t('sharedDrivers')} - /> - )} - {!features.disableComputedAttributes && ( - <LinkField - endpointAll="/api/attributes/computed" - endpointLinked={`/api/attributes/computed?deviceId=${item.id}`} - baseId={item.id} - keyBase="deviceId" - keyLink="attributeId" - titleGetter={(it) => it.description} - label={t('sharedComputedAttributes')} - /> - )} - <LinkField - endpointAll="/api/commands" - endpointLinked={`/api/commands?deviceId=${item.id}`} - baseId={item.id} - keyBase="deviceId" - keyLink="commandId" - titleGetter={(it) => it.description} - label={t('sharedSavedCommands')} - /> - {!features.disableMaintenance && ( - <LinkField - endpointAll="/api/maintenance" - endpointLinked={`/api/maintenance?deviceId=${item.id}`} - baseId={item.id} - keyBase="deviceId" - keyLink="maintenanceId" - label={t('sharedMaintenance')} - /> - )} - </AccordionDetails> - </Accordion> - )} </> )} </EditItemView> |