diff --git a/CHANGELOG.md b/CHANGELOG.md index 56467b3..1865324 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ ## Changelog +### What was just completed (2026-02-18 session 47) +- **v0.13.0 — UI Polish Fixes (8 independent fixes):** + + **Fix 1:** backup-status-card border already correct (verified same styling as system-info-card). + + **Fix 2:** Deploy page auto-generated fields now show actual values for deployed apps (`deploy.html`, `handlers.go`). Secrets show as password fields with show/hide toggle; domain/plain values show as readonly text with copy button. JS helpers `toggleAutoField()` / `copyAutoField()` added. + + **Fix 3:** Temperature display made more prominent (`dashboard.html`, `style.css`). Dot enlarged to 11px; value wrapped in colored pill badge (`.temp-value-pill` / `.temp-pill-{green|yellow|red}`). + + **Fix 4:** Dashboard backup card reworked (`dashboard.html`, `handlers.go`). Removed "Mentés most" button and `triggerBackup()` JS. Removed "Tároló méret" line. Added Tier 2 status line (configured/total apps) + warning row for failed cross-drive backups. Handler now computes `CrossDriveTotal`, `CrossDriveConfigured`, `CrossDriveFailed`. + + **Fix 5:** HDD warning banner scoped to dashboard + monitoring pages only (`alerts.go`, `layout.html`, `funcmap.go`). Added `PageOnly []string` field to `Alert` struct. Disk-related warnings (keywords "meghajtón", "adattároló") get stable ID `"disk-not-separate"` + `PageOnly: ["dashboard", "monitoring"]`. `pageMatch()` template function added. Layout renders alerts conditionally. + + **Fix 6:** Tárhely section moved up in Rendszermonitor — now appears right after "Rendszer áttekintés", before "Távoli monitoring" (`monitoring.html`). + + **Fix 7:** Snapshot table improvements (`backups.html`, `style.css`). "MÉRET" renamed to "HOZZÁADOTT (új adat)". `–` for unavailable data replaced with `n/a` (with tooltip explaining restic limitations). New `.col-subtitle` and `.col-na` CSS classes. + + **Fix 8:** Tároló section restructured into tiers (`backups.html`, `handlers.go`, `style.css`). Tier 1 (restic local), Tier 2 (cross-drive, only shown if configured), DB dump directory + total size. Removed "Távoli másolat: Nincs beállítva" placeholder. Handler passes `DBDumpDir`, `DBDumpTotalBytes`, `Tier2Dests` (deduplicated). New `.repo-tier` / `.repo-tier-title` CSS. + + **Files modified (9):** `alerts.go`, `funcmap.go`, `handlers.go`, `templates/style.css`, `templates/dashboard.html`, `templates/backups.html`, `templates/deploy.html`, `templates/monitoring.html`, `templates/layout.html` + ### What was just completed (2026-02-18 session 46) - **v0.12.9 — Tier 2 for All Apps + Status Dot Update:** diff --git a/controller/internal/web/alerts.go b/controller/internal/web/alerts.go index 2cd6ec4..d28291e 100644 --- a/controller/internal/web/alerts.go +++ b/controller/internal/web/alerts.go @@ -3,6 +3,7 @@ package web import ( "fmt" "log" + "strings" "sync" "gitea.dooplex.hu/admin/felhom-controller/internal/backup" @@ -12,11 +13,12 @@ import ( // Alert represents a persistent dashboard alert banner. type Alert struct { - ID string // unique identifier for filtering - Level string // "error", "warning", "info" - Message string // Hungarian display text - Link string // optional link to relevant page - LinkText string // link display text + ID string // unique identifier for filtering + Level string // "error", "warning", "info" + Message string // Hungarian display text + Link string // optional link to relevant page + LinkText string // link display text + PageOnly []string // if non-empty, only show on these pages (e.g., ["dashboard", "monitoring"]) } // AlertManager generates and stores dashboard alerts from health check results. @@ -53,13 +55,19 @@ func (am *AlertManager) Refresh(report *monitor.HealthReport, cfg *config.Config // From health check warnings for _, w := range report.Warnings { - alerts = append(alerts, Alert{ + alert := Alert{ ID: "health-" + simpleHash(w), Level: "warning", Message: w, Link: "/monitoring", LinkText: "Rendszermonitor", - }) + } + // Disk-related warnings only relevant on dashboard and monitoring pages + if strings.Contains(w, "meghajtón") || strings.Contains(w, "adattároló") || strings.Contains(w, "meghajtó") { + alert.ID = "disk-not-separate" + alert.PageOnly = []string{"dashboard", "monitoring"} + } + alerts = append(alerts, alert) } // Missing ping UUIDs diff --git a/controller/internal/web/funcmap.go b/controller/internal/web/funcmap.go index c1e8df3..bedf72e 100644 --- a/controller/internal/web/funcmap.go +++ b/controller/internal/web/funcmap.go @@ -305,5 +305,15 @@ func (s *Server) templateFuncMap() template.FuncMap { } return id }, + // pageMatch returns true if currentPage is in the pages slice. + // Used to filter page-specific alerts in layout.html. + "pageMatch": func(pages []string, currentPage string) bool { + for _, p := range pages { + if p == currentPage { + return true + } + } + return false + }, } } diff --git a/controller/internal/web/handlers.go b/controller/internal/web/handlers.go index 6e72727..58149ef 100644 --- a/controller/internal/web/handlers.go +++ b/controller/internal/web/handlers.go @@ -100,6 +100,28 @@ func (s *Server) dashboardHandler(w http.ResponseWriter, _ *http.Request) { data["BackupStatus"] = fullStatus.LastBackup data["BackupRunning"] = fullStatus.Running data["BackupMaxAgeHours"] = s.cfg.Monitoring.Thresholds.BackupMaxAgeHours + + // Cross-drive summary for dashboard Tier 2 status line + crossConfigs := s.settings.GetAllCrossDriveConfigs() + crossDriveTotal := 0 + crossDriveConfigured := 0 + crossDriveFailed := 0 + for _, st := range deployedStacks { + if st.Protected { + continue + } + crossDriveTotal++ + cfg, hasCfg := crossConfigs[st.Name] + if hasCfg && cfg != nil && cfg.Enabled { + crossDriveConfigured++ + if cfg.LastStatus == "error" { + crossDriveFailed++ + } + } + } + data["CrossDriveTotal"] = crossDriveTotal + data["CrossDriveConfigured"] = crossDriveConfigured + data["CrossDriveFailed"] = crossDriveFailed } s.render(w, "dashboard", data) @@ -181,6 +203,16 @@ func (s *Server) deployHandler(w http.ResponseWriter, r *http.Request, name stri data["AppPageURL"] = s.cfg.AppPageURL(meta.Slug) data["UserFields"] = meta.UserFacingFields() data["AutoFields"] = meta.AutoGeneratedFields() + // Auto-generated field values for already-deployed apps + autoFieldValues := make(map[string]string) + if alreadyDeployed && appCfg != nil { + for _, f := range meta.AutoGeneratedFields() { + if val, ok := appCfg.Env[f.EnvVar]; ok { + autoFieldValues[f.EnvVar] = val + } + } + } + data["AutoFieldValues"] = autoFieldValues // Storage paths with free space info for deploy dropdown var deployPaths []DeployStoragePath for _, sp := range s.settings.GetSchedulableStoragePaths() { @@ -487,6 +519,35 @@ func (s *Server) backupsHandler(w http.ResponseWriter, r *http.Request) { if pw, err := s.backupMgr.GetResticPassword(); err == nil { data["ResticPassword"] = pw } + + // Tároló section: DB dump directory and total size + data["DBDumpDir"] = s.cfg.Paths.DBDumpDir + var dbDumpTotalBytes int64 + for _, f := range fullStatus.DumpFiles { + dbDumpTotalBytes += f.Size + } + data["DBDumpTotalBytes"] = dbDumpTotalBytes + + // Tároló section: deduplicated Tier 2 destination list + tier2DestMap := make(map[string]map[string]string) + for _, item := range fullStatus.CrossDriveSummary { + if item.DestPath == "" { + continue + } + if _, exists := tier2DestMap[item.DestPath]; !exists { + tier2DestMap[item.DestPath] = map[string]string{ + "Path": item.DestPath, + "Label": item.DestLabel, + "Method": item.MethodLabel, + "SizeHuman": item.SizeHuman, + } + } + } + var tier2DestList []map[string]string + for _, d := range tier2DestMap { + tier2DestList = append(tier2DestList, d) + } + data["Tier2Dests"] = tier2DestList } else { data["Backup"] = nil } diff --git a/controller/internal/web/templates/backups.html b/controller/internal/web/templates/backups.html index aa22a7e..78a58c0 100644 --- a/controller/internal/web/templates/backups.html +++ b/controller/internal/web/templates/backups.html @@ -346,7 +346,7 @@
Ezek az értékek automatikusan létrejönnek a telepítéskor.
+ {{$autoValues := .AutoFieldValues}} + {{$isDeployed := .AlreadyDeployed}} {{range .AutoFields}} + {{$val := index $autoValues .EnvVar}}