From b418d001a498b5a5108bb13983b4f3aba6c60dbc Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 3 Jun 2022 16:22:21 -0700 Subject: Support feature disabling --- modern/src/settings/DevicePage.js | 59 ++++++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 25 deletions(-) (limited to 'modern/src/settings/DevicePage.js') diff --git a/modern/src/settings/DevicePage.js b/modern/src/settings/DevicePage.js index d7b67b0b..fb49dbcc 100644 --- a/modern/src/settings/DevicePage.js +++ b/modern/src/settings/DevicePage.js @@ -22,6 +22,7 @@ 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'; const useStyles = makeStyles((theme) => ({ details: { @@ -41,6 +42,8 @@ const DevicePage = () => { const commonDeviceAttributes = useCommonDeviceAttributes(t); const deviceAttributes = useDeviceAttributes(t); + const features = useFeatures(); + const [item, setItem] = useState(); const validate = () => item && item.name && item.uniqueId; @@ -160,23 +163,27 @@ const DevicePage = () => { titleGetter={(it) => t(prefixString('event', it.type))} label={t('sharedNotifications')} /> - - it.description} - label={t('sharedComputedAttributes')} - /> + {!features.disableDrivers && ( + + )} + {!features.disableComputedAttributes && ( + it.description} + label={t('sharedComputedAttributes')} + /> + )} { titleGetter={(it) => it.description} label={t('sharedSavedCommands')} /> - + {!features.disableMaintenance && ( + + )} )} -- cgit v1.2.3