Clean up copy output (#14705)

* Remove extra spacing for next/prev carousel buttons

* Clarify ollama genai docs

* Clean up copied gpu info output

* Clean up copied gpu info output

* Better display when manually copying/pasting log data
This commit is contained in:
Josh Hawkins
2024-10-31 14:48:26 -05:00
committed by GitHub
parent ac8ddada0b
commit 9e1a50c3be
3 changed files with 89 additions and 9 deletions

View File

@@ -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") {