From 96af05dbf2171c4e194cf67c3c93d134ef467e50 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 27 Sep 2020 19:59:00 -0700 Subject: Add server attributes --- modern/src/admin/ServerPage.js | 119 +++++++++++++++++++++++------------------ 1 file changed, 67 insertions(+), 52 deletions(-) (limited to 'modern') diff --git a/modern/src/admin/ServerPage.js b/modern/src/admin/ServerPage.js index 01b8db1..d896104 100644 --- a/modern/src/admin/ServerPage.js +++ b/modern/src/admin/ServerPage.js @@ -8,6 +8,9 @@ import { useHistory } from 'react-router-dom'; import { useDispatch, useSelector } from 'react-redux'; import MainToolbar from '../MainToolbar'; import { sessionActions } from '../store'; +import EditAttributesView from '../attributes/EditAttributesView'; +import deviceAttributes from '../attributes/deviceAttributes'; +import userAttributes from '../attributes/userAttributes'; const useStyles = makeStyles(theme => ({ container: { @@ -49,58 +52,70 @@ const ServerPage = () => { <> -
- {item && - <> - - }> - - {t('sharedPreferences')} - - - - setItem({...item, announcement: event.target.value})} - label={t('serverAnnouncement')} - variant="filled" /> - - - - }> - - {t('sharedPermissions')} - - - - setItem({...item, registration: event.target.checked})} />} - label={t('serverRegistration')} /> - setItem({...item, readonly: event.target.checked})} />} - label={t('serverReadonly')} /> - setItem({...item, deviceReadonly: event.target.checked})} />} - label={t('userDeviceReadonly')} /> - setItem({...item, limitCommands: event.target.checked})} />} - label={t('userLimitCommands')} /> - - - - } - -
- - -
-
-
+ {item && + <> + + }> + + {t('sharedPreferences')} + + + + setItem({...item, announcement: event.target.value})} + label={t('serverAnnouncement')} + variant="filled" /> + + + + }> + + {t('sharedPermissions')} + + + + setItem({...item, registration: event.target.checked})} />} + label={t('serverRegistration')} /> + setItem({...item, readonly: event.target.checked})} />} + label={t('serverReadonly')} /> + setItem({...item, deviceReadonly: event.target.checked})} />} + label={t('userDeviceReadonly')} /> + setItem({...item, limitCommands: event.target.checked})} />} + label={t('userLimitCommands')} /> + + + + }> + + {t('sharedAttributes')} + + + + setItem({...item, attributes})} + definitions={{...userAttributes, ...deviceAttributes}} + /> + + + + } + +
+ + +
+
); -- cgit v1.2.3