mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-10 21:25:24 +03:00
Use keys api
This commit is contained in:
parent
135ca53113
commit
1e62643c56
@ -127,7 +127,9 @@ def stats():
|
||||
|
||||
@bp.route("/stats/history")
|
||||
def stats_history():
|
||||
return jsonify(current_app.stats_emitter.get_stats_history())
|
||||
json: dict[str, any] = request.get_json(silent=True) or {}
|
||||
keys = json.get("keys")
|
||||
return jsonify(current_app.stats_emitter.get_stats_history(keys))
|
||||
|
||||
|
||||
@bp.route("/config")
|
||||
|
||||
@ -67,7 +67,7 @@ class StatsEmitter(threading.Thread):
|
||||
|
||||
def run(self) -> None:
|
||||
time.sleep(10)
|
||||
for counter in itertools.cycle(range(self.config.record.expire_interval)):
|
||||
for counter in itertools.cycle(range(int(self.config.record.expire_interval / 10))):
|
||||
if self.stop_event.wait(10):
|
||||
break
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ export default function SystemGraph({
|
||||
if (value >= threshold.error) {
|
||||
return "#FA5252";
|
||||
} else if (value >= threshold.warning) {
|
||||
return "#aa00aa";
|
||||
return "#FF9966";
|
||||
} else {
|
||||
return "#404040";
|
||||
}
|
||||
|
||||
@ -57,7 +57,10 @@ function StatusAlertNav() {
|
||||
<DrawerContent className="max-h-[75dvh] px-2 mx-1 rounded-t-2xl overflow-hidden">
|
||||
<div className="w-full h-auto py-4 overflow-y-auto overflow-x-hidden flex flex-col items-center gap-2">
|
||||
{potentialProblems.map((prob) => (
|
||||
<div className="w-full flex items-center text-xs gap-2 capitalize">
|
||||
<div
|
||||
key={prob.text}
|
||||
className="w-full flex items-center text-xs gap-2 capitalize"
|
||||
>
|
||||
<IoIosWarning className={`size-5 ${prob.color}`} />
|
||||
{prob.text}
|
||||
</div>
|
||||
|
||||
@ -14,7 +14,9 @@ import {
|
||||
function System() {
|
||||
const { data: config } = useSWR<FrigateConfig>("config");
|
||||
|
||||
// stats
|
||||
// stats chunks
|
||||
|
||||
// stats collection
|
||||
|
||||
const { data: initialStats } = useSWR<FrigateStats[]>("stats/history", {
|
||||
revalidateOnFocus: false,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user