Pull in the destination from the api

This commit is contained in:
Owen
2026-05-15 11:48:13 -07:00
parent 868bcd8e34
commit 6010515da0
6 changed files with 29 additions and 20 deletions

View File

@@ -223,9 +223,9 @@ export default function RdpClient({
);
}
const destination = target
? `${target.ip}:${target.port}`
: "";
const destination = target ? `${target.ip}:${target.port}` : "";
console.log("Starting RDP session with destination:", destination);
const builder = userInteraction
.configBuilder()

View File

@@ -1,5 +1,5 @@
import { headers } from "next/headers";
import { internal } from "@app/lib/api";
import { priv } from "@app/lib/api";
import { AxiosResponse } from "axios";
import { GetBrowserTargetResponse } from "@server/routers/resource";
import RdpClient from "./RdpClient";
@@ -19,11 +19,13 @@ export default async function RdpPage() {
let error: string | null = null;
try {
const res = await internal.get<AxiosResponse<GetBrowserTargetResponse>>(
const res = await priv.get<AxiosResponse<GetBrowserTargetResponse>>(
`/resource/browser-target?fullDomain=${encodeURIComponent(hostname)}`
);
target = res.data.data;
} catch {
console.log("Fetched browser target:", target);
} catch (error) {
console.error("Error fetching browser target:", error);
error = "No resource found for this domain";
}

View File

@@ -1,5 +1,5 @@
import { headers } from "next/headers";
import { internal } from "@app/lib/api";
import { priv } from "@app/lib/api";
import { AxiosResponse } from "axios";
import { GetBrowserTargetResponse } from "@server/routers/resource";
import SshClient from "./SshClient";
@@ -19,11 +19,12 @@ export default async function SshPage() {
let error: string | null = null;
try {
const res = await internal.get<AxiosResponse<GetBrowserTargetResponse>>(
const res = await priv.get<AxiosResponse<GetBrowserTargetResponse>>(
`/resource/browser-target?fullDomain=${encodeURIComponent(hostname)}`
);
target = res.data.data;
} catch {
} catch (error) {
console.error("Error fetching browser target:", error);
error = "No resource found for this domain";
}

View File

@@ -1,5 +1,5 @@
import { headers } from "next/headers";
import { internal } from "@app/lib/api";
import { priv } from "@app/lib/api";
import { AxiosResponse } from "axios";
import { GetBrowserTargetResponse } from "@server/routers/resource";
import VncClient from "./VncClient";
@@ -19,11 +19,12 @@ export default async function VncPage() {
let error: string | null = null;
try {
const res = await internal.get<AxiosResponse<GetBrowserTargetResponse>>(
const res = await priv.get<AxiosResponse<GetBrowserTargetResponse>>(
`/resource/browser-target?fullDomain=${encodeURIComponent(hostname)}`
);
target = res.data.data;
} catch {
} catch (error) {
console.error("Error fetching browser target:", error);
error = "No resource found for this domain";
}