aboutsummaryrefslogtreecommitdiff
path: root/modern
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-06-08 08:12:30 -0700
committerAnton Tananaev <anton@traccar.org>2023-06-08 08:12:30 -0700
commita9aeaac17718096ba11208e6c7ce4902ab355050 (patch)
tree225c0483d38e19972ac175f2c869280a318813c5 /modern
parentf8048106dacb36466ae221a8258da85f35db6e9d (diff)
downloadtrackermap-web-a9aeaac17718096ba11208e6c7ce4902ab355050.tar.gz
trackermap-web-a9aeaac17718096ba11208e6c7ce4902ab355050.tar.bz2
trackermap-web-a9aeaac17718096ba11208e6c7ce4902ab355050.zip
Flag to disable server change
Diffstat (limited to 'modern')
-rw-r--r--modern/src/common/attributes/useServerAttributes.js4
-rw-r--r--modern/src/login/LoginPage.js3
-rw-r--r--modern/src/resources/l10n/en.json1
3 files changed, 7 insertions, 1 deletions
diff --git a/modern/src/common/attributes/useServerAttributes.js b/modern/src/common/attributes/useServerAttributes.js
index e87d1d7e..f70fd220 100644
--- a/modern/src/common/attributes/useServerAttributes.js
+++ b/modern/src/common/attributes/useServerAttributes.js
@@ -23,6 +23,10 @@ export default (t) => useMemo(() => ({
type: 'string',
subtype: 'color',
},
+ disableChange: {
+ name: t('serverChangeDisable'),
+ type: 'boolean',
+ },
'ui.disableLoginLanguage': {
name: t('attributeUiDisableLoginLanguage'),
type: 'boolean',
diff --git a/modern/src/login/LoginPage.js b/modern/src/login/LoginPage.js
index 59e64bed..54fd09fb 100644
--- a/modern/src/login/LoginPage.js
+++ b/modern/src/login/LoginPage.js
@@ -59,6 +59,7 @@ const LoginPage = () => {
const registrationEnabled = useSelector((state) => state.session.server.registration);
const languageEnabled = useSelector((state) => !state.session.server.attributes['ui.disableLoginLanguage']);
+ const changeEnabled = useSelector((state) => !state.session.server.attributes.disableChange);
const emailEnabled = useSelector((state) => state.session.server.emailEnabled);
const openIdEnabled = useSelector((state) => state.session.server.openIdEnabled);
const openIdForced = useSelector((state) => state.session.server.openIdEnabled && state.session.server.openIdForce);
@@ -143,7 +144,7 @@ const LoginPage = () => {
return (
<LoginLayout>
<div className={classes.options}>
- {nativeEnvironment && (
+ {nativeEnvironment && changeEnabled && (
<Tooltip title={t('settingsServer')}>
<IconButton onClick={() => navigate('/change-server')}>
<LockOpenIcon />
diff --git a/modern/src/resources/l10n/en.json b/modern/src/resources/l10n/en.json
index 8791c530..d5125657 100644
--- a/modern/src/resources/l10n/en.json
+++ b/modern/src/resources/l10n/en.json
@@ -311,6 +311,7 @@
"serverColorPrimary": "Color Primary",
"serverColorSecondary": "Color Secondary",
"serverLogo": "Logo Image",
+ "serverChangeDisable": "Disable Server Change",
"mapTitle": "Map",
"mapActive": "Active Maps",
"mapOverlay": "Map Overlay",