aboutsummaryrefslogtreecommitdiff
path: root/modern/src/login/LoginPage.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-19 07:21:51 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-19 07:21:51 -0700
commit15a72336f2f38d6175e90d01973515b5573f3ed8 (patch)
treea76b92f2bb3bd79d8f366ba20dff969067863658 /modern/src/login/LoginPage.js
parent588f32a9e427a9a115deafd7eea2e71b01f25c62 (diff)
downloadtrackermap-web-15a72336f2f38d6175e90d01973515b5573f3ed8.tar.gz
trackermap-web-15a72336f2f38d6175e90d01973515b5573f3ed8.tar.bz2
trackermap-web-15a72336f2f38d6175e90d01973515b5573f3ed8.zip
Implement change server
Diffstat (limited to 'modern/src/login/LoginPage.js')
-rw-r--r--modern/src/login/LoginPage.js22
1 files changed, 16 insertions, 6 deletions
diff --git a/modern/src/login/LoginPage.js b/modern/src/login/LoginPage.js
index 34d0e7d8..88a25d9d 100644
--- a/modern/src/login/LoginPage.js
+++ b/modern/src/login/LoginPage.js
@@ -5,6 +5,7 @@ import {
import makeStyles from '@mui/styles/makeStyles';
import CloseIcon from '@mui/icons-material/Close';
import CachedIcon from '@mui/icons-material/Cached';
+import LockOpenIcon from '@mui/icons-material/LockOpen';
import { useTheme } from '@mui/material/styles';
import { useDispatch, useSelector } from 'react-redux';
import { useNavigate } from 'react-router-dom';
@@ -16,7 +17,7 @@ import logoSvg from '../resources/images/logo.svg';
import { nativePostMessage } from '../common/components/NativeInterface';
const useStyles = makeStyles((theme) => ({
- legacy: {
+ options: {
position: 'fixed',
top: theme.spacing(1),
right: theme.spacing(1),
@@ -93,11 +94,20 @@ const LoginPage = () => {
return (
<LoginLayout>
- <Tooltip title="Switch to Legacy App" className={classes.legacy}>
- <IconButton onClick={() => window.localStorage.setItem('legacyApp', true) || window.location.replace('/')}>
- <CachedIcon />
- </IconButton>
- </Tooltip>
+ <div className={classes.options}>
+ <Tooltip title="Switch to Legacy App">
+ <IconButton onClick={() => window.localStorage.setItem('legacyApp', true) || window.location.replace('/')}>
+ <CachedIcon />
+ </IconButton>
+ </Tooltip>
+ {(window.appInterface || (window.webkit && window.webkit.messageHandlers.appInterface)) && (
+ <Tooltip title={t('settingsServer')}>
+ <IconButton onClick={() => navigate('/change-server')}>
+ <LockOpenIcon />
+ </IconButton>
+ </Tooltip>
+ )}
+ </div>
<div className={classes.container}>
{useMediaQuery(theme.breakpoints.down('lg')) && (
<div className={classes.logoContainer}>