Add crud for browser targets

This commit is contained in:
Owen
2026-05-15 14:07:48 -07:00
parent 0876b482f8
commit 0938997548
20 changed files with 934 additions and 27 deletions

View File

@@ -35,6 +35,7 @@ declare module "react" {
type Target = {
ip: string;
port: number;
authToken: string;
};
type FormState = {
@@ -219,9 +220,16 @@ export default function RdpClient({
);
}
const destination = target ? `${target.ip}:${target.port}` : "";
if (!target) {
toast({
variant: "destructive",
title: "No target",
description: "No connection target available"
});
return;
}
console.log("Starting RDP session with destination:", destination);
const destination = `${target.ip}:${target.port}`;
const builder = userInteraction
.configBuilder()
@@ -232,7 +240,7 @@ export default function RdpClient({
`${window.location.protocol === "https:" ? "wss" : "ws"}://${window.location.host}/gateway/rdp`
)
.withServerDomain(form.domain)
.withAuthToken("test-token")
.withAuthToken(target.authToken)
.withDesktopSize({
width: window.innerWidth,
height: window.innerHeight

View File

@@ -15,7 +15,7 @@ export default async function RdpPage() {
const host = headersList.get("host") || "";
const hostname = host.split(":")[0];
let target: { ip: string; port: number } | null = null;
let target: { ip: string; port: number; authToken: string } | null = null;
let error: string | null = null;
try {