feat(admin): Windows hardware cards (CPU/RAM/GPU/Disks) with Lucide icons; feat(desktop): inventory summary cards; feat(agent/windows): extended hardware collectors (CPU/board/BIOS/memory/video/disks); fix(agent): memory units in bytes
This commit is contained in:
parent
fcd45ff034
commit
c70691bce8
6 changed files with 6200 additions and 126 deletions
|
|
@ -233,6 +233,9 @@ function renderInventoryPanel(inv: Record<string, unknown>, profile: MachineProf
|
|||
if (!panel) return
|
||||
const disks = Array.isArray((inv as any).disks) ? ((inv as any).disks as any[]) : []
|
||||
const network = (inv as any).network
|
||||
const mem = profile.metrics
|
||||
const totalDisk = disks.reduce((acc, d) => acc + Number(d?.totalBytes ?? 0), 0)
|
||||
const disksCount = disks.length
|
||||
|
||||
let networkHtml = ""
|
||||
if (Array.isArray(network)) {
|
||||
|
|
@ -277,6 +280,12 @@ function renderInventoryPanel(inv: Record<string, unknown>, profile: MachineProf
|
|||
: ""
|
||||
|
||||
panel.innerHTML = `
|
||||
<div class="cards-grid">
|
||||
<div class="card-item"><span class="card-icon">🧠</span><div><div class="text-xs">CPU</div><div class="text-sm"><strong>${formatPercent(mem.cpuUsagePercent)}</strong></div></div></div>
|
||||
<div class="card-item"><span class="card-icon">🧩</span><div><div class="text-xs">Memória</div><div class="text-sm"><strong>${formatBytes(mem.memoryUsedBytes)}</strong> / ${formatBytes(mem.memoryTotalBytes)}</div></div></div>
|
||||
<div class="card-item"><span class="card-icon">🖥️</span><div><div class="text-xs">Sistema</div><div class="text-sm"><strong>${profile.os.name}</strong></div></div></div>
|
||||
<div class="card-item"><span class="card-icon">💾</span><div><div class="text-xs">Discos</div><div class="text-sm"><strong>${disksCount}</strong> · ${formatBytes(totalDisk)}</div></div></div>
|
||||
</div>
|
||||
${networkHtml}
|
||||
${disksHtml}
|
||||
${softwareHtml}
|
||||
|
|
|
|||
|
|
@ -193,6 +193,26 @@ button:hover:not(:disabled) {
|
|||
display: block;
|
||||
}
|
||||
|
||||
/* Summary cards */
|
||||
.cards-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
|
||||
gap: 12px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
.card-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
border: 1px solid rgba(148, 163, 184, 0.5);
|
||||
background-color: rgba(248, 250, 252, 0.85);
|
||||
padding: 10px 12px;
|
||||
border-radius: 12px;
|
||||
}
|
||||
.card-icon {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.spinner {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue