Add RAM usage in GB and swap metrics to agent, server, UI and CSV export

This commit is contained in:
2026-07-17 17:10:47 +07:00
parent 513b8ede84
commit 76f74201e5
12 changed files with 272 additions and 35 deletions
+11 -2
View File
@@ -59,6 +59,7 @@
<th>Статус</th>
<th>CPU</th>
<th>RAM</th>
<th>Swap</th>
<th>OS</th>
<th>Последний чек</th>
<th></th>
@@ -84,7 +85,14 @@
{% endif %}
</td>
<td>{{ c.current_cpu_percent | round(1) if c.current_cpu_percent is not none else '-' }}%</td>
<td>{{ c.current_ram_percent | round(1) if c.current_ram_percent is not none else '-' }}%</td>
<td>
{% if c.current_ram_used_gb is not none and c.current_ram_total_gb is not none %}
{{ c.current_ram_used_gb | round(1) }} / {{ c.current_ram_total_gb | round(1) }} GB
{% else %}
{{ c.current_ram_percent | round(1) if c.current_ram_percent is not none else '-' }}%
{% endif %}
</td>
<td>{{ c.current_swap_percent | round(1) if c.current_swap_percent is not none else '-' }}%</td>
<td>{{ c.os_info or '-' }}</td>
<td class="last-seen">{{ c.last_seen | localtime }}</td>
<td>
@@ -187,7 +195,8 @@ async function loadDashboard() {
<td>${escapeHtml(c.current_ip || '-')}</td>
<td>${c.status === 'online' ? '<span class="badge bg-success">Online</span>' : '<span class="badge bg-secondary">Offline</span>'}</td>
<td>${c.current_cpu_percent != null ? c.current_cpu_percent.toFixed(1) : '-'}%</td>
<td>${c.current_ram_percent != null ? c.current_ram_percent.toFixed(1) : '-'}%</td>
<td>${c.current_ram_used_gb != null && c.current_ram_total_gb != null ? `${c.current_ram_used_gb.toFixed(1)} / ${c.current_ram_total_gb.toFixed(1)} GB` : (c.current_ram_percent != null ? c.current_ram_percent.toFixed(1) + '%' : '-')}</td>
<td>${c.current_swap_percent != null ? c.current_swap_percent.toFixed(1) : '-'}%</td>
<td>${escapeHtml(c.os_info || '-')}</td>
<td class="last-seen">${formatServerTime(c.last_seen)}</td>
<td>