fix: use correct Proxmox console URL format from docs
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import { getNodes, getLXC } from '@/lib/proxmox';
|
||||
|
||||
const PROXMOX_API_URL = process.env.PROXMOX_API_URL || 'https://proxmox:8006/api2/json';
|
||||
const PROXMOX_WEBUI = PROXMOX_API_URL.replace('/api2/json', '');
|
||||
const PROXMOX_WEB_URL = process.env.PROXMOX_WEB_URL || process.env.PROXMOX_API_URL?.replace('/api2/json', '');
|
||||
|
||||
/** @param {import('next').Request} _req */
|
||||
export async function GET(_req) {
|
||||
@@ -17,7 +16,7 @@ export async function GET(_req) {
|
||||
...lxcs.map((lxc) => ({
|
||||
...lxc,
|
||||
node: node.name,
|
||||
consoleUrl: `${PROXMOX_WEBUI}/pve/console.html?node=${encodeURIComponent(node.name)}&vmid=${lxc.vmid}`,
|
||||
consoleUrl: `${PROXMOX_WEB_URL}/?console=lxc&novnc=1&node=${encodeURIComponent(node.name)}&vmid=${lxc.vmid}`,
|
||||
})),
|
||||
);
|
||||
} catch { /* skip node */ }
|
||||
|
||||
Reference in New Issue
Block a user