mirror of
https://github.com/CyberL1/dlinux-dashboard.git
synced 2025-01-22 01:19:18 -05:00
chore: add ts-ignore where needed
This commit is contained in:
parent
e47e87199f
commit
238c5a2cec
@ -8,6 +8,7 @@ export default function ContainerInfo() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const updateInfo = async () => {
|
const updateInfo = async () => {
|
||||||
const stats = await fetch(`https://api.ssh.surf/info`, {
|
const stats = await fetch(`https://api.ssh.surf/info`, {
|
||||||
|
// @ts-ignore
|
||||||
headers: { "x-ssh-auth": localStorage.getItem("key") },
|
headers: { "x-ssh-auth": localStorage.getItem("key") },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ export default function Login() {
|
|||||||
const data = Object.fromEntries(formData);
|
const data = Object.fromEntries(formData);
|
||||||
|
|
||||||
const hello = await fetch(`https://api.ssh.surf/hello`, {
|
const hello = await fetch(`https://api.ssh.surf/hello`, {
|
||||||
|
// @ts-ignore
|
||||||
headers: { "x-ssh-auth": data.key },
|
headers: { "x-ssh-auth": data.key },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ export default function WebTerminal() {
|
|||||||
terminal.dispose();
|
terminal.dispose();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}, []);
|
}, [container]);
|
||||||
|
|
||||||
return <div ref={terminalRef} style={{ height: "auto" }} />;
|
return <div ref={terminalRef} style={{ height: "auto" }} />;
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ import TerminalPage from "./pages/container/terminal.tsx";
|
|||||||
|
|
||||||
async function loader() {
|
async function loader() {
|
||||||
const info = await fetch(`https://api.ssh.surf/info`, {
|
const info = await fetch(`https://api.ssh.surf/info`, {
|
||||||
|
// @ts-ignore
|
||||||
headers: { "x-ssh-auth": localStorage.getItem("key") },
|
headers: { "x-ssh-auth": localStorage.getItem("key") },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -6,15 +6,15 @@ import ContainerInfo from "../../components/ContainerInfo";
|
|||||||
|
|
||||||
export default function ContainerPage() {
|
export default function ContainerPage() {
|
||||||
let container = useLoaderData();
|
let container = useLoaderData();
|
||||||
|
const revalidator = useRevalidator();
|
||||||
|
const [isPowerStateLocked, setPowerStateLocked] = useState<boolean>();
|
||||||
|
|
||||||
if (!container.data) {
|
if (!container.data) {
|
||||||
return "Container not found";
|
return "Container not found";
|
||||||
}
|
}
|
||||||
|
|
||||||
container = container.data as InfoData;
|
container = container.data as InfoData;
|
||||||
|
|
||||||
const revalidator = useRevalidator();
|
|
||||||
const [isPowerStateLocked, setPowerStateLocked] = useState<boolean>();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Paper square sx={{ padding: 1 }}>
|
<Paper square sx={{ padding: 1 }}>
|
||||||
<Paper sx={{ display: "flex" }} variant="outlined">
|
<Paper sx={{ display: "flex" }} variant="outlined">
|
||||||
|
@ -1,24 +1,17 @@
|
|||||||
import { useLoaderData } from "react-router";
|
import { useLoaderData } from "react-router";
|
||||||
import { Container } from "../../types";
|
import { InfoData } from "../../types";
|
||||||
import { Paper, Typography } from "@mui/material";
|
import { Paper, Typography } from "@mui/material";
|
||||||
import WebTerminal from "../../components/WebTerminal";
|
import WebTerminal from "../../components/WebTerminal";
|
||||||
|
|
||||||
export async function Loader() {
|
|
||||||
const info = await fetch(`https://api.ssh.surf/info`, {
|
|
||||||
headers: { "x-ssh-auth": localStorage["key"] },
|
|
||||||
});
|
|
||||||
|
|
||||||
const data = await info.json();
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function TerminalPage() {
|
export default function TerminalPage() {
|
||||||
const container = useLoaderData() as Container & { statusCode: number };
|
let container = useLoaderData();
|
||||||
|
|
||||||
if (container.statusCode === 404) {
|
if (!container.data) {
|
||||||
return "Container not found";
|
return "Container not found";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
container = container.data as InfoData;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Paper square sx={{ padding: 1 }}>
|
<Paper square sx={{ padding: 1 }}>
|
||||||
<Paper sx={{ display: "flex" }} variant="outlined">
|
<Paper sx={{ display: "flex" }} variant="outlined">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user