forked from Github/frigate
hide recordings page if record is not enabled, show error if no recordings available.
This commit is contained in:
committed by
Blake Blackshear
parent
0bb998c465
commit
68dfaaf767
@@ -9,7 +9,7 @@ import NavigationDrawer, { Destination, Separator } from './components/Navigatio
|
||||
|
||||
export default function Sidebar() {
|
||||
const { data: config } = useConfig();
|
||||
const cameras = useMemo(() => Object.keys(config.cameras), [config]);
|
||||
const cameras = useMemo(() => Object.entries(config.cameras), [config]);
|
||||
|
||||
return (
|
||||
<NavigationDrawer header={<Header />}>
|
||||
@@ -19,7 +19,7 @@ export default function Sidebar() {
|
||||
matches ? (
|
||||
<Fragment>
|
||||
<Separator />
|
||||
{cameras.map((camera) => (
|
||||
{cameras.map(([camera]) => (
|
||||
<Destination href={`/cameras/${camera}`} text={camera} />
|
||||
))}
|
||||
<Separator />
|
||||
@@ -32,13 +32,18 @@ export default function Sidebar() {
|
||||
matches ? (
|
||||
<Fragment>
|
||||
<Separator />
|
||||
{cameras.map((camera) => (
|
||||
<Destination
|
||||
path={`/recording/${camera}/:date?/:hour?/:seconds?`}
|
||||
href={`/recording/${camera}`}
|
||||
text={camera}
|
||||
/>
|
||||
))}
|
||||
{cameras.map(([camera, conf]) => {
|
||||
if (conf.record.enabled) {
|
||||
return (
|
||||
<Destination
|
||||
path={`/recording/${camera}/:date?/:hour?/:seconds?`}
|
||||
href={`/recording/${camera}`}
|
||||
text={camera}
|
||||
/>
|
||||
);
|
||||
}
|
||||
return null;
|
||||
})}
|
||||
<Separator />
|
||||
</Fragment>
|
||||
) : null
|
||||
|
||||
Reference in New Issue
Block a user