This commit is contained in:
Mateusz Gruszczyński
2025-10-17 14:50:33 +02:00
parent 6d11e8302a
commit 4ffa1af2d1

View File

@@ -296,7 +296,7 @@ function renderNodeDetailCard(d) {
const tm = d.time || {};
const netcfg = ensureArr(d.network_cfg);
const disks = ensureArr(d.disks);
const sub = d.subscription || {};
const subscription = d.subscription || {}; // <-- JEDYNA deklaracja (zamiast podwójnego 'const sub')
// robust online detection
const isOn = /online|running/i.test(st.status || '') ||
@@ -311,7 +311,7 @@ function renderNodeDetailCard(d) {
const root = st.rootfs || {};
const load = Array.isArray(st.loadavg) ? st.loadavg.join(' ') : (st.loadavg || '');
// ---- SYSTEM DETAILS (new content)
// ---- SYSTEM DETAILS
const cpuinfo = st.cpuinfo || {};
const boot = st['boot-info'] || st.boot_info || {};
const curKernel = st['current-kernel'] || st.current_kernel || {};
@@ -361,7 +361,6 @@ function renderNodeDetailCard(d) {
</div></div></div>
</div>`;
// --- SYSTEM DETAILS GRID (requested fields)
const sysDetails = kvGrid(tech, Object.keys(tech), {
'PVE version': 'PVE version',
'Kernel': 'Kernel version',
@@ -373,7 +372,7 @@ function renderNodeDetailCard(d) {
});
// Network config
const netRows = ensureArr(d.network_cfg).map(n => {
const netRows = netcfg.map(n => {
return rowHTML([safe(n.iface || n.ifname), safe(n.type), safe(n.method || n.autostart), safe(n.bridge_ports || n.address || '—'), safe(n.cidr || n.netmask || '—'), safe(n.comments || '')]);
});
const netCfgTable = `
@@ -385,7 +384,7 @@ function renderNodeDetailCard(d) {
</div>`;
// Disks
const diskRows = ensureArr(d.disks).map(dv => rowHTML([safe(dv.devpath || dv.kname || dv.dev), safe(dv.model), safe(dv.size ? humanBytes(dv.size) : '—'), safe(dv.health || dv.wearout || '—'), safe(dv.serial || '—')]));
const diskRows = disks.map(dv => rowHTML([safe(dv.devpath || dv.kname || dv.dev), safe(dv.model), safe(dv.size ? humanBytes(dv.size) : '—'), safe(dv.health || dv.wearout || '—'), safe(dv.serial || '—')]));
const diskTable = `
<div class="table-responsive">
<table class="table table-sm table-striped align-middle table-nowrap">
@@ -395,12 +394,11 @@ function renderNodeDetailCard(d) {
</div>`;
// Subscription
const sub = d.subscription || {};
const subBox = `
<div class="small">
<div>Status: ${badge(safe(sub.status || 'unknown'), /active|valid/i.test(sub.status || '') ? 'ok' : 'warn')}</div>
${sub.productname ? `<div>Product: <strong>${safe(sub.productname)}</strong></div>` : ''}
${sub.message ? `<div class="text-muted">${safe(sub.message)}</div>` : ''}
<div>Status: ${badge(safe(subscription.status || 'unknown'), /active|valid/i.test(subscription.status || '') ? 'ok' : 'warn')}</div>
${subscription.productname ? `<div>Product: <strong>${safe(subscription.productname)}</strong></div>` : ''}
${subscription.message ? `<div class="text-muted">${safe(subscription.message)}</div>` : ''}
</div>`;
// Collapsible raw JSON