From 9b63e4fbda902a6a3a94014577dcbc86617b72a8 Mon Sep 17 00:00:00 2001 From: UUBulb <35923940+uubulb@users.noreply.github.com> Date: Wed, 5 Feb 2025 18:46:42 +0800 Subject: [PATCH] bug fixes (#116) * bug fixes * fix ws url --- src/components/fm.tsx | 3 ++- src/components/server-config-batch.tsx | 16 +++++++++++++--- src/components/server-config.tsx | 22 ++++------------------ src/components/terminal.tsx | 3 ++- src/components/xui/pusher.tsx | 4 +++- src/locales/en/translation.json | 5 ++++- src/routes/server.tsx | 2 +- src/routes/settings.tsx | 4 +--- 8 files changed, 30 insertions(+), 29 deletions(-) diff --git a/src/components/fm.tsx b/src/components/fm.tsx index a8aff7e..178a3da 100644 --- a/src/components/fm.tsx +++ b/src/components/fm.tsx @@ -161,7 +161,8 @@ const FMComponent: React.FC = ({ wsUrl, } useEffect(() => { - const ws = new WebSocket(wsUrl) + const url = new URL(wsUrl, window.location.origin) + const ws = new WebSocket(url) wsRef.current = ws ws.binaryType = "arraybuffer" ws.onopen = () => { diff --git a/src/components/server-config-batch.tsx b/src/components/server-config-batch.tsx index 57a2ed6..793e3b5 100644 --- a/src/components/server-config-batch.tsx +++ b/src/components/server-config-batch.tsx @@ -54,7 +54,17 @@ export const ServerConfigCardBatch: React.FC = ({ si setOpen(false) } - return ( + return sid.length < 1 ? ( + { + toast(t("Error"), { + description: t("Results.NoRowsAreSelected"), + }) + }} + /> + ) : ( @@ -67,7 +77,7 @@ export const ServerConfigCardBatch: React.FC = ({ si
- + = ({ si setCurrentKey(e.target.value) }} /> - +