diff --git a/src/components/Login.tsx b/src/components/Login.tsx index 395f763..843f641 100644 --- a/src/components/Login.tsx +++ b/src/components/Login.tsx @@ -17,6 +17,7 @@ export default function Login() { if (json.message.startsWith("Hello")) { localStorage.setItem("key", data.key.toString()); + localStorage.setItem("hostname", json.message.slice(7).replace("!", "")); location.reload(); } } diff --git a/src/components/WebTerminal.tsx b/src/components/WebTerminal.tsx index 8dde262..3a466c4 100644 --- a/src/components/WebTerminal.tsx +++ b/src/components/WebTerminal.tsx @@ -19,7 +19,7 @@ export default function WebTerminal() { const terminal = new Terminal({ rows: 67 }); const socket = new WebSocket( - `ws://127.0.0.1:3000/containers/${container.id}/terminal`, + `ws://127.0.0.1:3000/containers/${container.id}/terminal`, // TODO: Replace this with dlinux ssh connector ); const fitAddon = new FitAddon(); diff --git a/src/pages/App.tsx b/src/pages/App.tsx index 7b7cc3e..c2d7916 100644 --- a/src/pages/App.tsx +++ b/src/pages/App.tsx @@ -26,11 +26,18 @@ interface Item { title: string; icon: keyof typeof Icons; href: string; + openInNewTab?: boolean; } const sidebarItems: Item[] = [ { title: "Info", icon: "Info", href: "/container" }, { title: "Terminal", icon: "Terminal", href: "/container/terminal" }, + { + title: "Syscall", + icon: "Memory", + href: `//${localStorage.getItem("hostname")}.syscall.lol`, + openInNewTab: true, + }, ]; const drawerWidth = 240; @@ -80,6 +87,7 @@ function App({ error }: { error?: boolean }) { key={item.title} component={Link} to={item.href} + target={item.openInNewTab ? "_blank" : "_self"} disablePadding >