diff --git a/static/main.js b/static/main.js index e6e3610..f9f4d03 100644 --- a/static/main.js +++ b/static/main.js @@ -309,40 +309,25 @@ function renderNodeDetailCard(d) { const mem = st.memory || {}; const root = st.rootfs || {}; - const load = st.loadavg || ''; + const load = Array.isArray(st.loadavg) ? st.loadavg.join(' ') : (st.loadavg || ''); - // ---- SYSTEM DETAILS (zamiast "HA services") - const hw = d.hw || d.hardware || d.cpuinfo || st.cpuinfo || {}; - const cpuModel = pick( - hw.model, hw['model-name'], hw.model_name, - st['cpu-model'], ver['cpu-model'], ver.cpu, st.cpu_model - ); - const arch = pick(hw.arch, ver.arch, st.architecture, st.arch); - const sockets = pick(hw.sockets, st.sockets); - const coresPerSocket = pick(hw.cores, st.cores_per_socket, st.cores); - const threadsPerCore = pick(hw.threads, st.threads_per_core, st.threads); - const totalCPUs = pick(st.maxcpu, hw.total_cpus, hw.cpus); - const microcode = pick(hw.microcode, st.microcode); - const bios = pick(hw.bios, st.bios_version, ver.bios); - const virt = pick(hw.virtualization, ver.virtualization, st.virtualization); - const machine = pick(ver.machine, st.machine); - const kvm = pick(ver.kvm, st.kvm); + // ---- SYSTEM DETAILS (new content) + const cpuinfo = st.cpuinfo || {}; + const boot = st['boot-info'] || st.boot_info || {}; + const curKernel = st['current-kernel'] || st.current_kernel || {}; + const ramStr = (mem.used != null && mem.available != null && mem.total != null) + ? `${humanBytes(mem.used)} used / ${humanBytes(mem.available)} free / ${humanBytes(mem.total)} total` + : (mem.total != null ? humanBytes(mem.total) : '—'); const tech = { - 'Kernel': pick(ver.kernel, ver.release), - 'QEMU': pick(ver.qemu, ver['running-qemu']), - 'KVM': kvm, - 'PVE Manager': pick(ver.pvemanager, ver['pve-manager']), - 'Architecture': arch, - 'CPU model': cpuModel, - 'Sockets': sockets, - 'Cores/socket': coresPerSocket, - 'Threads/core': threadsPerCore, - 'Total CPUs': totalCPUs, - 'Microcode': microcode, - 'Virtualization': virt, - 'Machine': machine, - 'BIOS': bios + 'PVE version': pick(st.pveversion, ver.pvemanager, ver['pve-manager']), + 'Kernel': pick(st.kversion, curKernel.release, ver.kernel, ver.release), + 'CPU model': pick(cpuinfo.model, st['cpu-model'], ver['cpu-model'], ver.cpu), + 'Architecture': pick(curKernel.machine, ver.arch, st.architecture, st.arch), + 'RAM': ramStr, + 'Boot mode': pick(boot.mode) ? String(boot.mode).toUpperCase() : '—', + 'Secure Boot': (boot.secureboot === 1 || boot.secureboot === '1') ? 'enabled' : + (boot.secureboot === 0 || boot.secureboot === '0') ? 'disabled' : '—' }; const top = ` @@ -368,7 +353,7 @@ function renderNodeDetailCard(d) {