mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-01-21 00:06:44 +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,
|
||||
"started": int(time.time()),
|
||||
"latest_frigate_version": get_latest_version(config),
|
||||
"last_updated": int(time.time()),
|
||||
}
|
||||
return stats_tracking
|
||||
|
||||
@ -244,6 +245,7 @@ def stats_snapshot(
|
||||
"latest_version": stats_tracking["latest_frigate_version"],
|
||||
"storage": {},
|
||||
"temperatures": get_temperatures(),
|
||||
"last_updated": int(time.time()),
|
||||
}
|
||||
|
||||
for path in [RECORD_DIR, CLIPS_DIR, CACHE_DIR, "/dev/shm"]:
|
||||
|
@ -29,3 +29,4 @@ class StatsTrackingTypes(TypedDict):
|
||||
detectors: dict[str, ObjectDetectProcess]
|
||||
started: int
|
||||
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 { useState } from 'preact/hooks';
|
||||
import Dialog from '../components/Dialog';
|
||||
import TimeAgo from '../components/TimeAgo';
|
||||
import copy from 'copy-to-clipboard';
|
||||
|
||||
const emptyObject = Object.freeze({});
|
||||
@ -84,6 +85,12 @@ export default function System() {
|
||||
System <span className="text-sm">{service.version}</span>
|
||||
</Heading>
|
||||
|
||||
{service.last_updated && (
|
||||
<p>
|
||||
<span>Last refreshed: <TimeAgo time={service.last_updated * 1000} dense /></span>
|
||||
</p>
|
||||
)}
|
||||
|
||||
{state.showFfprobe && (
|
||||
<Dialog>
|
||||
<div className="p-4">
|
||||
|
Loading…
Reference in New Issue
Block a user