mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-02 01:05:20 +03:00
Add ability to restart
This commit is contained in:
parent
42d268c869
commit
221b4960dc
@ -14,6 +14,7 @@ import { useRestart } from './api/mqtt';
|
||||
export default function AppBar() {
|
||||
const [showMoreMenu, setShowMoreMenu] = useState(false);
|
||||
const [showDialog, setShowDialog] = useState(false);
|
||||
const [showDialogWait, setShowDialogWait] = useState(false);
|
||||
const { setDarkMode } = useDarkMode();
|
||||
const { send: sendRestart } = useRestart();
|
||||
|
||||
@ -37,6 +38,7 @@ export default function AppBar() {
|
||||
|
||||
const handleClickRestartDialog = useCallback(() => {
|
||||
setShowDialog(false);
|
||||
setShowDialogWait(true);
|
||||
sendRestart();
|
||||
}, [setShowDialog]);
|
||||
|
||||
@ -72,6 +74,12 @@ export default function AppBar() {
|
||||
{ text: 'Cancel', onClick: handleDismissRestartDialog },
|
||||
]}
|
||||
/>
|
||||
) : null},
|
||||
{showDialogWait ? (
|
||||
<Dialog
|
||||
title="Restart in progress"
|
||||
text="Please wait a few seconds for the restart to complete before reloading the page."
|
||||
/>
|
||||
) : null}
|
||||
</Fragment>
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user