From 6b5f7c8642062906ecb36d905e52d0fcc6172783 Mon Sep 17 00:00:00 2001 From: marios8543 Date: Thu, 22 Feb 2024 14:07:59 +0200 Subject: Added log viewer as side-tab in settings --- frontend/src/components/logviewer/LogViewModal.tsx | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 frontend/src/components/logviewer/LogViewModal.tsx (limited to 'frontend/src/components/logviewer/LogViewModal.tsx') diff --git a/frontend/src/components/logviewer/LogViewModal.tsx b/frontend/src/components/logviewer/LogViewModal.tsx new file mode 100644 index 00000000..beda50a3 --- /dev/null +++ b/frontend/src/components/logviewer/LogViewModal.tsx @@ -0,0 +1,45 @@ +import { Focusable } from "decky-frontend-lib"; +import { VFC, useEffect, useState } from "react"; +import { ScrollableWindowRelative } from "./ScrollableWindow"; + +interface LogFileProps { + plugin: string; + name: string; + closeModal?: () => void; +} + +const LogViewModal: VFC = ({ name, plugin, closeModal }) => { + const [logText, setLogText] = useState("Loading text...."); + useEffect(() => { + window.DeckyPluginLoader.callServerMethod("get_plugin_log_text", { + plugin_name: plugin, + log_name: name, + }).then((text) => { + setLogText(text.result || "Error loading text"); + }); + }, []); + + return ( + console.log("Uploading...")} + > + +
+ {logText} +
+
+
+ ); +}; + +export default LogViewModal; -- cgit v1.2.3