Fix backup status dots disappearing after page load

/api/backups returned plain filename strings while pages/backups.html's
server-rendered dots came from get_local_backups_with_status()/
get_vm_backups_with_status(). platform.js's DOMContentLoaded handler always
calls refreshBackupsList() (backups.html has #backup-history-list, which
triggers it unconditionally), which re-fetches /api/backups and rebuilds
#local-backup-list/#vm-backup-list via renderBackupList() — a version with
zero knowledge of status, wiping out the dots seconds after initial paint.

Switch /api/backups to the *_with_status() variants and have
renderBackupList() render the same status-dot markup as the Jinja template,
so the dot is sourced from persisted backup metadata on every render path,
not just the first one.
This commit is contained in:
root
2026-08-21 11:07:01 +02:00
parent d498c81d5b
commit 72dba7a3a4
2 changed files with 13 additions and 6 deletions

View File

@@ -377,7 +377,7 @@ def api_container_status(name):
@app.route('/api/backups')
@login_required
def api_backups():
return jsonify({'local': get_local_backups(), 'vm': get_vm_backups()})
return jsonify({'local': get_local_backups_with_status(), 'vm': get_vm_backups_with_status()})
@app.route('/api/backups/log')