mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-02 17:25:22 +03:00
Undo appbar
This commit is contained in:
parent
9b81dcb8fa
commit
e77aedd4a2
@ -10,10 +10,8 @@ import Prompt from './components/Prompt';
|
|||||||
import { useDarkMode } from './context';
|
import { useDarkMode } from './context';
|
||||||
import { useCallback, useRef, useState } from 'preact/hooks';
|
import { useCallback, useRef, useState } from 'preact/hooks';
|
||||||
import { useRestart } from './api/mqtt';
|
import { useRestart } from './api/mqtt';
|
||||||
import { useTranslation } from 'react-i18next';
|
|
||||||
|
|
||||||
export default function AppBar() {
|
export default function AppBar() {
|
||||||
const { t } = useTranslation();
|
|
||||||
const [showMoreMenu, setShowMoreMenu] = useState(false);
|
const [showMoreMenu, setShowMoreMenu] = useState(false);
|
||||||
const [showDialog, setShowDialog] = useState(false);
|
const [showDialog, setShowDialog] = useState(false);
|
||||||
const [showDialogWait, setShowDialogWait] = useState(false);
|
const [showDialogWait, setShowDialogWait] = useState(false);
|
||||||
@ -58,29 +56,29 @@ export default function AppBar() {
|
|||||||
<BaseAppBar title={LinkedLogo} overflowRef={moreRef} onOverflowClick={handleShowMenu} />
|
<BaseAppBar title={LinkedLogo} overflowRef={moreRef} onOverflowClick={handleShowMenu} />
|
||||||
{showMoreMenu ? (
|
{showMoreMenu ? (
|
||||||
<Menu onDismiss={handleDismissMoreMenu} relativeTo={moreRef}>
|
<Menu onDismiss={handleDismissMoreMenu} relativeTo={moreRef}>
|
||||||
<MenuItem icon={AutoAwesomeIcon} label={t('auto_dark_mode')} value="media" onSelect={handleSelectDarkMode} />
|
<MenuItem icon={AutoAwesomeIcon} label="Auto dark mode" value="media" onSelect={handleSelectDarkMode} />
|
||||||
<MenuSeparator />
|
<MenuSeparator />
|
||||||
<MenuItem icon={LightModeIcon} label={t('light')} value="light" onSelect={handleSelectDarkMode} />
|
<MenuItem icon={LightModeIcon} label="Light" value="light" onSelect={handleSelectDarkMode} />
|
||||||
<MenuItem icon={DarkModeIcon} label={t('dark')} value="dark" onSelect={handleSelectDarkMode} />
|
<MenuItem icon={DarkModeIcon} label="Dark" value="dark" onSelect={handleSelectDarkMode} />
|
||||||
<MenuSeparator />
|
<MenuSeparator />
|
||||||
<MenuItem icon={FrigateRestartIcon} label={t('restart_frigate')} onSelect={handleRestart} />
|
<MenuItem icon={FrigateRestartIcon} label="Restart Frigate" onSelect={handleRestart} />
|
||||||
</Menu>
|
</Menu>
|
||||||
) : null}
|
) : null}
|
||||||
{showDialog ? (
|
{showDialog ? (
|
||||||
<Prompt
|
<Prompt
|
||||||
onDismiss={handleDismissRestartDialog}
|
onDismiss={handleDismissRestartDialog}
|
||||||
title={t('restart_frigate')}
|
title="Restart Frigate"
|
||||||
text={t('are_you_sure')}
|
text="Are you sure?"
|
||||||
actions={[
|
actions={[
|
||||||
{ text: `${t('yes')}`, color: 'red', onClick: handleClickRestartDialog },
|
{ text: 'Yes', color: 'red', onClick: handleClickRestartDialog },
|
||||||
{ text: `${t('cancel')}`, onClick: handleDismissRestartDialog },
|
{ text: 'Cancel', onClick: handleDismissRestartDialog },
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
{showDialogWait ? (
|
{showDialogWait ? (
|
||||||
<Prompt
|
<Prompt
|
||||||
title={t('restart_in_progress')}
|
title="Restart in progress"
|
||||||
text={t('wait_for_restart')}
|
text="Please wait a few seconds for the restart to complete before reloading the page."
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
</Fragment>
|
</Fragment>
|
||||||
|
|||||||
@ -7,8 +7,10 @@ import RecordingPlaylist from '../components/RecordingPlaylist';
|
|||||||
import VideoPlayer from '../components/VideoPlayer';
|
import VideoPlayer from '../components/VideoPlayer';
|
||||||
import { useApiHost } from '../api';
|
import { useApiHost } from '../api';
|
||||||
import useSWR from 'swr';
|
import useSWR from 'swr';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
export default function Recording({ camera, date, hour = '00', minute = '00', second = '00' }) {
|
export default function Recording({ camera, date, hour = '00', minute = '00', second = '00' }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
const currentDate = useMemo(
|
const currentDate = useMemo(
|
||||||
() => (date ? parseISO(`${date}T${hour || '00'}:${minute || '00'}:${second || '00'}`) : new Date()),
|
() => (date ? parseISO(`${date}T${hour || '00'}:${minute || '00'}:${second || '00'}`) : new Date()),
|
||||||
[date, hour, minute, second]
|
[date, hour, minute, second]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user