diff --git a/src/components/standalone/backup_and_restore/BackupContent.vue b/src/components/standalone/backup_and_restore/BackupContent.vue index 0b249645c..dd4182a7a 100644 --- a/src/components/standalone/backup_and_restore/BackupContent.vue +++ b/src/components/standalone/backup_and_restore/BackupContent.vue @@ -60,10 +60,11 @@ const retryTimeout = ref>() interface Backup { id: string - name: string - created: BigInteger + filename: string + uploaded_at: string size: number mimetype: string + sha256?: string } const loading = computed((): boolean => { @@ -183,8 +184,11 @@ async function getBackups() { const res = await ubusCall('ns.backup', 'registered-list-backups') if (res?.data?.values?.backups?.length) { listBackups.value = res.data.values.backups - // sort by created date in unix timestamp - listBackups.value.sort((a, b) => Number(b.created) - Number(a.created)) + // newest first — the server already sorts, but keep the guard + // so a stray ordering change upstream doesn't break the UI. + listBackups.value.sort( + (a, b) => new Date(b.uploaded_at).getTime() - new Date(a.uploaded_at).getTime() + ) } } catch (exception: unknown) { if (exception instanceof Error) { @@ -233,6 +237,9 @@ function successRunBackup() { function successSetPassphrase() { showPassphraseDrawer.value = false + // Refresh the store so the "Passphrase not configured" warning and the + // "Run backup" disabled state update without a full page reload. + backups.loadData() } function getMimetypeDescription(mimetype: string) { @@ -258,7 +265,7 @@ function getDropdownItems(item: Backup) { action: () => { openDeleteBackup( item.id, - formatDateLoc(new Date(Number(item.created) * 1000), 'PPpp') + + formatDateLoc(new Date(item.uploaded_at), 'PPpp') + ' (' + byteFormat1024(item.size) + ')' @@ -509,11 +516,11 @@ function successDeleteBackup() { - +
- {{ formatDateLoc(new Date(Number(item.created) * 1000), 'PPpp') }} + {{ formatDateLoc(new Date(item.uploaded_at), 'PPpp') }}
@@ -533,7 +540,7 @@ function successDeleteBackup() {