diff --git a/src/backend/ssh/docker-console.ts b/src/backend/ssh/docker-console.ts index 1ee99ecb..e68c9723 100644 --- a/src/backend/ssh/docker-console.ts +++ b/src/backend/ssh/docker-console.ts @@ -23,7 +23,7 @@ const activeSessions = new Map(); const wss = new WebSocketServer({ port: 30008, - verifyClient: async (info, callback) => { + verifyClient: async (info) => { try { const url = parseUrl(info.req.url || "", true); const token = url.query.token as string; @@ -32,7 +32,7 @@ const wss = new WebSocketServer({ dockerConsoleLogger.warn("WebSocket connection rejected: No token", { operation: "ws_verify", }); - return callback(false, 401, "Authentication required"); + return false; } const authManager = AuthManager.getInstance(); @@ -45,17 +45,15 @@ const wss = new WebSocketServer({ operation: "ws_verify", }, ); - return callback(false, 401, "Invalid token"); + return false; } - (info.req as any).userId = decoded.userId; - - callback(true); + return true; } catch (error) { dockerConsoleLogger.error("WebSocket verification error", error, { operation: "ws_verify", }); - callback(false, 500, "Authentication failed"); + return false; } }, }); diff --git a/src/ui/desktop/authentication/ElectronServerConfig.tsx b/src/ui/desktop/authentication/ElectronServerConfig.tsx index 4def9af3..27b96da5 100644 --- a/src/ui/desktop/authentication/ElectronServerConfig.tsx +++ b/src/ui/desktop/authentication/ElectronServerConfig.tsx @@ -10,6 +10,7 @@ import { type ServerConfig, } from "@/ui/main-axios.ts"; import { Server } from "lucide-react"; +import { useTheme } from "@/components/theme-provider"; interface ServerConfigProps { onServerConfigured: (serverUrl: string) => void; @@ -23,10 +24,17 @@ export function ElectronServerConfig({ isFirstTime = false, }: ServerConfigProps) { const { t } = useTranslation(); + const { theme } = useTheme(); const [serverUrl, setServerUrl] = useState(""); const [loading, setLoading] = useState(false); const [error, setError] = useState(null); + const isDarkMode = + theme === "dark" || + (theme === "system" && + window.matchMedia("(prefers-color-scheme: dark)").matches); + const lineColor = isDarkMode ? "#151517" : "#f9f9f9"; + useEffect(() => { loadServerConfig(); }, []); @@ -88,68 +96,84 @@ export function ElectronServerConfig({ }; return ( -
-
-
- -
-

{t("serverConfig.title")}

-

- {t("serverConfig.description")} -

-
-
-
- - handleUrlChange(e.target.value)} - className="w-full h-10" - disabled={loading} - /> -
+
+
+
+
+
+ +
+

{t("serverConfig.title")}

+

+ {t("serverConfig.description")} +

+
+
+
+ + handleUrlChange(e.target.value)} + className="w-full h-10" + disabled={loading} + /> +
- {error && ( - - {t("common.error")} - {error} - - )} - -
- {onCancel && !isFirstTime && ( - - )} - -
-
- {t("serverConfig.helpText")} +
+ {onCancel && !isFirstTime && ( + + )} + +
+ +
+ {t("serverConfig.helpText")} +
+
diff --git a/src/ui/desktop/user/ElectronVersionCheck.tsx b/src/ui/desktop/user/ElectronVersionCheck.tsx index c2fb3561..85a0cda3 100644 --- a/src/ui/desktop/user/ElectronVersionCheck.tsx +++ b/src/ui/desktop/user/ElectronVersionCheck.tsx @@ -3,6 +3,7 @@ import { Button } from "@/components/ui/button.tsx"; import { VersionAlert } from "@/components/ui/version-alert.tsx"; import { useTranslation } from "react-i18next"; import { checkElectronUpdate, isElectron } from "@/ui/main-axios.ts"; +import { useTheme } from "@/components/theme-provider"; interface VersionCheckModalProps { onContinue: () => void; @@ -14,6 +15,7 @@ export function ElectronVersionCheck({ isAuthenticated = false, }: VersionCheckModalProps) { const { t } = useTranslation(); + const { theme } = useTheme(); const [versionInfo, setVersionInfo] = useState { if (isElectron()) { checkForUpdates(); @@ -83,8 +91,20 @@ export function ElectronVersionCheck({ if (versionChecking && !versionInfo) { return ( -
-
+
+
@@ -98,8 +118,20 @@ export function ElectronVersionCheck({ if (!versionInfo || versionDismissed) { return ( -
-
+
+

{t("versionCheck.checkUpdates")} @@ -126,8 +158,20 @@ export function ElectronVersionCheck({ } return ( -
-
+
+

{t("versionCheck.updateRequired")}