This commit is contained in:
2024-11-08 15:09:32 +07:00
parent 11b063c2fa
commit ca3fe7150b
6 changed files with 40 additions and 30 deletions
@@ -15,25 +15,25 @@ const HomePage = () => {
type: "ssh",
params: { hostId: "01jc3v9w609f8e2wzw60amv195" },
},
{
id: "2",
type: "pve",
params: { client: "vnc", hostId: "01jc3wp2b3zvgr777f4e3caw4w" },
},
{
id: "3",
type: "pve",
params: { client: "xtermjs", hostId: "01jc3z3yyn2fgb77tyfxc1tkfy" },
},
{
id: "4",
type: "incus",
params: {
client: "xtermjs",
hostId: "01jc3xz9db0v54dg10hk70a13b",
shell: "fish",
},
},
// {
// id: "2",
// type: "pve",
// params: { client: "vnc", hostId: "01jc3wp2b3zvgr777f4e3caw4w" },
// },
// {
// id: "3",
// type: "pve",
// params: { client: "xtermjs", hostId: "01jc3z3yyn2fgb77tyfxc1tkfy" },
// },
// {
// id: "4",
// type: "incus",
// params: {
// client: "xtermjs",
// hostId: "01jc3xz9db0v54dg10hk70a13b",
// shell: "fish",
// },
// },
]);
const [curSession, setSession] = useState(0);
@@ -5,16 +5,12 @@ import VNCViewer from "./vncviewer";
type SSHSessionProps = {
type: "ssh";
params: {
hostId: string;
};
};
type PVESessionProps = {
type: "pve";
params: {
client: "vnc" | "xtermjs";
hostId: string;
};
};
@@ -22,15 +18,15 @@ type IncusSessionProps = {
type: "incus";
params: {
client: "vnc" | "xtermjs";
hostId: string;
shell?: string;
};
};
export type InteractiveSessionProps =
export type InteractiveSessionProps = { params: { hostId: string } } & (
| SSHSessionProps
| PVESessionProps
| IncusSessionProps;
| IncusSessionProps
);
const InteractiveSession = ({ type, params }: InteractiveSessionProps) => {
const query = new URLSearchParams(params);