changes
This commit is contained in:
@@ -296,7 +296,7 @@ function renderNodeDetailCard(d) {
|
|||||||
const tm = d.time || {};
|
const tm = d.time || {};
|
||||||
const netcfg = ensureArr(d.network_cfg);
|
const netcfg = ensureArr(d.network_cfg);
|
||||||
const disks = ensureArr(d.disks);
|
const disks = ensureArr(d.disks);
|
||||||
const sub = d.subscription || {};
|
const subscription = d.subscription || {}; // <-- JEDYNA deklaracja (zamiast podwójnego 'const sub')
|
||||||
|
|
||||||
// robust online detection
|
// robust online detection
|
||||||
const isOn = /online|running/i.test(st.status || '') ||
|
const isOn = /online|running/i.test(st.status || '') ||
|
||||||
@@ -311,7 +311,7 @@ function renderNodeDetailCard(d) {
|
|||||||
const root = st.rootfs || {};
|
const root = st.rootfs || {};
|
||||||
const load = Array.isArray(st.loadavg) ? st.loadavg.join(' ') : (st.loadavg || '');
|
const load = Array.isArray(st.loadavg) ? st.loadavg.join(' ') : (st.loadavg || '');
|
||||||
|
|
||||||
// ---- SYSTEM DETAILS (new content)
|
// ---- SYSTEM DETAILS
|
||||||
const cpuinfo = st.cpuinfo || {};
|
const cpuinfo = st.cpuinfo || {};
|
||||||
const boot = st['boot-info'] || st.boot_info || {};
|
const boot = st['boot-info'] || st.boot_info || {};
|
||||||
const curKernel = st['current-kernel'] || st.current_kernel || {};
|
const curKernel = st['current-kernel'] || st.current_kernel || {};
|
||||||
@@ -361,7 +361,6 @@ function renderNodeDetailCard(d) {
|
|||||||
</div></div></div>
|
</div></div></div>
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
// --- SYSTEM DETAILS GRID (requested fields)
|
|
||||||
const sysDetails = kvGrid(tech, Object.keys(tech), {
|
const sysDetails = kvGrid(tech, Object.keys(tech), {
|
||||||
'PVE version': 'PVE version',
|
'PVE version': 'PVE version',
|
||||||
'Kernel': 'Kernel version',
|
'Kernel': 'Kernel version',
|
||||||
@@ -373,7 +372,7 @@ function renderNodeDetailCard(d) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Network config
|
// 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 || '')]);
|
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 = `
|
const netCfgTable = `
|
||||||
@@ -385,7 +384,7 @@ function renderNodeDetailCard(d) {
|
|||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
// Disks
|
// 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 = `
|
const diskTable = `
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-sm table-striped align-middle table-nowrap">
|
<table class="table table-sm table-striped align-middle table-nowrap">
|
||||||
@@ -395,12 +394,11 @@ function renderNodeDetailCard(d) {
|
|||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
// Subscription
|
// Subscription
|
||||||
const sub = d.subscription || {};
|
|
||||||
const subBox = `
|
const subBox = `
|
||||||
<div class="small">
|
<div class="small">
|
||||||
<div>Status: ${badge(safe(sub.status || 'unknown'), /active|valid/i.test(sub.status || '') ? 'ok' : 'warn')}</div>
|
<div>Status: ${badge(safe(subscription.status || 'unknown'), /active|valid/i.test(subscription.status || '') ? 'ok' : 'warn')}</div>
|
||||||
${sub.productname ? `<div>Product: <strong>${safe(sub.productname)}</strong></div>` : ''}
|
${subscription.productname ? `<div>Product: <strong>${safe(subscription.productname)}</strong></div>` : ''}
|
||||||
${sub.message ? `<div class="text-muted">${safe(sub.message)}</div>` : ''}
|
${subscription.message ? `<div class="text-muted">${safe(subscription.message)}</div>` : ''}
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
// Collapsible raw JSON
|
// Collapsible raw JSON
|
||||||
|
Reference in New Issue
Block a user