aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2024-01-18 07:06:46 -0800
committerAnton Tananaev <anton@traccar.org>2024-01-18 07:06:46 -0800
commit3ab8da9bcda98bd3e1fac1394e3cd50c8d301912 (patch)
tree05df970baca29ed586dc2017491141d792ceb088
parent8189eaa49f4e2f3873e64fe795f6c5c554e7f1da (diff)
downloadtrackermap-web-3ab8da9bcda98bd3e1fac1394e3cd50c8d301912.tar.gz
trackermap-web-3ab8da9bcda98bd3e1fac1394e3cd50c8d301912.tar.bz2
trackermap-web-3ab8da9bcda98bd3e1fac1394e3cd50c8d301912.zip
Option to disable device sharing
-rw-r--r--modern/src/common/attributes/useServerAttributes.js4
-rw-r--r--modern/src/common/components/StatusCard.jsx3
-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 a985ef40..80ac3c7d 100644
--- a/modern/src/common/attributes/useServerAttributes.js
+++ b/modern/src/common/attributes/useServerAttributes.js
@@ -55,4 +55,8 @@ export default (t) => useMemo(() => ({
name: t('attributeUiDisableLoginLanguage'),
type: 'boolean',
},
+ disableShare: {
+ name: t('serverDisableShare'),
+ type: 'boolean',
+ },
}), [t]);
diff --git a/modern/src/common/components/StatusCard.jsx b/modern/src/common/components/StatusCard.jsx
index 0b5d4148..53048645 100644
--- a/modern/src/common/components/StatusCard.jsx
+++ b/modern/src/common/components/StatusCard.jsx
@@ -126,6 +126,7 @@ const StatusCard = ({ deviceId, position, onClose, disableActions, desktopPaddin
const deviceReadonly = useDeviceReadonly();
+ const shareDisabled = useSelector((state) => state.session.server.attributes.disableShare);
const user = useSelector((state) => state.session.user);
const device = useSelector((state) => state.devices.items[deviceId]);
@@ -292,7 +293,7 @@ const StatusCard = ({ deviceId, position, onClose, disableActions, desktopPaddin
<MenuItem component="a" target="_blank" href={`https://www.google.com/maps/search/?api=1&query=${position.latitude}%2C${position.longitude}`}>{t('linkGoogleMaps')}</MenuItem>
<MenuItem component="a" target="_blank" href={`http://maps.apple.com/?ll=${position.latitude},${position.longitude}`}>{t('linkAppleMaps')}</MenuItem>
<MenuItem component="a" target="_blank" href={`https://www.google.com/maps/@?api=1&map_action=pano&viewpoint=${position.latitude}%2C${position.longitude}&heading=${position.course}`}>{t('linkStreetView')}</MenuItem>
- {!user.temporary && <MenuItem onClick={handleShare}>{t('deviceShare')}</MenuItem>}
+ {!shareDisabled && !user.temporary && <MenuItem onClick={handleShare}>{t('deviceShare')}</MenuItem>}
</Menu>
)}
<RemoveDialog
diff --git a/modern/src/resources/l10n/en.json b/modern/src/resources/l10n/en.json
index 01f3b560..fec79807 100644
--- a/modern/src/resources/l10n/en.json
+++ b/modern/src/resources/l10n/en.json
@@ -325,6 +325,7 @@
"serverLogo": "Logo Image",
"serverLogoInverted": "Inverted Logo Image",
"serverChangeDisable": "Disable Server Change",
+ "serverDisableShare": "Disable Device Sharing",
"mapTitle": "Map",
"mapActive": "Active Maps",
"mapOverlay": "Map Overlay",