fix: utiliser /api/proxmox/resources pour les LXC (même endpoint que Proxmox.vue)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
enzo 2026-03-21 01:20:17 +01:00
parent 53c535844e
commit 8019b1475d

View file

@ -182,17 +182,17 @@ async function loadTargets() {
const list: Target[] = [
{ id: 'host', name: 'Proxmox Host', status: 'running', packages: null, checking: false, updating: false, showPackages: false, error: null },
]
const res = await fetch('/api/proxmox/lxc', {
const res = await fetch('/api/proxmox/resources', {
headers: { Authorization: `Bearer ${authStore.accessToken}` },
})
if (res.ok) {
const lxcs: any[] = await res.json() || []
for (const lxc of lxcs) {
const resources: any[] = await res.json() || []
for (const r of resources.filter((r: any) => r.type === 'lxc')) {
list.push({
id: `lxc:${lxc.vmid}`,
name: lxc.name || `LXC ${lxc.vmid}`,
status: lxc.status,
vmid: lxc.vmid,
id: `lxc:${r.vmid}`,
name: r.name || `LXC ${r.vmid}`,
status: r.status,
vmid: r.vmid,
packages: null,
checking: false,
updating: false,