feat: show disk usage of mover source with configurable warning threshold

GET /api/storage/disk-usage returns source path stats (total/used/free bytes, %).
Polls every 30s while Storage page is open.

Backend:
- migration 0009: adds mover_warning_threshold (1-99, default 80) to storage_config
- StatPath moved to internal/storage package for testability
- handleStorageDiskUsage returns {source: PathStat}

Frontend:
- DiskUsageBar component in Mergerfs Mover card: usage bar with color
  green < threshold, amber >= threshold, red >= 95%
- Warning message when threshold reached or exceeded
- New input in config form: Umbral de aviso (%)
- storageDiskUsage() API method

Tests: StatPath unit tests (empty/nonexistent/valid paths)

Version: 0.7.3
This commit is contained in:
2026-07-07 00:30:32 -04:00
parent e5b9b233b8
commit 428056e1be
9 changed files with 169 additions and 38 deletions
+3 -2
View File
@@ -88,8 +88,9 @@ func NewRouter(s *Server) chi.Router {
})
protected.Route("/storage", func(storageRouter chi.Router) {
storageRouter.Get("/capabilities", s.handleStorageCapabilities)
storageRouter.Get("/config", s.handleStorageGetConfig)
storageRouter.Get("/capabilities", s.handleStorageCapabilities)
storageRouter.Get("/disk-usage", s.handleStorageDiskUsage)
storageRouter.Get("/config", s.handleStorageGetConfig)
storageRouter.Put("/config", s.handleStorageUpdateConfig)
storageRouter.Route("/jobs", func(j chi.Router) {
j.Get("/", s.handleStorageListJobs)