feat: add more system stats i18n keys

This commit is contained in:
ZhaiSoul 2025-04-16 05:07:17 +00:00
parent 371e9b41f8
commit fcff05f901
2 changed files with 15 additions and 4 deletions

View File

@ -142,7 +142,10 @@
"ffmpegHighCpuUsage": "{{camera}} has high FFMPEG CPU usage ({{ffmpegAvg}}%)",
"detectHighCpuUsage": "{{camera}} has high detect CPU usage ({{detectAvg}}%)",
"healthy": "System is healthy",
"reindexingEmbeddings": "Reindexing embeddings ({{processed}}% complete)"
"reindexingEmbeddings": "Reindexing embeddings ({{processed}}% complete)",
"cameraIsOffline": "{{camera}} is offline",
"detectIsSlow": "{{detect}} is slow ({{speed}} ms)",
"detectIsVerySlow": "{{detect}} is very slow ({{speed}} ms)"
},
"enrichments": {
"title": "Enrichments",

View File

@ -36,13 +36,19 @@ export default function useStats(stats: FrigateStats | undefined) {
Object.entries(memoizedStats["detectors"]).forEach(([key, det]) => {
if (det["inference_speed"] > InferenceThreshold.error) {
problems.push({
text: `${capitalizeFirstLetter(key)} is very slow (${det["inference_speed"]} ms)`,
text: t("stats.detectIsVerySlow", {
detect: capitalizeFirstLetter(key),
speed: det["inference_speed"],
}),
color: "text-danger",
relevantLink: "/system#general",
});
} else if (det["inference_speed"] > InferenceThreshold.warning) {
problems.push({
text: `${capitalizeFirstLetter(key)} is slow (${det["inference_speed"]} ms)`,
text: t("stats.detectIsSlow", {
detect: capitalizeFirstLetter(key),
speed: det["inference_speed"],
}),
color: "text-orange-400",
relevantLink: "/system#general",
});
@ -57,7 +63,9 @@ export default function useStats(stats: FrigateStats | undefined) {
if (config.cameras[name].enabled && cam["camera_fps"] == 0) {
problems.push({
text: `${capitalizeFirstLetter(name.replaceAll("_", " "))} is offline`,
text: t("stats.cameraIsOffline", {
camera: capitalizeFirstLetter(name.replaceAll("_", " ")),
}),
color: "text-danger",
relevantLink: "logs",
});