mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-07-15 21:03:47 +00:00
fix: overalpping guacd ui
This commit is contained in:
@@ -30,3 +30,4 @@ dist-ssr
|
|||||||
electron/build-info.cjs
|
electron/build-info.cjs
|
||||||
/.mcp.json
|
/.mcp.json
|
||||||
/CLAUDE.md
|
/CLAUDE.md
|
||||||
|
/old_db/
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ export const GuacamoleDisplay = forwardRef<
|
|||||||
typeof document === "undefined" ? true : document.hasFocus(),
|
typeof document === "undefined" ? true : document.hasFocus(),
|
||||||
);
|
);
|
||||||
const [isReady, setIsReady] = useState(false);
|
const [isReady, setIsReady] = useState(false);
|
||||||
|
const [hasError, setHasError] = useState(false);
|
||||||
|
|
||||||
useImperativeHandle(ref, () => ({
|
useImperativeHandle(ref, () => ({
|
||||||
disconnect: () => {
|
disconnect: () => {
|
||||||
@@ -267,6 +268,7 @@ export const GuacamoleDisplay = forwardRef<
|
|||||||
if (isConnectingRef.current) return;
|
if (isConnectingRef.current) return;
|
||||||
isConnectingRef.current = true;
|
isConnectingRef.current = true;
|
||||||
setIsReady(false);
|
setIsReady(false);
|
||||||
|
setHasError(false);
|
||||||
|
|
||||||
// Wait two frames so the container is fully laid out before measuring.
|
// Wait two frames so the container is fully laid out before measuring.
|
||||||
await new Promise<void>((resolve) =>
|
await new Promise<void>((resolve) =>
|
||||||
@@ -386,6 +388,7 @@ export const GuacamoleDisplay = forwardRef<
|
|||||||
client.onerror = (error: Guacamole.Status) => {
|
client.onerror = (error: Guacamole.Status) => {
|
||||||
const errorMessage = error.message || t("guacamole.connectionError");
|
const errorMessage = error.message || t("guacamole.connectionError");
|
||||||
setIsReady(false);
|
setIsReady(false);
|
||||||
|
setHasError(true);
|
||||||
isConnectingRef.current = false;
|
isConnectingRef.current = false;
|
||||||
onError?.(errorMessage);
|
onError?.(errorMessage);
|
||||||
};
|
};
|
||||||
@@ -583,7 +586,10 @@ export const GuacamoleDisplay = forwardRef<
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<SimpleLoader visible={!isReady} message={connectingMessage} />
|
<SimpleLoader
|
||||||
|
visible={!isReady && !hasError}
|
||||||
|
message={connectingMessage}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user