mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-15 15:45:27 +03:00
Clean up copied gpu info output
This commit is contained in:
parent
b384536f8d
commit
4058524d83
@ -10,6 +10,7 @@ import ActivityIndicator from "../indicators/activity-indicator";
|
||||
import { GpuInfo, Nvinfo, Vainfo } from "@/types/stats";
|
||||
import { Button } from "../ui/button";
|
||||
import copy from "copy-to-clipboard";
|
||||
import { toast } from "sonner";
|
||||
|
||||
type GPUInfoDialogProps = {
|
||||
showGpuInfo: boolean;
|
||||
@ -30,12 +31,11 @@ export default function GPUInfoDialog({
|
||||
|
||||
const onCopyInfo = async () => {
|
||||
copy(
|
||||
JSON.stringify(gpuType == "vainfo" ? vainfo : nvinfo).replace(
|
||||
/[\\\s]+/gi,
|
||||
"",
|
||||
),
|
||||
JSON.stringify(gpuType == "vainfo" ? vainfo : nvinfo)
|
||||
.replace(/\\t/g, "\t")
|
||||
.replace(/\\n/g, "\n"),
|
||||
);
|
||||
setShowGpuInfo(false);
|
||||
toast.success("Copied GPU info to clipboard.");
|
||||
};
|
||||
|
||||
if (gpuType == "vainfo") {
|
||||
|
||||
@ -13,6 +13,7 @@ import useOptimisticState from "@/hooks/use-optimistic-state";
|
||||
import CameraMetrics from "@/views/system/CameraMetrics";
|
||||
import { useHashState } from "@/hooks/use-overlay-state";
|
||||
import { capitalizeFirstLetter } from "@/utils/stringUtil";
|
||||
import { Toaster } from "@/components/ui/sonner";
|
||||
|
||||
const metrics = ["general", "storage", "cameras"] as const;
|
||||
type SystemMetric = (typeof metrics)[number];
|
||||
@ -42,6 +43,7 @@ function System() {
|
||||
|
||||
return (
|
||||
<div className="flex size-full flex-col p-2">
|
||||
<Toaster position="top-center" />
|
||||
<div className="relative flex h-11 w-full items-center justify-between">
|
||||
{isMobile && (
|
||||
<Logo className="absolute inset-x-1/2 h-8 -translate-x-1/2" />
|
||||
|
||||
Loading…
Reference in New Issue
Block a user