mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-24 07:44:30 +03:00
fix: fix stats camera if not nickname need capitalize
This commit is contained in:
parent
48934e0b12
commit
1d3620a76c
@ -8,7 +8,7 @@ import { FrigateStats, PotentialProblem } from "@/types/stats";
|
|||||||
import { useMemo } from "react";
|
import { useMemo } from "react";
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
import useDeepMemo from "./use-deep-memo";
|
import useDeepMemo from "./use-deep-memo";
|
||||||
import { capitalizeFirstLetter } from "@/utils/stringUtil";
|
import { capitalizeAll, capitalizeFirstLetter } from "@/utils/stringUtil";
|
||||||
import { useFrigateStats } from "@/api/ws";
|
import { useFrigateStats } from "@/api/ws";
|
||||||
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
@ -65,7 +65,7 @@ export default function useStats(stats: FrigateStats | undefined) {
|
|||||||
if (config.cameras[name].enabled && cam["camera_fps"] == 0) {
|
if (config.cameras[name].enabled && cam["camera_fps"] == 0) {
|
||||||
problems.push({
|
problems.push({
|
||||||
text: t("stats.cameraIsOffline", {
|
text: t("stats.cameraIsOffline", {
|
||||||
camera: capitalizeFirstLetter(cameraName),
|
camera: capitalizeFirstLetter(capitalizeAll(cameraName)),
|
||||||
}),
|
}),
|
||||||
color: "text-danger",
|
color: "text-danger",
|
||||||
relevantLink: "logs",
|
relevantLink: "logs",
|
||||||
@ -86,7 +86,7 @@ export default function useStats(stats: FrigateStats | undefined) {
|
|||||||
if (!isNaN(ffmpegAvg) && ffmpegAvg >= CameraFfmpegThreshold.error) {
|
if (!isNaN(ffmpegAvg) && ffmpegAvg >= CameraFfmpegThreshold.error) {
|
||||||
problems.push({
|
problems.push({
|
||||||
text: t("stats.ffmpegHighCpuUsage", {
|
text: t("stats.ffmpegHighCpuUsage", {
|
||||||
camera: capitalizeFirstLetter(cameraName),
|
camera: capitalizeFirstLetter(capitalizeAll(cameraName)),
|
||||||
ffmpegAvg,
|
ffmpegAvg,
|
||||||
}),
|
}),
|
||||||
color: "text-danger",
|
color: "text-danger",
|
||||||
@ -97,7 +97,7 @@ export default function useStats(stats: FrigateStats | undefined) {
|
|||||||
if (!isNaN(detectAvg) && detectAvg >= CameraDetectThreshold.error) {
|
if (!isNaN(detectAvg) && detectAvg >= CameraDetectThreshold.error) {
|
||||||
problems.push({
|
problems.push({
|
||||||
text: t("stats.detectHighCpuUsage", {
|
text: t("stats.detectHighCpuUsage", {
|
||||||
camera: capitalizeFirstLetter(cameraName),
|
camera: capitalizeFirstLetter(capitalizeAll(cameraName)),
|
||||||
detectAvg,
|
detectAvg,
|
||||||
}),
|
}),
|
||||||
color: "text-danger",
|
color: "text-danger",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user