mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 09:45:22 +03:00
Add logs route
This commit is contained in:
parent
2a94db688b
commit
01284740a8
@ -48,6 +48,7 @@ export default function Sidebar() {
|
||||
<Destination href="/storage" text="Storage" />
|
||||
<Destination href="/system" text="System" />
|
||||
<Destination href="/config" text="Config" />
|
||||
<Destination href="/logs" text="Logs" />
|
||||
<Separator />
|
||||
<div className="flex flex-grow" />
|
||||
{ENV !== 'production' ? (
|
||||
|
||||
@ -38,6 +38,7 @@ export default function App() {
|
||||
<AsyncRoute path="/storage" getComponent={Routes.getStorage} />
|
||||
<AsyncRoute path="/system" getComponent={Routes.getSystem} />
|
||||
<AsyncRoute path="/config" getComponent={Routes.getConfig} />
|
||||
<AsyncRoute path="/logs" getComponent={Routes.getLogs} />
|
||||
<AsyncRoute path="/styleguide" getComponent={Routes.getStyleGuide} />
|
||||
<Cameras default path="/" />
|
||||
</Router>
|
||||
|
||||
26
web/src/routes/Logs.jsx
Normal file
26
web/src/routes/Logs.jsx
Normal file
@ -0,0 +1,26 @@
|
||||
import { h } from 'preact';
|
||||
import Heading from '../components/Heading';
|
||||
import { useEffect } from 'preact/hooks';
|
||||
import { tail } from 'tail';
|
||||
|
||||
const Tail = tail.Tail;
|
||||
|
||||
export default function Logs() {
|
||||
const stdout = new Tail("/dev/stdout");
|
||||
|
||||
useEffect(() => {
|
||||
stdout.on("line", (data) => {
|
||||
console.log(data);
|
||||
});
|
||||
|
||||
return () => {
|
||||
stdout.unwatch();
|
||||
};
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="space-y-4 p-2 px-4">
|
||||
<Heading>Logs</Heading>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@ -43,6 +43,11 @@ export async function getConfig(_url, _cb, _props) {
|
||||
return module.default;
|
||||
}
|
||||
|
||||
export async function getLogs(_url, _cb, _props) {
|
||||
const module = await import('./Logs.jsx');
|
||||
return module.default;
|
||||
}
|
||||
|
||||
export async function getStyleGuide(_url, _cb, _props) {
|
||||
const module = await import('./StyleGuide.jsx');
|
||||
return module.default;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user