From b6ba09b07844b21f06025174ee0ed0311bf644bd Mon Sep 17 00:00:00 2001 From: Dillard Blom Date: Fri, 2 Oct 2026 17:11:34 +0200 Subject: [PATCH] Admin UI: restore point dates and a settings/daily-use split Show the date of the restore point a restore run used, both in the backup history table and when confirming a restore. Split the admin page into a "Backup and restore" tab (locations, backups, restore) and a "Settings" tab (key, slots, recovery kit), so daily work no longer sits behind the key setup at the top of the page. Signed-off-by: Dillard Blom --- appinfo/info.xml | 2 +- lib/Controller/AdminApiController.php | 11 ++++++++++- src/AdminSettings.vue | 26 ++++++++++++++++++++++++-- src/components/Backups.vue | 2 ++ src/components/RestoreBrowser.vue | 2 +- 5 files changed, 38 insertions(+), 5 deletions(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index e6e2981..18a33fd 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -5,7 +5,7 @@ NG Backup Encrypted, incremental backups of your Nextcloud with restore from the web interface - 0.0.18 + 0.0.19 agpl Dillard Blom NgBackup diff --git a/lib/Controller/AdminApiController.php b/lib/Controller/AdminApiController.php index c509762..1f06d53 100644 --- a/lib/Controller/AdminApiController.php +++ b/lib/Controller/AdminApiController.php @@ -270,8 +270,17 @@ class AdminApiController extends Controller { } private function runJson(Run $r): array { + $snapshot = null; + if ($r->getSnapshotId() !== null) { + try { + $s = $this->snapshots->findOne($r->getTargetId(), $r->getSnapshotId()); + $snapshot = ['createdAt' => $s->getCreatedAt(), 'label' => $s->getLabel()]; + } catch (\Throwable) { + // Snapshot already pruned or trashed: the run keeps its id, just not the date. + } + } return ['id' => $r->getId(), 'targetId' => $r->getTargetId(), 'kind' => $r->getKind(), 'status' => $r->getStatus(), - 'phase' => $r->getPhase(), 'snapshotId' => $r->getSnapshotId(), 'startedAt' => $r->getStartedAt(), + 'phase' => $r->getPhase(), 'snapshotId' => $r->getSnapshotId(), 'snapshot' => $snapshot, 'startedAt' => $r->getStartedAt(), 'updatedAt' => $r->getUpdatedAt(), 'finishedAt' => $r->getFinishedAt(), 'error' => $r->getError(), 'stats' => json_decode($r->getStats() ?? 'null', true)]; } diff --git a/src/AdminSettings.vue b/src/AdminSettings.vue index c901f1a..aa5df51 100644 --- a/src/AdminSettings.vue +++ b/src/AdminSettings.vue @@ -11,12 +11,20 @@ @@ -24,6 +32,7 @@