feat: readd mange mode for host manager, guacd toolbar improvements, connection issues, etc.

This commit is contained in:
LukeGus
2026-05-22 00:02:50 -05:00
parent 6bcbadcc25
commit a9f82a5a45
12 changed files with 1120 additions and 434 deletions
+16 -1
View File
@@ -14,9 +14,10 @@ import type { SSHHost } from "@/types";
interface GuacamoleAppProps {
hostId?: string;
tabId?: string;
}
const GuacamoleApp: React.FC<GuacamoleAppProps> = ({ hostId }) => {
const GuacamoleApp: React.FC<GuacamoleAppProps> = ({ hostId, tabId }) => {
const { t } = useTranslation();
return (
@@ -74,6 +75,7 @@ const GuacamoleApp: React.FC<GuacamoleAppProps> = ({ hostId }) => {
<GuacamoleAppInner
hostId={parseInt(hostId, 10)}
hostConfig={hostConfig}
tabId={tabId}
/>
);
}}
@@ -84,11 +86,13 @@ const GuacamoleApp: React.FC<GuacamoleAppProps> = ({ hostId }) => {
interface GuacamoleAppInnerProps {
hostId: number;
hostConfig: Pick<SSHHost, "connectionType">;
tabId?: string;
}
const GuacamoleAppInner: React.FC<GuacamoleAppInnerProps> = ({
hostId,
hostConfig,
tabId,
}) => {
const { t } = useTranslation();
const [token, setToken] = useState<string | null>(null);
@@ -121,6 +125,17 @@ const GuacamoleAppInner: React.FC<GuacamoleAppInnerProps> = ({
setRetryCount((c) => c + 1);
}, []);
useEffect(() => {
if (!tabId) return;
const handler = (e: Event) => {
const { tabId: eventTabId } = (e as CustomEvent).detail;
if (eventTabId === tabId) handleReconnect();
};
window.addEventListener("termix:refresh-guacamole", handler);
return () =>
window.removeEventListener("termix:refresh-guacamole", handler);
}, [tabId, handleReconnect]);
if (error) {
return (
<div