diff --git a/src/components/ContainerInfo.tsx b/src/components/ContainerInfo.tsx index 808f06c..ddf0d13 100644 --- a/src/components/ContainerInfo.tsx +++ b/src/components/ContainerInfo.tsx @@ -8,6 +8,7 @@ export default function ContainerInfo() { useEffect(() => { const updateInfo = async () => { const stats = await fetch(`https://api.ssh.surf/info`, { + // @ts-ignore headers: { "x-ssh-auth": localStorage.getItem("key") }, }); diff --git a/src/components/Login.tsx b/src/components/Login.tsx index 8d39ed6..395f763 100644 --- a/src/components/Login.tsx +++ b/src/components/Login.tsx @@ -9,6 +9,7 @@ export default function Login() { const data = Object.fromEntries(formData); const hello = await fetch(`https://api.ssh.surf/hello`, { + // @ts-ignore headers: { "x-ssh-auth": data.key }, }); diff --git a/src/components/WebTerminal.tsx b/src/components/WebTerminal.tsx index af85c52..8dde262 100644 --- a/src/components/WebTerminal.tsx +++ b/src/components/WebTerminal.tsx @@ -58,7 +58,7 @@ export default function WebTerminal() { terminal.dispose(); }; } - }, []); + }, [container]); return
; } diff --git a/src/main.tsx b/src/main.tsx index f4ddaf4..a394e9a 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -8,6 +8,7 @@ import TerminalPage from "./pages/container/terminal.tsx"; async function loader() { const info = await fetch(`https://api.ssh.surf/info`, { + // @ts-ignore headers: { "x-ssh-auth": localStorage.getItem("key") }, }); diff --git a/src/pages/container/index.tsx b/src/pages/container/index.tsx index 1acb497..1c5f377 100644 --- a/src/pages/container/index.tsx +++ b/src/pages/container/index.tsx @@ -6,15 +6,15 @@ import ContainerInfo from "../../components/ContainerInfo"; export default function ContainerPage() { let container = useLoaderData(); + const revalidator = useRevalidator(); + const [isPowerStateLocked, setPowerStateLocked] = useState