@futo-org/backups-orchestrator-ui 0.45.0 → 0.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/backends/BackendItem.svelte +17 -13
- package/dist/components/backends/BackendsList.svelte +4 -3
- package/dist/components/backends/dialogs/CreateLocalBackendModal.svelte +6 -5
- package/dist/components/backends/dialogs/OAuthDeviceFlowModal.svelte +3 -2
- package/dist/components/backends/dialogs/SelectBackendModal.svelte +7 -6
- package/dist/components/backups/BackupItem.svelte +13 -12
- package/dist/components/backups/BackupStatus.svelte +45 -40
- package/dist/components/backups/BackupsList.svelte +6 -5
- package/dist/components/backups/dialogs/ConfigureRepositoryModal.svelte +9 -8
- package/dist/components/backups/dialogs/CreateRepositoryModal.svelte +8 -4
- package/dist/components/backups/dialogs/ImportRepositoryModal.svelte +5 -4
- package/dist/components/backups/dialogs/ReconfigureRepositoryBackendModal.svelte +3 -3
- package/dist/components/backups/dialogs/RestoreSnapshotModal.svelte +16 -15
- package/dist/components/backups/dialogs/RollbackSnapshotModal.svelte +9 -8
- package/dist/components/backups/dialogs/SelectRepositoryModal.svelte +13 -7
- package/dist/components/backups/dialogs/ViewStatusModal.svelte +50 -19
- package/dist/components/backups/metrics-history/MetricsHistoryModal.svelte +37 -21
- package/dist/components/backups/run-history/RepositoryRunHistory.svelte +4 -3
- package/dist/components/backups/run-history/RepositoryRunHistoryItem.svelte +32 -12
- package/dist/components/backups/run-history/RepositoryRunHistoryPage.svelte +16 -14
- package/dist/components/backups/run-history/RunHistoryModal.svelte +5 -1
- package/dist/components/backups/snapshots-list/RepositorySnapshotsList.svelte +5 -4
- package/dist/components/backups/snapshots-list/RepositorySnapshotsListItem.svelte +15 -5
- package/dist/components/backups/snapshots-list/RepositorySnapshotsPage.svelte +7 -6
- package/dist/components/backups/snapshots-list/SnapshotsListModal.svelte +5 -1
- package/dist/components/dashboard/DashboardAvgBackupTime.svelte +2 -1
- package/dist/components/dashboard/DashboardBackupHealth.svelte +14 -10
- package/dist/components/dashboard/DashboardCurrentUsage.svelte +2 -1
- package/dist/components/dashboard/DashboardDailyBackupTime.svelte +2 -1
- package/dist/components/dashboard/DashboardInstall.svelte +3 -2
- package/dist/components/dashboard/DashboardRecentBackups.svelte +9 -4
- package/dist/components/dashboard/DashboardTotalStored.svelte +7 -2
- package/dist/components/integrations/immich/ImmichBackupSettingsPage.svelte +2 -0
- package/dist/components/integrations/immich/ImmichBackupsAdminNavButton.svelte +2 -1
- package/dist/components/integrations/immich/ImmichBackupsSidebarItem.svelte +22 -14
- package/dist/components/integrations/immich/ImmichDatabaseDumpAlert.svelte +43 -0
- package/dist/components/integrations/immich/ImmichDatabaseDumpAlert.svelte.d.ts +18 -0
- package/dist/components/integrations/immich/ImmichManageBackupOverview.svelte +15 -14
- package/dist/components/integrations/immich/ImmichManageBackupPage.svelte +5 -2
- package/dist/components/integrations/immich/ImmichOnboardingSetupFlow.svelte +2 -1
- package/dist/components/integrations/immich/settings/ImmichSettingsBackupContents.svelte +32 -31
- package/dist/components/integrations/immich/settings/ImmichSettingsBandwidth.svelte +140 -0
- package/dist/components/integrations/immich/settings/ImmichSettingsBandwidth.svelte.d.ts +3 -0
- package/dist/components/integrations/immich/settings/ImmichSettingsSchedule.svelte +16 -15
- package/dist/components/integrations/immich/settings/ImmichSettingsStorage.svelte +19 -18
- package/dist/components/onboarding/OnboardingBootstrapError.svelte +5 -4
- package/dist/components/onboarding/OnboardingLogin.svelte +4 -4
- package/dist/components/onboarding/RecoveryKeyDisplay.svelte +5 -4
- package/dist/components/onboarding/SampleOnboarding.svelte +4 -3
- package/dist/components/onboarding/dialogs/BackupsRecoveryKeyModal.svelte +4 -3
- package/dist/components/onboarding/restore-point-flow/RestorePointFlow.svelte +2 -1
- package/dist/components/onboarding/restore-point-flow/RestorePointFlow2SelectSnapshot.svelte +8 -4
- package/dist/components/onboarding/restore-point-flow/RestorePointFlow3ConfirmRestore.svelte +9 -8
- package/dist/components/onboarding/restore-point-flow/RestorePointFlow4Restore.svelte +2 -1
- package/dist/components/onboarding/stages/OnboardingStageBackupServices.svelte +9 -6
- package/dist/components/onboarding/stages/OnboardingStageKeyImport.svelte +6 -5
- package/dist/components/onboarding/stages/OnboardingStageTelemetry.svelte +6 -7
- package/dist/components/onboarding/steps/OnboardingStep1FinishSetup.svelte +12 -11
- package/dist/components/onboarding/steps/OnboardingStep2ConnectAccount.svelte +13 -12
- package/dist/components/onboarding/steps/OnboardingStep3SaveRecoveryKey.svelte +5 -4
- package/dist/components/onboarding/steps/OnboardingStep4FirstBackup.svelte +8 -8
- package/dist/components/onboarding/upsell/UpsellBackupFeaturesGrid.svelte +11 -14
- package/dist/components/onboarding/upsell/UpsellBackupFeaturesGrid.svelte.d.ts +2 -17
- package/dist/components/onboarding/upsell/UpsellExplainFutoBackups.svelte +10 -5
- package/dist/components/onboarding/upsell/UpsellFrequentlyAskedQuestions.svelte +2 -1
- package/dist/components/onboarding/upsell/UpsellFutoBackupsBadge.svelte +2 -1
- package/dist/components/onboarding/upsell/UpsellHowItWorks.svelte +10 -10
- package/dist/components/onboarding/upsell/UpsellProtectYourImmichLibrary.svelte +14 -11
- package/dist/components/schedules/RepositoryPicker.svelte +8 -7
- package/dist/components/schedules/ScheduleItem.svelte +6 -5
- package/dist/components/schedules/ScheduleList.svelte +4 -3
- package/dist/components/schedules/dialogs/ConfigureScheduleModal.svelte +4 -3
- package/dist/components/schedules/dialogs/CreateScheduleModal.svelte +7 -3
- package/dist/components/settings/SettingsBackends.svelte +3 -2
- package/dist/components/settings/SettingsBilling.svelte +13 -12
- package/dist/components/settings/SettingsNotifications.svelte +11 -10
- package/dist/components/ui/PageLayout.svelte +3 -2
- package/dist/components/ui/Pagination.svelte +4 -3
- package/dist/components/ui/PathListField.svelte +5 -4
- package/dist/components/ui/PathPickerField.svelte +4 -3
- package/dist/components/ui/PathPickerModal.svelte +16 -13
- package/dist/components/ui/StackListItem.svelte +2 -1
- package/dist/components/util/DeviceFlowAction.svelte +3 -2
- package/dist/components/util/DeviceFlowCode.svelte +4 -3
- package/dist/components/util/RelativeTime.svelte +2 -1
- package/dist/fetch-client.d.ts +24 -0
- package/dist/fetch-client.js +25 -0
- package/dist/i18n.d.ts +3 -0
- package/dist/i18n.js +13 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/locales/en-XA.d.ts +2 -0
- package/dist/locales/en-XA.js +1 -0
- package/dist/locales/en-XA.po +2198 -0
- package/dist/locales/en.d.ts +2 -0
- package/dist/locales/en.js +1 -0
- package/dist/locales/en.po +2446 -0
- package/dist/services/backend.service.d.ts +2 -1
- package/dist/services/backend.service.js +6 -5
- package/dist/services/config.service.d.ts +17 -0
- package/dist/services/config.service.js +37 -0
- package/dist/services/deviceFlow.service.svelte.js +6 -5
- package/dist/services/filesystem.service.js +2 -1
- package/dist/services/immich.integration.service.d.ts +6 -1
- package/dist/services/immich.integration.service.js +32 -6
- package/dist/services/integrations.service.js +4 -3
- package/dist/services/log.service.svelte.js +9 -3
- package/dist/services/onboarding.service.js +8 -7
- package/dist/services/repository.service.d.ts +2 -1
- package/dist/services/repository.service.js +19 -18
- package/dist/services/runHistory.service.d.ts +2 -1
- package/dist/services/runHistory.service.js +5 -4
- package/dist/services/schedule.service.d.ts +2 -1
- package/dist/services/schedule.service.js +18 -17
- package/dist/services/session.service.js +2 -1
- package/dist/services/snapshot.service.d.ts +2 -1
- package/dist/services/snapshot.service.js +15 -14
- package/dist/services/task.service.js +3 -2
- package/dist/utils/format.js +10 -8
- package/dist/utils/handle-error.js +2 -1
- package/package.json +12 -5
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
} from "@immich/ui";
|
|
18
18
|
import { SvelteSet } from "svelte/reactivity";
|
|
19
19
|
import ViewStatusModal from "./ViewStatusModal.svelte";
|
|
20
|
+
import { t } from "svelte-i18n-lingui";
|
|
20
21
|
|
|
21
22
|
type Props = {
|
|
22
23
|
repository: string;
|
|
@@ -57,8 +58,8 @@
|
|
|
57
58
|
</script>
|
|
58
59
|
|
|
59
60
|
<FormModal
|
|
60
|
-
title=
|
|
61
|
-
submitText=
|
|
61
|
+
title={$t`Restore Backup`}
|
|
62
|
+
submitText={$t`Restore`}
|
|
62
63
|
disabled={(!inPlace && !target.trim()) || mutation.isPending}
|
|
63
64
|
{onSubmit}
|
|
64
65
|
{onClose}
|
|
@@ -66,25 +67,25 @@
|
|
|
66
67
|
<Stack gap={5}>
|
|
67
68
|
<PathListField
|
|
68
69
|
paths={include}
|
|
69
|
-
addLabel=
|
|
70
|
-
manageLabel=
|
|
71
|
-
pickerTitle=
|
|
72
|
-
pickerDescription=
|
|
70
|
+
addLabel={$t`Add more files`}
|
|
71
|
+
manageLabel={$t`Select files instead`}
|
|
72
|
+
pickerTitle={$t`Files to restore`}
|
|
73
|
+
pickerDescription={$t`Pick the files and folders to restore. Leave empty to restore everything.`}
|
|
73
74
|
handleGetListing={(path) =>
|
|
74
75
|
handleGetSnapshotListing(repository, snapshot, path)}
|
|
75
76
|
>
|
|
76
|
-
{#snippet label()}Files to restore{/snippet}
|
|
77
|
-
{#snippet empty()}Restoring all files and folders
|
|
77
|
+
{#snippet label()}{$t`Files to restore`}{/snippet}
|
|
78
|
+
{#snippet empty()}{$t`Restoring all files and folders.`}{/snippet}
|
|
78
79
|
</PathListField>
|
|
79
80
|
|
|
80
81
|
<Stack gap={4}>
|
|
81
|
-
<Heading class="px-1" size="tiny">Options</Heading>
|
|
82
|
+
<Heading class="px-1" size="tiny">{$t`Options`}</Heading>
|
|
82
83
|
|
|
83
84
|
<HStack gap={4}>
|
|
84
85
|
<Stack gap={0}>
|
|
85
|
-
<Text>In-place restore</Text>
|
|
86
|
+
<Text>{$t`In-place restore`}</Text>
|
|
86
87
|
<Text color="secondary" size="small">
|
|
87
|
-
Restore files to where they were originally
|
|
88
|
+
{$t`Restore files to where they were originally.`}
|
|
88
89
|
</Text>
|
|
89
90
|
</Stack>
|
|
90
91
|
<Switch bind:checked={inPlace} />
|
|
@@ -94,12 +95,12 @@
|
|
|
94
95
|
<PathPickerField
|
|
95
96
|
bind:value={target}
|
|
96
97
|
placeholder="/path/to/restore/into"
|
|
97
|
-
pickerTitle=
|
|
98
|
-
pickerDescription=
|
|
98
|
+
pickerTitle={$t`Choose target folder`}
|
|
99
|
+
pickerDescription={$t`Pick the folder to restore files into.`}
|
|
99
100
|
>
|
|
100
|
-
{#snippet title()}Target{/snippet}
|
|
101
|
+
{#snippet title()}{$t`Target`}{/snippet}
|
|
101
102
|
{#snippet description()}
|
|
102
|
-
Where do you want this backup restored to
|
|
103
|
+
{$t`Where do you want this backup restored to?`}
|
|
103
104
|
{/snippet}
|
|
104
105
|
</PathPickerField>
|
|
105
106
|
{/if}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
Stack,
|
|
10
10
|
Text,
|
|
11
11
|
} from "@immich/ui";
|
|
12
|
+
import { t } from "svelte-i18n-lingui";
|
|
12
13
|
|
|
13
14
|
type Props = {
|
|
14
15
|
repository: string;
|
|
@@ -27,19 +28,19 @@
|
|
|
27
28
|
);
|
|
28
29
|
</script>
|
|
29
30
|
|
|
30
|
-
<Modal title=
|
|
31
|
+
<Modal title={$t`Rollback to this snapshot?`} size="small" {onClose}>
|
|
31
32
|
<ModalBody>
|
|
32
33
|
<Stack gap={4}>
|
|
33
34
|
<Text>
|
|
34
|
-
Your instance will return to how it was when this snapshot was taken
|
|
35
|
+
{$t`Your instance will return to how it was when this snapshot was taken.`}
|
|
35
36
|
</Text>
|
|
36
37
|
|
|
37
38
|
<Stack gap={2}>
|
|
38
|
-
<Text>This will
|
|
39
|
+
<Text>{$t`This will:`}</Text>
|
|
39
40
|
<ul class="list-disc ps-6">
|
|
40
|
-
<li><Text>Restore files from the snapshot</Text></li>
|
|
41
|
-
<li><Text>Restore the Immich database</Text></li>
|
|
42
|
-
<li><Text>Restart the server during rollback</Text></li>
|
|
41
|
+
<li><Text>{$t`Restore files from the snapshot`}</Text></li>
|
|
42
|
+
<li><Text>{$t`Restore the Immich database`}</Text></li>
|
|
43
|
+
<li><Text>{$t`Restart the server during rollback`}</Text></li>
|
|
43
44
|
</ul>
|
|
44
45
|
</Stack>
|
|
45
46
|
</Stack>
|
|
@@ -47,9 +48,9 @@
|
|
|
47
48
|
<ModalFooter>
|
|
48
49
|
<HStack>
|
|
49
50
|
<Button color="danger" loading={mutation.isPending} onclick={onConfirm}>
|
|
50
|
-
Confirm rollback
|
|
51
|
+
{$t`Confirm rollback`}
|
|
51
52
|
</Button>
|
|
52
|
-
<Button variant="ghost" onclick={onClose}>Cancel</Button>
|
|
53
|
+
<Button variant="ghost" onclick={onClose}>{$t`Cancel`}</Button>
|
|
53
54
|
</HStack>
|
|
54
55
|
</ModalFooter>
|
|
55
56
|
</Modal>
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
Stack,
|
|
14
14
|
} from "@immich/ui";
|
|
15
15
|
import type { Snippet } from "svelte";
|
|
16
|
+
import { t } from "svelte-i18n-lingui";
|
|
16
17
|
|
|
17
18
|
type Props = {
|
|
18
19
|
title?: string;
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
};
|
|
27
28
|
|
|
28
29
|
const {
|
|
29
|
-
title
|
|
30
|
+
title,
|
|
30
31
|
backendId,
|
|
31
32
|
leadingContent,
|
|
32
33
|
footerContent,
|
|
@@ -48,7 +49,7 @@
|
|
|
48
49
|
);
|
|
49
50
|
</script>
|
|
50
51
|
|
|
51
|
-
<Modal {title} size="small" onClose={onCancel}>
|
|
52
|
+
<Modal title={title ?? $t`Select Backup`} size="small" onClose={onCancel}>
|
|
52
53
|
<ModalBody>
|
|
53
54
|
<Stack>
|
|
54
55
|
{@render leadingContent?.()}
|
|
@@ -65,17 +66,22 @@
|
|
|
65
66
|
onclick={() => onSelect(repository.id)}
|
|
66
67
|
>
|
|
67
68
|
{#if !accessible}
|
|
68
|
-
Can't access, is your recovery key correct
|
|
69
|
+
{$t`Can't access, is your recovery key correct?`}
|
|
69
70
|
{:else if snapshots.length}
|
|
70
|
-
|
|
71
|
+
{$t({
|
|
72
|
+
message: "Last backup: {date}",
|
|
73
|
+
values: {
|
|
74
|
+
date: new Date(snapshots[0].time).toLocaleDateString(),
|
|
75
|
+
},
|
|
76
|
+
})}
|
|
71
77
|
{:else}
|
|
72
|
-
No backups yet
|
|
78
|
+
{$t`No backups yet`}
|
|
73
79
|
{/if}
|
|
74
80
|
</StackListOption>
|
|
75
81
|
{/each}
|
|
76
82
|
|
|
77
83
|
{#if (sortedRepositories ?? []).length === 0}
|
|
78
|
-
<StackListPlaceholder>No backups found
|
|
84
|
+
<StackListPlaceholder>{$t`No backups found.`}</StackListPlaceholder>
|
|
79
85
|
{/if}
|
|
80
86
|
</Suspense>
|
|
81
87
|
</StackList>
|
|
@@ -83,7 +89,7 @@
|
|
|
83
89
|
</ModalBody>
|
|
84
90
|
<ModalFooter>
|
|
85
91
|
<HStack>
|
|
86
|
-
<Button variant="ghost" onclick={onCancel}>Cancel</Button>
|
|
92
|
+
<Button variant="ghost" onclick={onCancel}>{$t`Cancel`}</Button>
|
|
87
93
|
{@render footerContent?.()}
|
|
88
94
|
</HStack>
|
|
89
95
|
</ModalFooter>
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
} from "@immich/ui";
|
|
23
23
|
import { DateTime } from "luxon";
|
|
24
24
|
import { onDestroy } from "svelte";
|
|
25
|
+
import { msg, plural, t } from "svelte-i18n-lingui";
|
|
25
26
|
|
|
26
27
|
type Props = {
|
|
27
28
|
logId: string;
|
|
@@ -87,9 +88,9 @@
|
|
|
87
88
|
);
|
|
88
89
|
|
|
89
90
|
const titles: Record<BackupStatusType, Record<"running" | "done", string>> = {
|
|
90
|
-
backup: { running:
|
|
91
|
-
restore: { running:
|
|
92
|
-
forget: { running:
|
|
91
|
+
backup: { running: msg`Backing up your library`, done: msg`Backup` },
|
|
92
|
+
restore: { running: msg`Restoring your library`, done: msg`Restore` },
|
|
93
|
+
forget: { running: msg`Pruning old backups`, done: msg`Prune` },
|
|
93
94
|
};
|
|
94
95
|
|
|
95
96
|
const retry = $derived(
|
|
@@ -104,19 +105,31 @@
|
|
|
104
105
|
const title = $derived.by(() => {
|
|
105
106
|
switch (backupState) {
|
|
106
107
|
case "complete": {
|
|
107
|
-
return
|
|
108
|
+
return $t({
|
|
109
|
+
message: "{name} complete",
|
|
110
|
+
values: { name: $t(titles[type].done) },
|
|
111
|
+
});
|
|
108
112
|
}
|
|
109
113
|
case "warned": {
|
|
110
|
-
return
|
|
114
|
+
return $t({
|
|
115
|
+
message: "{name} completed with warnings",
|
|
116
|
+
values: { name: $t(titles[type].done) },
|
|
117
|
+
});
|
|
111
118
|
}
|
|
112
119
|
case "failed": {
|
|
113
|
-
return
|
|
120
|
+
return $t({
|
|
121
|
+
message: "{name} failed",
|
|
122
|
+
values: { name: $t(titles[type].done) },
|
|
123
|
+
});
|
|
114
124
|
}
|
|
115
125
|
case "cancelled": {
|
|
116
|
-
return
|
|
126
|
+
return $t({
|
|
127
|
+
message: "{name} cancelled",
|
|
128
|
+
values: { name: $t(titles[type].done) },
|
|
129
|
+
});
|
|
117
130
|
}
|
|
118
131
|
default: {
|
|
119
|
-
return titles[type].running;
|
|
132
|
+
return $t(titles[type].running);
|
|
120
133
|
}
|
|
121
134
|
}
|
|
122
135
|
});
|
|
@@ -151,31 +164,49 @@
|
|
|
151
164
|
>
|
|
152
165
|
{#snippet details()}
|
|
153
166
|
{#if log.summary && type === "backup"}
|
|
154
|
-
{(
|
|
155
|
-
|
|
156
|
-
|
|
167
|
+
{$t({
|
|
168
|
+
message: "{count} items backed up",
|
|
169
|
+
values: {
|
|
170
|
+
count: (log.summary.total_files_processed ?? 0).toLocaleString(),
|
|
171
|
+
},
|
|
172
|
+
})} ·
|
|
173
|
+
{$t({
|
|
174
|
+
message: "{count} new items",
|
|
175
|
+
values: { count: (log.summary.files_new ?? 0).toLocaleString() },
|
|
176
|
+
})}
|
|
157
177
|
{#if log.summary.total_bytes_processed !== undefined}
|
|
158
178
|
·
|
|
159
|
-
<FormatBytes bytes={log.summary.total_bytes_processed} /> processed
|
|
179
|
+
<FormatBytes bytes={log.summary.total_bytes_processed} /> {$t`processed`}
|
|
160
180
|
{/if}
|
|
161
181
|
{:else if log.summary && type === "restore"}
|
|
162
|
-
{(
|
|
163
|
-
|
|
182
|
+
{$t({
|
|
183
|
+
message: "{count} items restored",
|
|
184
|
+
values: { count: (log.summary.files_restored ?? 0).toLocaleString() },
|
|
185
|
+
})}{#if log.summary.files_skipped}
|
|
186
|
+
· {$t({
|
|
187
|
+
message: "{count} skipped",
|
|
188
|
+
values: { count: log.summary.files_skipped.toLocaleString() },
|
|
189
|
+
})}
|
|
164
190
|
{/if}
|
|
165
191
|
{#if log.summary.bytes_restored !== undefined}
|
|
166
|
-
· <FormatBytes bytes={log.summary.bytes_restored} /> restored
|
|
192
|
+
· <FormatBytes bytes={log.summary.bytes_restored} /> {$t`restored`}
|
|
167
193
|
{/if}
|
|
168
194
|
{:else if type === "forget"}
|
|
169
|
-
{log.pruned.removed
|
|
170
|
-
|
|
171
|
-
|
|
195
|
+
{$plural(log.pruned.removed, {
|
|
196
|
+
one: "# backup removed",
|
|
197
|
+
other: "# backups removed",
|
|
198
|
+
})} ·
|
|
199
|
+
{$t({
|
|
200
|
+
message: "{count} kept",
|
|
201
|
+
values: { count: log.pruned.kept.toLocaleString() },
|
|
202
|
+
})}
|
|
172
203
|
{/if}
|
|
173
204
|
{/snippet}
|
|
174
205
|
|
|
175
206
|
{#snippet advanced()}
|
|
176
207
|
{#if showAdvanced}
|
|
177
208
|
<Stack gap={1}>
|
|
178
|
-
<Heading size="small">Event Log</Heading>
|
|
209
|
+
<Heading size="small">{$t`Event Log`}</Heading>
|
|
179
210
|
<Scrollable class="h-80 overflow-x-hidden">
|
|
180
211
|
<Stack gap={1}>
|
|
181
212
|
{#each log.events as event, index (index)}
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
mdiTimerOutline,
|
|
24
24
|
} from "@mdi/js";
|
|
25
25
|
import RelativeTime from "../../util/RelativeTime.svelte";
|
|
26
|
+
import { t } from "svelte-i18n-lingui";
|
|
26
27
|
|
|
27
28
|
type Props = {
|
|
28
29
|
repository: LocalRepositoryDto;
|
|
@@ -61,7 +62,10 @@
|
|
|
61
62
|
});
|
|
62
63
|
</script>
|
|
63
64
|
|
|
64
|
-
<Modal title={
|
|
65
|
+
<Modal title={$t({
|
|
66
|
+
message: "Metrics history for {name}",
|
|
67
|
+
values: { name: repository.name },
|
|
68
|
+
})} size="large" {onClose}>
|
|
65
69
|
<ModalBody>
|
|
66
70
|
{#if query.isLoading}
|
|
67
71
|
<LoadingSpinner />
|
|
@@ -69,7 +73,7 @@
|
|
|
69
73
|
<Alert color="danger">{getReadableErrorMessage(query.error)}</Alert>
|
|
70
74
|
{:else if entries.length === 0}
|
|
71
75
|
<Text color="secondary" class="text-center py-6">
|
|
72
|
-
No metrics history yet
|
|
76
|
+
{$t`No metrics history yet.`}
|
|
73
77
|
</Text>
|
|
74
78
|
{:else}
|
|
75
79
|
<Stack gap={0} class="divide-y rounded-2xl border overflow-hidden">
|
|
@@ -87,65 +91,65 @@
|
|
|
87
91
|
size="18"
|
|
88
92
|
class="text-info-500"
|
|
89
93
|
/>
|
|
90
|
-
<Text>Backup started</Text>
|
|
94
|
+
<Text>{$t`Backup started`}</Text>
|
|
91
95
|
{:else if status === 'complete'}
|
|
92
96
|
<Icon
|
|
93
97
|
icon={mdiCheckCircleOutline}
|
|
94
98
|
size="18"
|
|
95
99
|
class="text-success-500"
|
|
96
100
|
/>
|
|
97
|
-
<Text>Backup finished</Text>
|
|
98
|
-
<Badge size="tiny" color="success">Success</Badge>
|
|
101
|
+
<Text>{$t`Backup finished`}</Text>
|
|
102
|
+
<Badge size="tiny" color="success">{$t`Success`}</Badge>
|
|
99
103
|
{:else if status === 'warn'}
|
|
100
104
|
<Icon
|
|
101
105
|
icon={mdiAlertCircleOutline}
|
|
102
106
|
size="18"
|
|
103
107
|
class="text-warning-500"
|
|
104
108
|
/>
|
|
105
|
-
<Text>Backup finished</Text>
|
|
106
|
-
<Badge size="tiny" color="warning">Warning</Badge>
|
|
109
|
+
<Text>{$t`Backup finished`}</Text>
|
|
110
|
+
<Badge size="tiny" color="warning">{$t`Warning`}</Badge>
|
|
107
111
|
{:else if status === 'incomplete'}
|
|
108
112
|
<Icon
|
|
109
113
|
icon={mdiAlertCircleOutline}
|
|
110
114
|
size="18"
|
|
111
115
|
class="text-warning-500"
|
|
112
116
|
/>
|
|
113
|
-
<Text>Backup incomplete</Text>
|
|
114
|
-
<Badge size="tiny" color="warning">Incomplete</Badge>
|
|
117
|
+
<Text>{$t`Backup incomplete`}</Text>
|
|
118
|
+
<Badge size="tiny" color="warning">{$t`Incomplete`}</Badge>
|
|
115
119
|
{:else if status === 'failed'}
|
|
116
120
|
<Icon
|
|
117
121
|
icon={mdiAlertCircleOutline}
|
|
118
122
|
size="18"
|
|
119
123
|
class="text-danger-500"
|
|
120
124
|
/>
|
|
121
|
-
<Text>Backup finished</Text>
|
|
122
|
-
<Badge size="tiny" color="danger">Failed</Badge>
|
|
125
|
+
<Text>{$t`Backup finished`}</Text>
|
|
126
|
+
<Badge size="tiny" color="danger">{$t`Failed`}</Badge>
|
|
123
127
|
{:else if status === 'cancelled'}
|
|
124
128
|
<Icon
|
|
125
129
|
icon={mdiAlertCircleOutline}
|
|
126
130
|
size="18"
|
|
127
131
|
class="text-warning-500"
|
|
128
132
|
/>
|
|
129
|
-
<Text>Backup cancelled</Text>
|
|
130
|
-
<Badge size="tiny" color="warning">Cancelled</Badge>
|
|
133
|
+
<Text>{$t`Backup cancelled`}</Text>
|
|
134
|
+
<Badge size="tiny" color="warning">{$t`Cancelled`}</Badge>
|
|
131
135
|
{:else if isEnd}
|
|
132
136
|
<Icon
|
|
133
137
|
icon={mdiAlertCircleOutline}
|
|
134
138
|
size="18"
|
|
135
139
|
class="text-danger-500"
|
|
136
140
|
/>
|
|
137
|
-
<Text>Backup finished</Text>
|
|
138
|
-
<Badge size="tiny" color="danger">Failed</Badge>
|
|
141
|
+
<Text>{$t`Backup finished`}</Text>
|
|
142
|
+
<Badge size="tiny" color="danger">{$t`Failed`}</Badge>
|
|
139
143
|
{:else if isSize}
|
|
140
144
|
<Icon
|
|
141
145
|
icon={mdiDatabaseOutline}
|
|
142
146
|
size="18"
|
|
143
147
|
class="text-info-500"
|
|
144
148
|
/>
|
|
145
|
-
<Text>Size updated</Text>
|
|
149
|
+
<Text>{$t`Size updated`}</Text>
|
|
146
150
|
{:else}
|
|
147
151
|
<Icon icon={mdiTimerOutline} size="18" color="secondary" />
|
|
148
|
-
<Text>Event</Text>
|
|
152
|
+
<Text>{$t`Event`}</Text>
|
|
149
153
|
{/if}
|
|
150
154
|
</HStack>
|
|
151
155
|
<Text
|
|
@@ -160,22 +164,34 @@
|
|
|
160
164
|
<HStack class="gap-2 flex-wrap pl-7">
|
|
161
165
|
{#if entry.backupDuration != null}
|
|
162
166
|
<Badge size="tiny" color="secondary">
|
|
163
|
-
|
|
167
|
+
{$t({
|
|
168
|
+
message: "Duration {duration}",
|
|
169
|
+
values: { duration: formatDuration(entry.backupDuration) },
|
|
170
|
+
})}
|
|
164
171
|
</Badge>
|
|
165
172
|
{/if}
|
|
166
173
|
{#if entry.sizeBytes != null}
|
|
167
174
|
<Badge size="tiny" color="secondary">
|
|
168
|
-
|
|
175
|
+
{$t({
|
|
176
|
+
message: "Size {size}",
|
|
177
|
+
values: { size: getByteUnitString(entry.sizeBytes) },
|
|
178
|
+
})}
|
|
169
179
|
</Badge>
|
|
170
180
|
{/if}
|
|
171
181
|
{#if entry.started}
|
|
172
182
|
<Badge size="tiny" color="secondary">
|
|
173
|
-
|
|
183
|
+
{$t({
|
|
184
|
+
message: "Started {date}",
|
|
185
|
+
values: { date: isoDate(entry.started) },
|
|
186
|
+
})}
|
|
174
187
|
</Badge>
|
|
175
188
|
{/if}
|
|
176
189
|
{#if entry.backup}
|
|
177
190
|
<Badge size="tiny" color="secondary">
|
|
178
|
-
|
|
191
|
+
{$t({
|
|
192
|
+
message: "Ended {date}",
|
|
193
|
+
values: { date: isoDate(entry.backup) },
|
|
194
|
+
})}
|
|
179
195
|
</Badge>
|
|
180
196
|
{/if}
|
|
181
197
|
</HStack>
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
} from "../../../services/runHistory.service";
|
|
11
11
|
import { Button } from "@immich/ui";
|
|
12
12
|
import RepositoryRunHistoryItem from "./RepositoryRunHistoryItem.svelte";
|
|
13
|
+
import { t } from "svelte-i18n-lingui";
|
|
13
14
|
|
|
14
15
|
type Props = {
|
|
15
16
|
repository: LocalRepositoryDto;
|
|
@@ -27,12 +28,12 @@
|
|
|
27
28
|
|
|
28
29
|
<StackList>
|
|
29
30
|
{#snippet title()}
|
|
30
|
-
Recent backup attempts
|
|
31
|
+
{$t`Recent backup attempts`}
|
|
31
32
|
{/snippet}
|
|
32
33
|
|
|
33
34
|
{#snippet action()}
|
|
34
35
|
{#if onViewAll && query.data?.length}
|
|
35
|
-
<Button variant="ghost" size="small" onclick={onViewAll}>View all</Button>
|
|
36
|
+
<Button variant="ghost" size="small" onclick={onViewAll}>{$t`View all`}</Button>
|
|
36
37
|
{/if}
|
|
37
38
|
{/snippet}
|
|
38
39
|
|
|
@@ -43,7 +44,7 @@
|
|
|
43
44
|
{/each}
|
|
44
45
|
|
|
45
46
|
{#if runs.length === 0}
|
|
46
|
-
<StackListPlaceholder>No recent backups</StackListPlaceholder>
|
|
47
|
+
<StackListPlaceholder>{$t`No recent backups`}</StackListPlaceholder>
|
|
47
48
|
{/if}
|
|
48
49
|
{/snippet}
|
|
49
50
|
</Suspense>
|
|
@@ -9,18 +9,23 @@
|
|
|
9
9
|
mdiCloudOffOutline,
|
|
10
10
|
mdiCloudSyncOutline,
|
|
11
11
|
} from "@mdi/js";
|
|
12
|
+
import { t, msg } from "svelte-i18n-lingui";
|
|
12
13
|
|
|
13
14
|
type Props = {
|
|
14
15
|
run: RunDto;
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
const { run }: Props = $props();
|
|
18
|
-
const { ViewLog, DownloadLog } = $derived(getRunActions(run));
|
|
19
|
+
const { ViewLog, DownloadLog } = $derived(getRunActions(run, $t));
|
|
19
20
|
|
|
20
21
|
const nouns = {
|
|
21
|
-
restore: {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
restore: {
|
|
23
|
+
name: msg`restore`,
|
|
24
|
+
running: msg`Restore`,
|
|
25
|
+
done: msg`Restored`,
|
|
26
|
+
},
|
|
27
|
+
forget: { name: msg`prune`, running: msg`Prune`, done: msg`Pruned` },
|
|
28
|
+
backup: { name: msg`backup`, running: msg`Backup`, done: msg`Backed up` },
|
|
24
29
|
};
|
|
25
30
|
|
|
26
31
|
const noun = $derived(
|
|
@@ -33,35 +38,50 @@
|
|
|
33
38
|
switch (run.status) {
|
|
34
39
|
case "failed": {
|
|
35
40
|
return {
|
|
36
|
-
title:
|
|
41
|
+
title: $t({
|
|
42
|
+
message: "Failed {noun}",
|
|
43
|
+
values: { noun: $t(noun.name) },
|
|
44
|
+
}),
|
|
37
45
|
color: "danger",
|
|
38
46
|
icon: mdiCloudOffOutline,
|
|
39
47
|
} as const;
|
|
40
48
|
}
|
|
41
49
|
case "cancelled": {
|
|
42
50
|
return {
|
|
43
|
-
title:
|
|
51
|
+
title: $t({
|
|
52
|
+
message: "Cancelled {noun}",
|
|
53
|
+
values: { noun: $t(noun.name) },
|
|
54
|
+
}),
|
|
44
55
|
color: "warning",
|
|
45
56
|
icon: mdiCloudOffOutline,
|
|
46
57
|
} as const;
|
|
47
58
|
}
|
|
48
59
|
case "warn": {
|
|
49
60
|
return {
|
|
50
|
-
title:
|
|
61
|
+
title: $t({
|
|
62
|
+
message: "{done} with warnings",
|
|
63
|
+
values: { done: $t(noun.done) },
|
|
64
|
+
}),
|
|
51
65
|
color: "warning",
|
|
52
66
|
icon: mdiCloudCheckOutline,
|
|
53
67
|
} as const;
|
|
54
68
|
}
|
|
55
69
|
case "incomplete": {
|
|
56
70
|
return {
|
|
57
|
-
title:
|
|
71
|
+
title: $t({
|
|
72
|
+
message: "{running} in progress",
|
|
73
|
+
values: { running: $t(noun.running) },
|
|
74
|
+
}),
|
|
58
75
|
color: "primary",
|
|
59
76
|
icon: mdiCloudSyncOutline,
|
|
60
77
|
} as const;
|
|
61
78
|
}
|
|
62
79
|
default: {
|
|
63
80
|
return {
|
|
64
|
-
title:
|
|
81
|
+
title: $t({
|
|
82
|
+
message: "Successful {noun}",
|
|
83
|
+
values: { noun: $t(noun.name) },
|
|
84
|
+
}),
|
|
65
85
|
color: "success",
|
|
66
86
|
icon: mdiCloudCheckOutline,
|
|
67
87
|
} as const;
|
|
@@ -76,10 +96,10 @@
|
|
|
76
96
|
{/snippet}
|
|
77
97
|
|
|
78
98
|
{#if run.status === "incomplete"}
|
|
79
|
-
Started <RelativeTime time={run.start} />
|
|
99
|
+
{$t`Started`} <RelativeTime time={run.start} />
|
|
80
100
|
{:else if run.status === "failed" || run.status === "cancelled"}
|
|
81
|
-
Attempted {#if run.end}<RelativeTime time={run.end} />{/if}
|
|
101
|
+
{$t`Attempted`} {#if run.end}<RelativeTime time={run.end} />{/if}
|
|
82
102
|
{:else}
|
|
83
|
-
{noun.done} {#if run.end}<RelativeTime time={run.end} />{/if}
|
|
103
|
+
{$t(noun.done)} {#if run.end}<RelativeTime time={run.end} />{/if}
|
|
84
104
|
{/if}
|
|
85
105
|
</StackListItem>
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
import { Stack, type ActionItem } from "@immich/ui";
|
|
14
14
|
import { mdiRadioboxBlank, mdiRadioboxMarked } from "@mdi/js";
|
|
15
15
|
import RepositoryRunHistoryItem from "./RepositoryRunHistoryItem.svelte";
|
|
16
|
+
import { msg, t } from "svelte-i18n-lingui";
|
|
16
17
|
|
|
17
18
|
type Props = {
|
|
18
19
|
repository: LocalRepositoryDto;
|
|
@@ -42,26 +43,26 @@
|
|
|
42
43
|
};
|
|
43
44
|
|
|
44
45
|
const sortOptions = [
|
|
45
|
-
{ newest: true, title:
|
|
46
|
-
{ newest: false, title:
|
|
46
|
+
{ newest: true, title: msg`Newest first` },
|
|
47
|
+
{ newest: false, title: msg`Oldest first` },
|
|
47
48
|
];
|
|
48
49
|
|
|
49
50
|
const statusOptions: { value: typeof status; title: string }[] = [
|
|
50
|
-
{ value: "all", title:
|
|
51
|
-
{ value: "complete", title:
|
|
52
|
-
{ value: "warn", title:
|
|
53
|
-
{ value: "failed", title:
|
|
54
|
-
{ value: "incomplete", title:
|
|
51
|
+
{ value: "all", title: msg`All attempts` },
|
|
52
|
+
{ value: "complete", title: msg`Successful only` },
|
|
53
|
+
{ value: "warn", title: msg`With warnings only` },
|
|
54
|
+
{ value: "failed", title: msg`Failed only` },
|
|
55
|
+
{ value: "incomplete", title: msg`In progress only` },
|
|
55
56
|
];
|
|
56
57
|
|
|
57
58
|
const tick = (selected: boolean) =>
|
|
58
59
|
selected ? mdiRadioboxMarked : mdiRadioboxBlank;
|
|
59
60
|
|
|
60
61
|
const sort = $derived({
|
|
61
|
-
label: newestFirst ?
|
|
62
|
+
label: newestFirst ? $t`Newest first` : $t`Oldest first`,
|
|
62
63
|
items: sortOptions.map(
|
|
63
64
|
(option): ActionItem => ({
|
|
64
|
-
title: option.title,
|
|
65
|
+
title: $t(option.title),
|
|
65
66
|
icon: tick(newestFirst === option.newest),
|
|
66
67
|
onAction: () => (newestFirst = option.newest),
|
|
67
68
|
}),
|
|
@@ -69,13 +70,14 @@
|
|
|
69
70
|
});
|
|
70
71
|
|
|
71
72
|
const filters = $derived({
|
|
72
|
-
label:
|
|
73
|
+
label: $t(
|
|
73
74
|
statusOptions.find((option) => option.value === status)?.title ??
|
|
74
|
-
|
|
75
|
+
msg`Filters`,
|
|
76
|
+
),
|
|
75
77
|
active: status !== "all",
|
|
76
78
|
items: statusOptions.map(
|
|
77
79
|
(option): ActionItem => ({
|
|
78
|
-
title: option.title,
|
|
80
|
+
title: $t(option.title),
|
|
79
81
|
icon: tick(status === option.value),
|
|
80
82
|
onAction: () => onFilter(option.value),
|
|
81
83
|
}),
|
|
@@ -116,7 +118,7 @@
|
|
|
116
118
|
|
|
117
119
|
<Stack gap={4}>
|
|
118
120
|
<ListToolbar
|
|
119
|
-
placeholder=
|
|
121
|
+
placeholder={$t`Search backups`}
|
|
120
122
|
{search}
|
|
121
123
|
{onSearch}
|
|
122
124
|
{sort}
|
|
@@ -130,7 +132,7 @@
|
|
|
130
132
|
{/each}
|
|
131
133
|
|
|
132
134
|
{#if filtered.length === 0}
|
|
133
|
-
<StackListPlaceholder>No backups found</StackListPlaceholder>
|
|
135
|
+
<StackListPlaceholder>{$t`No backups found`}</StackListPlaceholder>
|
|
134
136
|
{/if}
|
|
135
137
|
</Suspense>
|
|
136
138
|
</StackList>
|