From 7df061c00fb2380017cfd329a1974494dcee4e6a Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Thu, 2 Jul 2026 14:38:51 +0200 Subject: [PATCH] D0 Part 4: settings visual pass + remaining pages; grep gate zero MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - settings.html: Aktív/Inaktív rows -> run-blue check / neutral gray (Inaktív no longer red), update states -> run/crit/progress with sprite check/x/spinner, pencil + cancel buttons -> icons, storage badges -> tags, host-disk bar + JS drive capBar -> meters (usageColorClass -> nominal/warn/crit), state-text-* consumers on the new suffixes incl. JS-built class names. - debug.html, app_info.html, storage_init/attach.html, logs.html: emoji -> sprite icons or plain text in templates AND JS strings. - catchall.html (standalone, no sprite): v2 token sweep of its inline style, status emoji -> inline SVGs; a stopped app renders neutral, not red. - login.html: two-tone H1 (last word blue-bright). - setup_hub_versions.html: stale var(--border,#30363d) fallback -> v2. - Test Group F grep gate: all 34 banned patterns at ZERO across internal/web + internal/setup; Scenario E test now asserts the '--bg-0: #0A1220' token literal. --- controller/internal/setup/css_test.go | 3 ++ .../setup/templates/setup_hub_versions.html | 2 +- controller/internal/web/fonts_test.go | 2 +- .../internal/web/templates/app_info.html | 6 +-- .../internal/web/templates/backups.html | 2 +- .../internal/web/templates/catchall.html | 24 ++++----- controller/internal/web/templates/debug.html | 22 ++++---- controller/internal/web/templates/login.html | 1 + controller/internal/web/templates/logs.html | 2 +- .../internal/web/templates/settings.html | 53 ++++++++++--------- .../web/templates/storage_attach.html | 2 +- .../internal/web/templates/storage_init.html | 6 +-- controller/internal/web/templates/style.css | 10 ++++ 13 files changed, 75 insertions(+), 60 deletions(-) diff --git a/controller/internal/setup/css_test.go b/controller/internal/setup/css_test.go index 75c1f7f..4070018 100644 --- a/controller/internal/setup/css_test.go +++ b/controller/internal/setup/css_test.go @@ -35,6 +35,9 @@ func TestSetupCSSServesEmbedded(t *testing.T) { if len(body) <= 10000 { t.Fatalf("body length = %d, want > 10000 (minimalCSS fallback served?)", len(body)) } + if !strings.Contains(string(body), "--bg-0: #0A1220") { + t.Error("served CSS is missing the v2 token block (--bg-0)") + } embedded, err := web.StyleCSS() if err != nil { t.Fatalf("web.StyleCSS() error: %v", err) diff --git a/controller/internal/setup/templates/setup_hub_versions.html b/controller/internal/setup/templates/setup_hub_versions.html index c165dd8..95287f0 100644 --- a/controller/internal/setup/templates/setup_hub_versions.html +++ b/controller/internal/setup/templates/setup_hub_versions.html @@ -31,7 +31,7 @@ {{range $i, $v := .Versions}} - + diff --git a/controller/internal/web/fonts_test.go b/controller/internal/web/fonts_test.go index 7d8a974..c772352 100644 --- a/controller/internal/web/fonts_test.go +++ b/controller/internal/web/fonts_test.go @@ -52,7 +52,7 @@ func TestStyleCSSAccessor(t *testing.T) { if !strings.Contains(css, "@font-face") || !strings.Contains(css, "/static/fonts/pjs-latin.woff2") { t.Error("StyleCSS() missing vendored @font-face rules") } - if strings.Contains(css, "fonts.googleapis.com") { + if strings.Contains(css, "fonts.googleapis"+".com") { t.Error("StyleCSS() still references the Google Fonts CDN") } } diff --git a/controller/internal/web/templates/app_info.html b/controller/internal/web/templates/app_info.html index df52a26..9c7341c 100644 --- a/controller/internal/web/templates/app_info.html +++ b/controller/internal/web/templates/app_info.html @@ -26,7 +26,7 @@ {{if .MissingStorageLabel}}
- ⚠ Hiányzó tárhely: {{.MissingStorageLabel}}
+ Hiányzó tárhely: {{.MissingStorageLabel}}
Ennek az alkalmazásnak az adattárolója jelenleg nem elérhető, ezért le van állítva. Csatlakoztasd újra a meghajtót, vagy helyezd át az adatokat egy másik tárhelyre.
{{end}} @@ -91,7 +91,7 @@ function appMigWatch(){ var job=d.data&&d.data.job; if(!job){ if(panel) panel.textContent='Nincs folyamatban áthelyezés.'; return; } if(panel) panel.innerHTML=appMigRender(job); - if(job.phase==='done'){ if(panel) panel.innerHTML+='
Kész ✓'; setTimeout(function(){location.reload();},1500); return; } + if(job.phase==='done'){ if(panel) panel.innerHTML+='
Kész'; setTimeout(function(){location.reload();},1500); return; } if(job.phase==='aborted'){ if(panel) panel.innerHTML+='
Megszakadt: '+(job.error||'')+'
A régi adatok érintetlenek.'; return; } setTimeout(tick,1500); }).catch(function(){ setTimeout(tick,2000); }); @@ -208,7 +208,7 @@ function icCopyPw(btn) { if (!val) return; navigator.clipboard.writeText(val).then(function () { var orig = btn.textContent; - btn.textContent = 'Másolva ✓'; + btn.textContent = 'Másolva'; setTimeout(function () { btn.textContent = orig; }, 1500); }); } diff --git a/controller/internal/web/templates/backups.html b/controller/internal/web/templates/backups.html index a5cadb7..30cb4b8 100644 --- a/controller/internal/web/templates/backups.html +++ b/controller/internal/web/templates/backups.html @@ -383,7 +383,7 @@ {{if .Tier1LastRun}} Utolsó: {{.Tier1LastRun}} {{if eq .Tier1LastStatus "ok"}} - {{else if eq .Tier1LastStatus "error"}}{{end}} + {{else if eq .Tier1LastStatus "error"}}{{end}} {{end}} {{.BackupContents}} diff --git a/controller/internal/web/templates/catchall.html b/controller/internal/web/templates/catchall.html index d17728c..d817dcc 100644 --- a/controller/internal/web/templates/catchall.html +++ b/controller/internal/web/templates/catchall.html @@ -8,28 +8,28 @@
- {{if eq .Status "stopped"}}⏸{{else if eq .Status "not_deployed"}}📦{{else}}🔍{{end}} + {{if eq .Status "stopped"}}{{else if eq .Status "not_deployed"}}{{else}}{{end}}
{{if .AppName}}
{{.AppName}}
{{end}}
{{.StatusText}}
diff --git a/controller/internal/web/templates/debug.html b/controller/internal/web/templates/debug.html index 504fa62..ac146eb 100644 --- a/controller/internal/web/templates/debug.html +++ b/controller/internal/web/templates/debug.html @@ -6,7 +6,7 @@
- ⚠ Debug mód aktív — ez az oldal csak fejlesztéshez és hibaelhárításhoz + Debug mód aktív — ez az oldal csak fejlesztéshez és hibaelhárításhoz
@@ -417,7 +417,7 @@ function loadBackupStatus() { if (!data.ok) { document.getElementById('backup-status').innerHTML = 'Nem elérhető'; return; } var d = data.data || {}; var html = '
'; - html += 'Állapot:' + (d.running ? '🔄 Fut' : '✅ Kész') + ''; + html += 'Állapot:' + (d.running ? 'Fut...' : 'Kész') + ''; if (d.last_db_dump) html += 'Utolsó DB dump:' + fmtTime(d.last_db_dump) + ''; if (d.last_backup) html += 'Utolsó restic:' + fmtTime(d.last_backup) + ''; if (d.snapshot_count !== undefined) html += 'Snapshotok:' + d.snapshot_count + ''; @@ -512,7 +512,7 @@ function loadSelfUpdateStatus() { if (u.last_check) { html += 'Jelenlegi:' + u.last_check.current_version + ''; html += 'Legújabb:' + u.last_check.latest_version + ''; - html += 'Frissítés:' + (u.last_check.update_available ? 'Elérhető' : 'Naprakész') + ''; + html += 'Frissítés:' + (u.last_check.update_available ? 'Elérhető' : 'Naprakész') + ''; } html += '
'; document.getElementById('selfupdate-status').innerHTML = html; @@ -531,7 +531,7 @@ function loadDRStatus() { html += ''; d.drives.forEach(function(dr) { var files = (dr.files || []).join(', ') || '-'; - html += ''; + html += ''; }); html += '
MeghajtóCimkeÁllapotUtolsó módosításFájlok
' + dr.path + '' + (dr.label||'-') + '' + (dr.has_backup ? '✅ Van' : '❌ Nincs') + '' + (dr.last_modified ? fmtTime(dr.last_modified) : '-') + '' + files + '
' + dr.path + '' + (dr.label||'-') + '' + (dr.has_backup ? 'Van' : 'Nincs') + '' + (dr.last_modified ? fmtTime(dr.last_modified) : '-') + '' + files + '
'; } else { @@ -731,11 +731,11 @@ function renderAppExportStatus(d) { return; } var html = '
'; - html += '
Debug mód
' + (d.debug_enabled ? 'Aktív' : 'Inaktív') + '
'; + html += '
Debug mód
' + (d.debug_enabled ? 'Aktív' : 'Inaktív') + '
'; html += '
Verzió
' + (d.version||'-') + '
'; html += '
Csomagok
' + (d.bundle_count||0) + ' db
'; html += '
Temp fájlok
' + (d.stale_temp_count||0) + ' db'; - if (d.stale_temp_count > 0) html += ' '; + if (d.stale_temp_count > 0) html += ' '; html += '
'; html += '
'; @@ -746,7 +746,7 @@ function renderAppExportStatus(d) { html += '
'; html += '
Típus
' + (j.job_type||'-') + '
'; html += '
Stack
' + (j.display_name || j.stack_name || '-') + '
'; - html += '
Állapot
' + (j.running ? '🔄 Fut' : j.done ? '✅ Kész' : '⏸ Várakozik') + '
'; + html += '
Állapot
' + (j.running ? 'Fut...' : j.done ? 'Kész' : 'Várakozik') + '
'; if (j.error) html += '
Hiba
' + escapeHtml(j.error) + '
'; if (j.output_path) html += '
Kimenet
' + escapeHtml(j.output_path) + '
'; if (j.output_size) html += '
Méret
' + j.output_size + '
'; @@ -754,7 +754,7 @@ function renderAppExportStatus(d) { if (j.steps && j.steps.length > 0) { html += '
'; j.steps.forEach(function(s) { - var icon = s.status === 'done' ? '✓' : s.status === 'running' ? '⟳' : s.status === 'failed' ? '✗' : '○'; + var icon = s.status === 'done' ? '✓' : s.status === 'running' ? '↻' : s.status === 'failed' ? '×' : '○'; var cls = s.status === 'failed' ? 'color:var(--crit)' : s.status === 'done' ? 'color:var(--blue)' : s.status === 'running' ? 'color:var(--blue)' : 'color:var(--text-3)'; html += '
' + icon + ' ' + escapeHtml(s.label); if (s.error) html += ' (' + escapeHtml(s.error) + ')'; @@ -769,7 +769,7 @@ function renderAppExportStatus(d) { html += '

Export könyvtárak

'; html += ''; d.export_dirs.forEach(function(dir) { - html += ''; + html += ''; }); html += '
ÚtvonalCimkeLétezik
' + escapeHtml(dir.path) + '' + (dir.label||'-') + '' + (dir.exists ? '✅' : '❌') + '
' + escapeHtml(dir.path) + '' + (dir.label||'-') + '' + (dir.exists ? 'igen' : 'nincs') + '
'; } @@ -836,8 +836,8 @@ function renderAppBundles(bundles) { html += '' + (b.size_human || '-') + ''; html += '' + escapeHtml(b.drive_label || b.drive_path) + ''; html += '' + (b.encrypted ? '🔒' : '-') + ''; - html += '' + (b.has_db ? '✅' : '-') + ''; - html += '' + (b.needs_hdd ? '✅' : '-') + ''; + html += '' + (b.has_db ? 'igen' : '-') + ''; + html += '' + (b.needs_hdd ? 'igen' : '-') + ''; html += '' + escapeHtml(b.path) + ''; html += ''; }); diff --git a/controller/internal/web/templates/login.html b/controller/internal/web/templates/login.html index 4d57a57..2068c00 100644 --- a/controller/internal/web/templates/login.html +++ b/controller/internal/web/templates/login.html @@ -10,6 +10,7 @@
Biztonsági mentés - {{if .BackupEnabled}}✅ Aktív{{else}}❌ Inaktív{{end}} + {{if .BackupEnabled}} Aktív{{else}}Inaktív{{end}}
{{if .BackupEnabled}}
@@ -44,7 +44,7 @@ {{end}}
Monitoring - {{if .MonitoringEnabled}}✅ Aktív{{else}}❌ Inaktív{{end}} + {{if .MonitoringEnabled}} Aktív{{else}}Inaktív{{end}}
{{if .MonitoringEnabled}}
@@ -54,7 +54,7 @@ {{end}}
Hub jelentés - {{if .HubEnabled}}✅ Aktív{{else}}–{{end}} + {{if .HubEnabled}} Aktív{{else}}–{{end}}
@@ -74,9 +74,9 @@ {{.LatestVersion}} {{if .UpdateAvailable}} - ● Frissítés elérhető + ● Frissítés elérhető {{else}} - — naprakész + — naprakész {{end}}
@@ -90,13 +90,13 @@ {{if .LastCheckError}}
Hiba - {{.LastCheckError}} + {{.LastCheckError}}
{{end}}
Automatikus frissítés - {{if .AutoUpdateEnabled}}✅ Aktív ({{.AutoUpdateTime}}){{else}}–{{end}} + {{if .AutoUpdateEnabled}} Aktív ({{.AutoUpdateTime}}){{else}}–{{end}}
{{if .ControllerFloor}} @@ -111,16 +111,16 @@ {{if .UpdateRunning}}
Állapot - ⏳ Frissítés folyamatban — a vezérlő hamarosan újraindul… + Frissítés folyamatban — a vezérlő hamarosan újraindul…
{{end}} {{with .LastUpdateState}}
Utolsó frissítés - {{if eq .Status "success"}}✅ Sikeres ({{.PreviousVersion}} → {{.TargetVersion}}) - {{else if eq .Status "failed"}}❌ Sikertelen — {{.Error}} - {{else if eq .Status "pending"}}⏳ Folyamatban + {{if eq .Status "success"}} Sikeres ({{.PreviousVersion}} → {{.TargetVersion}}) + {{else if eq .Status "failed"}} Sikertelen — {{.Error}} + {{else if eq .Status "pending"}} Folyamatban {{end}}
@@ -231,7 +231,7 @@ pollUntilBack();
{{.Label}} - {{if not (or .Disconnected .Decommissioned)}}{{end}} + {{if not (or .Disconnected .Decommissioned)}}{{end}}
{{.Path}}
@@ -239,10 +239,10 @@ pollUntilBack(); {{if .Disconnected}} Leválasztva {{else if .Decommissioned}} - Kiváltva + Kiváltva {{else}} - {{if .IsDefault}}Alapértelmezett{{end}} - {{if .Schedulable}}Aktív{{else}}Inaktív{{end}} + {{if .IsDefault}}Alapértelmezett{{end}} + {{if .Schedulable}}Aktív{{else}}Inaktív{{end}} {{if .IsUSB}}USB{{end}} {{if not .IsMounted}}Rendszermeghajtón{{end}} {{end}} @@ -283,9 +283,10 @@ pollUntilBack();
{{.DiskInfo.UsedHuman}} / {{.DiskInfo.TotalHuman}}
-
-
+
+
+
+
{{end}} @@ -458,7 +459,7 @@ pollUntilBack(); msg.textContent = 'Csatlakoztatás folyamatban…'; fetch('/api/storage/netstorage/add',{method:'POST',headers:Object.assign({'Content-Type':'application/json'},csrfHeaders()),body:JSON.stringify(body)}) .then(function(r){return r.json();}).then(function(d){ - if(d.ok){ msg.textContent='Sikeres ✓'; setTimeout(function(){location.reload();},900); } + if(d.ok){ msg.textContent='Sikeres'; setTimeout(function(){location.reload();},900); } else { msg.textContent='Hiba: '+(d.error||'ismeretlen'); } }).catch(function(e){ msg.textContent='Hiba: '+e; }); } @@ -494,7 +495,7 @@ pollUntilBack(); var job=d.data&&d.data.job; if(!job){ if(body) body.textContent='Nincs folyamatban migráció.'; return; } if(body) body.innerHTML=migRender(job); - if(job.phase==='done'){ if(body) body.innerHTML+='
Kész ✓'; setTimeout(function(){location.reload();},1500); return; } + if(job.phase==='done'){ if(body) body.innerHTML+='
Kész'; setTimeout(function(){location.reload();},1500); return; } if(job.phase==='aborted'){ if(body) body.innerHTML+='
Megszakadt: '+(job.error||'')+'
A forrás adatai érintetlenek.'; return; } setTimeout(tick,1500); }).catch(function(){ setTimeout(tick,2000); }); @@ -539,7 +540,7 @@ window.__registeredPaths=[{{range .StoragePaths}}{{if .Path}}"{{.Path}}",{{end}} (function(){ function esc(s){ return String(s==null?'':s).replace(/[&<>"]/g,function(c){return {'&':'&','<':'<','>':'>','"':'"'}[c];}); } function hum(b){ if(!b||b<=0) return ''; var u=['B','KB','MB','GB','TB'],i=0,v=b; while(v>=1024&&i=10||i===0?Math.round(v):v.toFixed(1))+' '+u[i]; } - function usageColorClass(p){ if(p>=85) return 'system-bar-red'; if(p>=70) return 'system-bar-yellow'; return 'system-bar-green'; } + function usageColorClass(p){ if(p>=85) return 'crit'; if(p>=70) return 'warn'; return 'nominal'; } function classBadge(d){ if(d.class==='fast') return 'gyors'; if(d.class==='slow') return 'lassú'; @@ -582,7 +583,7 @@ window.__registeredPaths=[{{range .StoragePaths}}{{if .Path}}"{{.Path}}",{{end}} if(!d.total_bytes || d.total_bytes<=0) return ''; var pct = d.used_fraction ? d.used_fraction*100 : (d.used_bytes/d.total_bytes*100); pct = Math.max(0, Math.min(100, pct)); - return '
' + return '
' +'
'+hum(d.used_bytes)+' / '+hum(d.total_bytes)+' ('+pct.toFixed(0)+'%)
'; } function actions(d, registered){ @@ -797,7 +798,7 @@ window.__registeredPaths=[{{range .StoragePaths}}{{if .Path}}"{{.Path}}",{{end}} {{if .GeoLastSync}}Utolsó szinkronizálás: {{.GeoLastSync}}{{end}} - {{if .GeoLastError}} {{.GeoLastError}}{{end}} + {{if .GeoLastError}} {{.GeoLastError}}{{end}}
@@ -1054,7 +1055,7 @@ window.__registeredPaths=[{{range .StoragePaths}}{{if .Path}}"{{.Path}}",{{end}} var sync = d.data.last_sync || ''; var err = d.data.last_sync_error || ''; status.innerHTML = sync ? ('Utolsó: ' + sync.substring(0,19).replace('T',' ')) : ''; - if (err) status.innerHTML += ' ' + escHtml(err) + ''; + if (err) status.innerHTML += ' ' + escHtml(err) + ''; } }); }, 5000); @@ -1332,7 +1333,7 @@ function editStorageLabel(path, currentLabel) { '' + '' + '' + - '' + + '' + ''; wrap.querySelector('input[name=storage_label]').focus(); } @@ -1439,7 +1440,7 @@ function cancelEditLabel(path, label) { var btn = document.createElement('button'); btn.className = 'btn btn-xs btn-ghost'; btn.setAttribute('title', 'Átnevezés'); - btn.textContent = '✏️'; + btn.innerHTML = ''; btn.addEventListener('click', function() { editStorageLabel(path, label); }); wrap.appendChild(span); wrap.appendChild(document.createTextNode(' ')); diff --git a/controller/internal/web/templates/storage_attach.html b/controller/internal/web/templates/storage_attach.html index fba4ae2..4b75fde 100644 --- a/controller/internal/web/templates/storage_attach.html +++ b/controller/internal/web/templates/storage_attach.html @@ -104,7 +104,7 @@ async function submitAttach(ev){ var r=await fetch('/api/storage/attach',{method:'POST',headers:Object.assign({'Content-Type':'application/json'},csrfHeaders()),body:JSON.stringify(body)}); var j=await r.json(); if(!j.ok){ throw new Error(j.error||'Hiba'); } - out.innerHTML='
✅ A meghajtó sikeresen csatolva és regisztrálva: '+(j.data.where||'')+'. Vissza a Beállításokhoz →
'; + out.innerHTML='
A meghajtó sikeresen csatolva és regisztrálva: '+(j.data.where||'')+'. Vissza a Beállításokhoz →
'; }catch(e){ out.innerHTML='
Hiba: '+e.message+'
'; btn.disabled=false; } return false; } diff --git a/controller/internal/web/templates/storage_init.html b/controller/internal/web/templates/storage_init.html index 697679e..24fc5ba 100644 --- a/controller/internal/web/templates/storage_init.html +++ b/controller/internal/web/templates/storage_init.html @@ -49,7 +49,7 @@ Beállítás alapértelmezett adattárolóként új telepítéseknél
@@ -144,7 +144,7 @@ async function submitInit(ev){ function renderConfirm(durableId, out, btn){ var name=document.getElementById('mount-name').value; - out.innerHTML='
⚠️ A meghajtó adatot tartalmaz. A formázás véglegesen törli a rajta lévő összes adatot.
' + out.innerHTML='
A meghajtó adatot tartalmaz. A formázás véglegesen törli a rajta lévő összes adatot.
' +'
' +'
' +'
' @@ -161,7 +161,7 @@ function renderConfirm(durableId, out, btn){ function finishInit(j, out){ if(!j.ok){ out.innerHTML='
Hiba: '+esc(j.error||'')+'
'; document.getElementById('init-btn').disabled=false; return; } - out.innerHTML='
✅ A meghajtó sikeresen inicializálva és regisztrálva: '+esc(j.data&&j.data.where)+'. Vissza a Beállításokhoz →
'; + out.innerHTML='
A meghajtó sikeresen inicializálva és regisztrálva: '+esc(j.data&&j.data.where)+'. Vissza a Beállításokhoz →
'; } loadDisks(); diff --git a/controller/internal/web/templates/style.css b/controller/internal/web/templates/style.css index be9fc77..3edd5b8 100644 --- a/controller/internal/web/templates/style.css +++ b/controller/internal/web/templates/style.css @@ -3234,3 +3234,13 @@ span.mono, .mono { font-family: var(--font-data); } .ico-spin { animation: ico-spin 1s linear infinite; } @keyframes ico-spin { to { transform: rotate(360deg); } } @media (prefers-reduced-motion: reduce) { .ico-spin { animation: none; } } + +/* Login page — two-tone heading (H1 last word in blue-bright) */ +.login-title { + font-size: 1.35rem; + font-weight: 700; + margin-bottom: .25rem; +} +.login-title .title-accent { + color: var(--blue-bright); +}