mirror of
https://github.com/alexhopeoconnor/frigate.git
synced 2026-10-21 02:35:58 +10:00
feat!: web user interface
This commit is contained in:
committed by
Blake Blackshear
parent
bf5ec2f65f
commit
d4941f2a5f
@@ -0,0 +1,16 @@
|
||||
import { h } from 'preact';
|
||||
import { ApiHost } from './context';
|
||||
import { useContext, useEffect, useState } from 'preact/hooks';
|
||||
|
||||
export default function Debug() {
|
||||
const apiHost = useContext(ApiHost);
|
||||
const [config, setConfig] = useState({});
|
||||
|
||||
useEffect(async () => {
|
||||
const response = await fetch(`${apiHost}/api/stats`);
|
||||
const data = response.ok ? await response.json() : {};
|
||||
setConfig(data);
|
||||
}, []);
|
||||
|
||||
return <pre>{JSON.stringify(config, null, 2)}</pre>;
|
||||
}
|
||||
Reference in New Issue
Block a user