aboutsummaryrefslogtreecommitdiff
path: root/modern/src/settings/DevicePage.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/settings/DevicePage.js')
-rw-r--r--modern/src/settings/DevicePage.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/modern/src/settings/DevicePage.js b/modern/src/settings/DevicePage.js
index 491ba60f..56a589dc 100644
--- a/modern/src/settings/DevicePage.js
+++ b/modern/src/settings/DevicePage.js
@@ -15,6 +15,7 @@ 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';
const useStyles = makeStyles(() => ({
details: {
@@ -28,6 +29,7 @@ const DevicePage = () => {
const admin = useAdministrator();
+ const commonDeviceAttributes = useCommonDeviceAttributes(t);
const deviceAttributes = useDeviceAttributes(t);
const [item, setItem] = useState();
@@ -134,7 +136,7 @@ const DevicePage = () => {
<EditAttributesView
attributes={item.attributes}
setAttributes={(attributes) => setItem({ ...item, attributes })}
- definitions={deviceAttributes}
+ definitions={{ ...commonDeviceAttributes, ...deviceAttributes }}
/>
</AccordionDetails>
</Accordion>
@@ -190,6 +192,17 @@ const DevicePage = () => {
/>
<LinkField
margin="normal"
+ endpointAll="/api/commands"
+ endpointLinked={`/api/commands?deviceId=${item.id}`}
+ baseId={item.id}
+ keyBase="deviceId"
+ keyLink="commandId"
+ titleGetter={(it) => it.description}
+ label={t('sharedSavedCommands')}
+ variant="filled"
+ />
+ <LinkField
+ margin="normal"
endpointAll="/api/maintenance"
endpointLinked={`/api/maintenance?deviceId=${item.id}`}
baseId={item.id}