mirror of
https://github.com/fosrl/pangolin.git
synced 2026-07-06 20:29:50 +00:00
Add crud for browser targets
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user