R-563: the remote-backup page polls from a status attribute, and „Fut…" is finally translatable
- backups_remote.html: the status stat carries data-status="{{.Offbox.LastStatus}}"; the poll reads
v.dataset.status === 'running' instead of v.textContent.indexOf('Fut'). The English page could never
see a running backup before this (slice 1 shipped the English page with that word left Hungarian).
- The running label becomes {{T "backups_remote.fut"}} — hu „Fut…" unchanged, en „Running…".
- 12 backups_remote parity fixtures re-captured. Proven (audit switch/fixture diff): each differs from
its predecessor ONLY by the data-status attribute and that one poll line; the other 94 are
byte-identical. The displayed Hungarian is unchanged.
- Tests: TestR563_PollStartsFromAttribute (hu and en), TestR563_AttributeFollowsTheStatus.
Red-proofed twice: poll back on textContent → both languages fail; word back inline → the English
page shows Hungarian.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
{{if .Offbox}}
|
||||
<div class="stats-grid backup-page-cards">
|
||||
<div class="stat-card {{if or (eq .Offbox.LastStatus "error") (eq .Offbox.LastStatus "incomplete")}}stat-warn{{end}}">
|
||||
<div class="stat-value" id="offbox-status-value" style="font-size:1.15rem">{{if eq .Offbox.LastStatus "ok"}}{{T "backups_remote.rendben"}}{{else if eq .Offbox.LastStatus "incomplete"}}{{T "backups_remote.hianyos"}}{{else if eq .Offbox.LastStatus "error"}}{{T "backups_remote.hiba"}}{{else if eq .Offbox.LastStatus "running"}}Fut…{{else}}–{{end}}</div>
|
||||
<div class="stat-value" id="offbox-status-value" data-status="{{.Offbox.LastStatus}}" style="font-size:1.15rem">{{if eq .Offbox.LastStatus "ok"}}{{T "backups_remote.rendben"}}{{else if eq .Offbox.LastStatus "incomplete"}}{{T "backups_remote.hianyos"}}{{else if eq .Offbox.LastStatus "error"}}{{T "backups_remote.hiba"}}{{else if eq .Offbox.LastStatus "running"}}{{T "backups_remote.fut"}}{{else}}–{{end}}</div>
|
||||
<div class="stat-label">{{T "backups_remote.utolso_tavoli_mentes"}}{{if .Offbox.LastRun}}<br><span class="relative-time">{{timeAgoStr .Offbox.LastRun}}</span>{{end}}</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
@@ -277,7 +277,10 @@
|
||||
var bar = document.getElementById('offbox-progress-bar');
|
||||
var GRACE = 5; // ~15s of quiet before concluding nothing is running
|
||||
var quiet = 0;
|
||||
var sawRunning = (v && v.textContent.indexOf('Fut') >= 0);
|
||||
// R-563: the page asks the ELEMENT what the status is (data-status, rendered server-side from
|
||||
// Offbox.LastStatus), never the word it displays. Reading „Fut" meant an English page never noticed
|
||||
// a running backup — and the word could not be translated while this line existed.
|
||||
var sawRunning = (v && v.dataset.status === 'running');
|
||||
|
||||
var timer = setInterval(function(){
|
||||
fetch('/backup/offbox/status',{headers:{'Accept':'application/json'}})
|
||||
|
||||
Reference in New Issue
Block a user