aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modern/src/components/registration/LoginForm.js13
-rw-r--r--web/release.html3
2 files changed, 14 insertions, 2 deletions
diff --git a/modern/src/components/registration/LoginForm.js b/modern/src/components/registration/LoginForm.js
index 39a0d4c7..11847d3e 100644
--- a/modern/src/components/registration/LoginForm.js
+++ b/modern/src/components/registration/LoginForm.js
@@ -1,8 +1,9 @@
import React, { useState } from 'react';
import {
- Grid, useMediaQuery, makeStyles, InputLabel, Select, MenuItem, FormControl, Button, TextField, Link, Snackbar, IconButton,
+ Grid, useMediaQuery, makeStyles, InputLabel, Select, MenuItem, FormControl, Button, TextField, Link, Snackbar, IconButton, Tooltip,
} from '@material-ui/core';
import CloseIcon from '@material-ui/icons/Close';
+import CachedIcon from '@material-ui/icons/Cached';
import { useTheme } from '@material-ui/core/styles';
import { useDispatch, useSelector } from 'react-redux';
import { useHistory } from 'react-router-dom';
@@ -12,6 +13,11 @@ import StartPage from '../../StartPage';
import usePersistedState from '../../common/usePersistedState';
const useStyles = makeStyles((theme) => ({
+ legacy: {
+ position: 'absolute',
+ top: theme.spacing(1),
+ right: theme.spacing(1),
+ },
logoContainer: {
textAlign: 'center',
color: theme.palette.primary.main,
@@ -66,6 +72,11 @@ const LoginForm = () => {
return (
<StartPage>
+ <Tooltip title="Switch to Legacy App" className={classes.legacy}>
+ <IconButton onClick={() => window.localStorage.setItem('legacyApp', true) || window.location.replace('/')}>
+ <CachedIcon />
+ </IconButton>
+ </Tooltip>
<Grid container direction="column" spacing={2}>
{useMediaQuery(theme.breakpoints.down('md'))
&& (
diff --git a/web/release.html b/web/release.html
index 82196fe7..f91a2b49 100644
--- a/web/release.html
+++ b/web/release.html
@@ -10,7 +10,8 @@
</head>
<body>
<div id="spinner"></div>
-<div id="update">Preview <a href="/modern/">modern interface</a></div>
+<script>localStorage.getItem('legacyApp') || location.replace('/modern/');</script>
+<div id="update"><a href="javascript:localStorage.removeItem('legacyApp') || location.replace('/modern/');">Switch to Modern App</a></div>
<div id="attribution">Powered by <a href="https://www.traccar.org/" target="_blank">Traccar GPS Tracking System</a></div>
<script id="loadScript" src="load.js"></script>
</body>