mirror of
https://github.com/fosrl/pangolin.git
synced 2026-06-05 23:28:44 +00:00
Pull in the destination from the api
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user