mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-01-31 00:18:55 +01:00
System page: add last updated time ago (#5195)
This commit is contained in:
parent
7926ddd008
commit
11054daebe
@ -53,6 +53,7 @@ def stats_init(
|
|||||||
"detectors": detectors,
|
"detectors": detectors,
|
||||||
"started": int(time.time()),
|
"started": int(time.time()),
|
||||||
"latest_frigate_version": get_latest_version(config),
|
"latest_frigate_version": get_latest_version(config),
|
||||||
|
"last_updated": int(time.time()),
|
||||||
}
|
}
|
||||||
return stats_tracking
|
return stats_tracking
|
||||||
|
|
||||||
@ -244,6 +245,7 @@ def stats_snapshot(
|
|||||||
"latest_version": stats_tracking["latest_frigate_version"],
|
"latest_version": stats_tracking["latest_frigate_version"],
|
||||||
"storage": {},
|
"storage": {},
|
||||||
"temperatures": get_temperatures(),
|
"temperatures": get_temperatures(),
|
||||||
|
"last_updated": int(time.time()),
|
||||||
}
|
}
|
||||||
|
|
||||||
for path in [RECORD_DIR, CLIPS_DIR, CACHE_DIR, "/dev/shm"]:
|
for path in [RECORD_DIR, CLIPS_DIR, CACHE_DIR, "/dev/shm"]:
|
||||||
|
@ -29,3 +29,4 @@ class StatsTrackingTypes(TypedDict):
|
|||||||
detectors: dict[str, ObjectDetectProcess]
|
detectors: dict[str, ObjectDetectProcess]
|
||||||
started: int
|
started: int
|
||||||
latest_frigate_version: str
|
latest_frigate_version: str
|
||||||
|
last_updated: int
|
||||||
|
@ -9,6 +9,7 @@ import axios from 'axios';
|
|||||||
import { Table, Tbody, Thead, Tr, Th, Td } from '../components/Table';
|
import { Table, Tbody, Thead, Tr, Th, Td } from '../components/Table';
|
||||||
import { useState } from 'preact/hooks';
|
import { useState } from 'preact/hooks';
|
||||||
import Dialog from '../components/Dialog';
|
import Dialog from '../components/Dialog';
|
||||||
|
import TimeAgo from '../components/TimeAgo';
|
||||||
import copy from 'copy-to-clipboard';
|
import copy from 'copy-to-clipboard';
|
||||||
|
|
||||||
const emptyObject = Object.freeze({});
|
const emptyObject = Object.freeze({});
|
||||||
@ -84,6 +85,12 @@ export default function System() {
|
|||||||
System <span className="text-sm">{service.version}</span>
|
System <span className="text-sm">{service.version}</span>
|
||||||
</Heading>
|
</Heading>
|
||||||
|
|
||||||
|
{service.last_updated && (
|
||||||
|
<p>
|
||||||
|
<span>Last refreshed: <TimeAgo time={service.last_updated * 1000} dense /></span>
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
|
||||||
{state.showFfprobe && (
|
{state.showFfprobe && (
|
||||||
<Dialog>
|
<Dialog>
|
||||||
<div className="p-4">
|
<div className="p-4">
|
||||||
|
Loading…
Reference in New Issue
Block a user