Skip to content

Commit 211592e

Browse files
fix(ui): display what state we are in so it is clear to the user what is happening (#71)
1 parent e6ff903 commit 211592e

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

client/src/components/Backup.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
<template>
22
<div>
33
<div class="flex">
4-
<h1 class="mb-6">{{ __("statamic-backup::backup.title") }}</h1>
4+
<div class="flex flex-col mb-4">
5+
<h1>{{ __("statamic-backup::backup.title") }}</h1>
6+
<p v-if="status !== 'idle'" class="text-sm text-gray-700 whitespace-nowrap">
7+
{{ __(`statamic-backup::backup.state.${status}`) }}
8+
</p>
9+
</div>
510
<backup-actions @openBrowser="openBrowser" />
611
</div>
712

@@ -37,6 +42,11 @@ export default {
3742
this.$store.dispatch('backup-provider/pollEndpoint');
3843
}
3944
},
45+
computed: {
46+
status() {
47+
return this.$store.state['backup-provider'].status;
48+
},
49+
},
4050
destroy() {
4151
this.$store.dispatch('backup-provider/stopPolling');
4252
this.$store.unregisterModule('backup-provider');

lang/en/backup.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@
1010
'backup_started' => 'Starting backup...',
1111
'success' => 'Backed up successfully',
1212

13+
'state' => [
14+
'idle' => 'Idle',
15+
'initializing' => 'Fetching initial status',
16+
'queued' => 'Waiting for action to start',
17+
'backup_in_progress' => 'Backup in progress',
18+
'restore_in_progress' => 'Restore in progress',
19+
'backup_completed' => 'Backup completed',
20+
'restore_completed' => 'Restore completed',
21+
'backup_failed' => 'Backup failed',
22+
'restore_failed' => 'Restore failed',
23+
],
24+
1325
'upload' => [
1426
'label' => 'Upload Backup',
1527

0 commit comments

Comments
 (0)