mirror of
https://github.com/traccar/traccar-web.git
synced 2025-01-08 12:07:27 +08:00
Persist show all devices
This commit is contained in:
parent
62f6da1f5c
commit
028329ae74
@ -17,6 +17,7 @@ import { formatTime } from '../common/util/formatter';
|
|||||||
import { useDeviceReadonly, useManager } from '../common/util/permissions';
|
import { useDeviceReadonly, useManager } from '../common/util/permissions';
|
||||||
import useSettingsStyles from './common/useSettingsStyles';
|
import useSettingsStyles from './common/useSettingsStyles';
|
||||||
import DeviceUsersValue from './components/DeviceUsersValue';
|
import DeviceUsersValue from './components/DeviceUsersValue';
|
||||||
|
import usePersistedState from '../common/util/usePersistedState';
|
||||||
|
|
||||||
const DevicesPage = () => {
|
const DevicesPage = () => {
|
||||||
const classes = useSettingsStyles();
|
const classes = useSettingsStyles();
|
||||||
@ -31,7 +32,7 @@ const DevicesPage = () => {
|
|||||||
const [timestamp, setTimestamp] = useState(Date.now());
|
const [timestamp, setTimestamp] = useState(Date.now());
|
||||||
const [items, setItems] = useState([]);
|
const [items, setItems] = useState([]);
|
||||||
const [searchKeyword, setSearchKeyword] = useState('');
|
const [searchKeyword, setSearchKeyword] = useState('');
|
||||||
const [showAll, setShowAll] = useState(false);
|
const [showAll, setShowAll] = usePersistedState('showAllDevices', false);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
useEffectAsync(async () => {
|
useEffectAsync(async () => {
|
||||||
@ -110,7 +111,7 @@ const DevicesPage = () => {
|
|||||||
<FormControlLabel
|
<FormControlLabel
|
||||||
control={(
|
control={(
|
||||||
<Switch
|
<Switch
|
||||||
value={showAll}
|
checked={showAll}
|
||||||
onChange={(e) => setShowAll(e.target.checked)}
|
onChange={(e) => setShowAll(e.target.checked)}
|
||||||
size="small"
|
size="small"
|
||||||
/>
|
/>
|
||||||
|
Loading…
Reference in New Issue
Block a user