5.2 KiB
TASK: v0.15.7 - Fix backup page storage display & rename system drive label
Overview
Two UI issues on the "Biztonsági mentés" (backup) page:
-
Missing drives in storage overview — The backup page only shows two drives (SSD + a single "Külső HDD"), while the dashboard and monitoring pages correctly show all registered storage paths (e.g., SSD, USB HDD 1TB, SYS Storage 350G). This is because the backup page template uses
SystemInfo.HDDConfigured/HDDTotalGB/etc. (which only supports one HDD) instead ofStorageBars(which iterates all registered storage paths). -
System drive label — The root partition is labeled "SSD (/)" on all pages. It should be labeled "Rendszer (/)" (Hungarian for "System") since the root filesystem isn't always on an SSD.
Changes Required
1. Add StorageBars data to the backup handler
File: controller/internal/web/handlers.go
In the backupsHandler function (around line 432), the StorageBars data is NOT passed to the template (unlike dashboardHandler and monitoringHandler which both call s.buildStorageBars()).
Action: Add this line after the SystemInfo assignment (around line 436):
data["StorageBars"] = s.buildStorageBars()
Place it right after data["SystemInfo"] = system.GetInfo(...), same pattern as monitoringHandler (line 395).
2. Update backup page template to use StorageBars
File: controller/internal/web/templates/backups.html
The "Tárhely áttekintés" section (lines 26-70) currently has:
- A hardcoded "SSD (/)" bar from
$.SystemInfo - A single "Külső HDD" bar gated by
{{if .HDDConfigured}}
Replace lines 29-51 (the <div class="storage-bars"> block) with a pattern matching the monitoring page — show the system drive bar + iterate StorageBars for all registered storage paths:
<div class="storage-bars">
{{with $.SystemInfo}}
<div class="storage-item">
<div class="storage-header">
<span class="storage-label">Rendszer (/)</span>
<span class="storage-value">{{fmtGB .DiskUsedGB}} / {{fmtGB .DiskTotalGB}} ({{printf "%.0f" .DiskPercent}}%)</span>
</div>
<div class="system-bar">
<div class="system-bar-fill {{usageColor .DiskPercent | printf "system-bar-%s"}}" style="width:{{printf "%.1f" .DiskPercent}}%"></div>
</div>
</div>
{{range $.StorageBars}}
<div class="storage-item">
<div class="storage-header">
<span class="storage-label">{{.Label}}</span>
<span class="storage-value">{{fmtGB .UsedGB}} / {{fmtGB .TotalGB}} ({{printf "%.0f" .Percent}}%)</span>
</div>
<div class="system-bar">
<div class="system-bar-fill {{usageColor .Percent | printf "system-bar-%s"}}" style="width:{{printf "%.1f" .Percent}}%"></div>
</div>
</div>
{{end}}
{{end}}
</div>
This replaces the old block that was:
<div class="storage-bars">
{{with $.SystemInfo}}
<div class="storage-item">
<div class="storage-header">
<span class="storage-label">SSD (/)</span>
...
</div>
...
</div>
{{if .HDDConfigured}}
<div class="storage-item">
<div class="storage-header">
<span class="storage-label">Külső HDD</span>
...HDDUsedGB...HDDTotalGB...HDDPercent...
</div>
...
</div>
{{end}}
{{end}}
</div>
3. Rename "SSD" → "Rendszer" on the monitoring page
File: controller/internal/web/templates/monitoring.html
On line 46, change:
<span class="storage-label">SSD (/)</span>
to:
<span class="storage-label">Rendszer (/)</span>
4. Rename "SSD tárhely" → "Rendszer (/)" on the dashboard page
File: controller/internal/web/templates/dashboard.html
On line 61, change:
<span class="system-info-label">SSD tárhely</span>
to:
<span class="system-info-label">Rendszer (/)</span>
Summary of all file changes
| File | Change |
|---|---|
controller/internal/web/handlers.go |
Add data["StorageBars"] = s.buildStorageBars() in backupsHandler |
controller/internal/web/templates/backups.html |
Replace storage bars section to use StorageBars loop + rename "SSD (/)" → "Rendszer (/)" |
controller/internal/web/templates/monitoring.html |
Rename "SSD (/)" → "Rendszer (/)" |
controller/internal/web/templates/dashboard.html |
Rename "SSD tárhely" → "Rendszer (/)" |
Build & test
After implementing, build and deploy following the standard workflow in CLAUDE.md.
Verify:
- Open "Biztonsági mentés" page — should show "Rendszer (/)" + all registered storage paths (USB HDD 1TB, SYS Storage 350G)
- Open "Rendszermonitor" page — should show "Rendszer (/)" instead of "SSD (/)"
- Open "Vezérlőpult" page — should show "Rendszer (/)" instead of "SSD tárhely"