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:
parent
53c535844e
commit
8019b1475d
1 changed files with 7 additions and 7 deletions
|
|
@ -182,17 +182,17 @@ async function loadTargets() {
|
||||||
const list: Target[] = [
|
const list: Target[] = [
|
||||||
{ id: 'host', name: 'Proxmox Host', status: 'running', packages: null, checking: false, updating: false, showPackages: false, error: null },
|
{ 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}` },
|
headers: { Authorization: `Bearer ${authStore.accessToken}` },
|
||||||
})
|
})
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
const lxcs: any[] = await res.json() || []
|
const resources: any[] = await res.json() || []
|
||||||
for (const lxc of lxcs) {
|
for (const r of resources.filter((r: any) => r.type === 'lxc')) {
|
||||||
list.push({
|
list.push({
|
||||||
id: `lxc:${lxc.vmid}`,
|
id: `lxc:${r.vmid}`,
|
||||||
name: lxc.name || `LXC ${lxc.vmid}`,
|
name: r.name || `LXC ${r.vmid}`,
|
||||||
status: lxc.status,
|
status: r.status,
|
||||||
vmid: lxc.vmid,
|
vmid: r.vmid,
|
||||||
packages: null,
|
packages: null,
|
||||||
checking: false,
|
checking: false,
|
||||||
updating: false,
|
updating: false,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue