Skip to content

Commit

Permalink
UI Tweaks (#12002)
Browse files Browse the repository at this point in the history
* Adjust review padding

* Fix mse check

* Don't fail when cpu property is missing

* ignore lines without any spaces
  • Loading branch information
NickM-27 committed Jun 17, 2024
1 parent 89a478c commit ba6fc0f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 12 deletions.
2 changes: 1 addition & 1 deletion frigate/api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ def logs(service: str):
for rawLine in contents.splitlines():
cleanLine = rawLine.strip()

if len(cleanLine) < 10:
if len(cleanLine) < 10 or " " not in cleanLine:
continue

if dateEnd == 0:
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/player/MsePlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ function MSEPlayer({
setTimeout(() => {
if (
document.visibilityState === "visible" &&
wsRef.current != undefined
wsRef.current != null
) {
onError("stalled");
}
Expand Down
2 changes: 1 addition & 1 deletion web/src/types/review.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ export type MotionData = {
camera: string;
};

export const REVIEW_PADDING = 2;
export const REVIEW_PADDING = 4;
6 changes: 5 additions & 1 deletion web/src/views/events/EventView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,13 @@ export default function EventView({
return;
}

const endTime = review.end_time
? review.end_time + REVIEW_PADDING
: Date.now() / 1000;

axios
.post(
`export/${review.camera}/start/${review.start_time}/end/${review.end_time}`,
`export/${review.camera}/start/${review.start_time - REVIEW_PADDING}/end/${endTime}`,
{ playback: "realtime" },
)
.then((response) => {
Expand Down
24 changes: 16 additions & 8 deletions web/src/views/system/GeneralMetrics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,14 @@ export default function GeneralMetrics({
series[key] = { name: key, data: [] };
}

series[key].data.push({
x: statsIdx + 1,
y: stats.cpu_usages[detStats.pid.toString()].cpu,
});
const data = stats.cpu_usages[detStats.pid.toString()].cpu;

if (data != undefined) {
series[key].data.push({
x: statsIdx + 1,
y: data,
});
}
});
});
return Object.values(series);
Expand Down Expand Up @@ -300,10 +304,14 @@ export default function GeneralMetrics({
series[key] = { name: key, data: [] };
}

series[key].data.push({
x: statsIdx + 1,
y: stats.cpu_usages[procStats.pid.toString()].cpu,
});
const data = stats.cpu_usages[procStats.pid.toString()].cpu;

if (data != undefined) {
series[key].data.push({
x: statsIdx + 1,
y: data,
});
}
}
});
});
Expand Down

0 comments on commit ba6fc0f

Please sign in to comment.