@futo-org/backups-orchestrator-ui 0.46.0 → 0.48.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 +10 -5
- package/dist/components/backends/dialogs/SelectBackendModal.svelte +7 -6
- package/dist/components/backups/BackupItem.svelte +13 -12
- package/dist/components/backups/BackupStatus.svelte +74 -44
- package/dist/components/backups/BackupStatus.svelte.d.ts +2 -0
- package/dist/components/backups/BackupTaskMonitor.svelte +6 -0
- package/dist/components/{dashboard/DashboardInstall.svelte.d.ts → backups/BackupTaskMonitor.svelte.d.ts} +3 -3
- 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 +20 -23
- 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 +53 -19
- package/dist/components/backups/metrics-history/MetricsHistoryModal.svelte +135 -112
- 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 +4 -1
- package/dist/components/dashboard/DashboardBackupHealth.svelte +74 -64
- package/dist/components/dashboard/DashboardCurrentUsage.svelte +7 -1
- package/dist/components/dashboard/DashboardDailyBackupTime.svelte +4 -1
- package/dist/components/dashboard/DashboardPage.svelte +51 -23
- package/dist/components/dashboard/DashboardRecentBackups.svelte +9 -4
- package/dist/components/dashboard/DashboardTotalStored.svelte +9 -2
- package/dist/components/integrations/immich/ImmichBackupsAdminNavButton.svelte +5 -3
- package/dist/components/integrations/immich/ImmichBackupsAdminNavButton.svelte.d.ts +1 -0
- package/dist/components/integrations/immich/ImmichBackupsPage.svelte +1 -5
- package/dist/components/integrations/immich/ImmichBackupsPage.svelte.d.ts +0 -2
- package/dist/components/integrations/immich/ImmichBackupsSidebarItem.svelte +18 -15
- package/dist/components/integrations/immich/ImmichBackupsSidebarItem.svelte.d.ts +1 -0
- package/dist/components/integrations/immich/ImmichDatabaseDumpAlert.svelte +6 -5
- package/dist/components/integrations/immich/ImmichManageBackupOverview.svelte +44 -37
- package/dist/components/integrations/immich/ImmichManageBackupPage.svelte +5 -2
- package/dist/components/integrations/immich/ImmichOnboardingRestoreFlow.svelte +43 -22
- package/dist/components/integrations/immich/ImmichOnboardingSetupFlow.svelte +72 -73
- package/dist/components/integrations/immich/settings/ImmichSettingsBackupContents.svelte +54 -45
- package/dist/components/integrations/immich/settings/ImmichSettingsBandwidth.svelte +57 -63
- package/dist/components/integrations/immich/settings/ImmichSettingsSchedule.svelte +16 -15
- package/dist/components/integrations/immich/settings/ImmichSettingsStorage.svelte +27 -19
- package/dist/components/onboarding/OnboardingBootstrapError.svelte +5 -4
- package/dist/components/onboarding/OnboardingLogin.svelte +8 -6
- package/dist/components/onboarding/RecoveryKeyDisplay.svelte +20 -12
- package/dist/components/onboarding/SampleOnboarding.svelte +40 -38
- 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 +16 -8
- package/dist/components/onboarding/restore-point-flow/RestorePointFlow3ConfirmRestore.svelte +30 -19
- package/dist/components/onboarding/restore-point-flow/RestorePointFlow4Restore.svelte +10 -4
- package/dist/components/onboarding/steps/OnboardingStep1FinishSetup.svelte +11 -11
- package/dist/components/onboarding/steps/OnboardingStep2ConnectAccount.svelte +13 -12
- package/dist/components/onboarding/steps/OnboardingStep3SaveRecoveryKey.svelte +18 -6
- package/dist/components/onboarding/steps/OnboardingStep3SaveRecoveryKey.svelte.d.ts +1 -0
- package/dist/components/onboarding/steps/OnboardingStep4FirstBackup.svelte +11 -11
- package/dist/components/onboarding/steps/OnboardingStepBackupServices.svelte +52 -0
- package/dist/components/onboarding/steps/OnboardingStepBackupServices.svelte.d.ts +7 -0
- package/dist/components/onboarding/steps/OnboardingStepChooseStorage.svelte +82 -0
- package/dist/components/onboarding/steps/OnboardingStepChooseStorage.svelte.d.ts +6 -0
- package/dist/components/onboarding/steps/OnboardingStepConfirmRecoveryKey.svelte +62 -0
- package/dist/components/onboarding/steps/OnboardingStepConfirmRecoveryKey.svelte.d.ts +9 -0
- package/dist/components/onboarding/steps/OnboardingStepImportRecoveryKey.svelte +42 -0
- package/dist/components/onboarding/steps/OnboardingStepImportRecoveryKey.svelte.d.ts +8 -0
- package/dist/components/onboarding/steps/OnboardingStepLayout.svelte +15 -9
- package/dist/components/onboarding/steps/OnboardingStepLayout.svelte.d.ts +2 -2
- package/dist/components/onboarding/steps/OnboardingStepModal.svelte +19 -0
- package/dist/components/onboarding/steps/OnboardingStepModal.svelte.d.ts +11 -0
- package/dist/components/onboarding/steps/OnboardingStepTelemetry.svelte +44 -0
- package/dist/components/onboarding/steps/OnboardingStepTelemetry.svelte.d.ts +7 -0
- 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 +5 -13
- package/dist/components/onboarding/upsell/UpsellExplainFutoBackups.svelte.d.ts +0 -2
- package/dist/components/onboarding/upsell/UpsellFrequentlyAskedQuestions.svelte +4 -3
- package/dist/components/onboarding/upsell/UpsellFutoBackupsBadge.svelte +3 -2
- package/dist/components/onboarding/upsell/UpsellHowItWorks.svelte +11 -11
- package/dist/components/onboarding/upsell/UpsellModal.svelte +7 -13
- package/dist/components/onboarding/upsell/UpsellModal.svelte.d.ts +0 -1
- package/dist/components/onboarding/upsell/UpsellPage.svelte +3 -5
- package/dist/components/onboarding/upsell/UpsellPage.svelte.d.ts +0 -2
- package/dist/components/onboarding/upsell/UpsellProtectYourImmichLibrary.svelte +13 -18
- package/dist/components/onboarding/upsell/UpsellProtectYourImmichLibrary.svelte.d.ts +0 -1
- package/dist/components/schedules/RepositoryPicker.svelte +32 -13
- package/dist/components/schedules/ScheduleItem.svelte +6 -5
- package/dist/components/schedules/ScheduleList.svelte +4 -3
- package/dist/components/schedules/dialogs/ConfigureScheduleModal.svelte +17 -5
- package/dist/components/schedules/dialogs/CreateScheduleModal.svelte +20 -5
- package/dist/components/settings/SettingsBackends.svelte +3 -2
- package/dist/components/settings/SettingsBilling.svelte +14 -12
- package/dist/components/settings/SettingsNotifications.svelte +11 -10
- package/dist/components/test/ImmichTestUi.svelte +62 -44
- package/dist/components/test/TestUi.svelte +53 -69
- package/dist/components/test/dashboard/BackupHealth.svelte +6 -7
- package/dist/components/test/immich/MockImmichHideBackupsReminder.svelte +3 -2
- package/dist/components/test/immich/MockImmichHideBackupsReminder.svelte.d.ts +17 -2
- package/dist/components/ui/Accordion.svelte +43 -30
- package/dist/components/ui/Accordion.svelte.d.ts +1 -0
- package/dist/components/ui/IconTile.svelte +27 -0
- package/dist/components/ui/IconTile.svelte.d.ts +10 -0
- package/dist/components/ui/ListToolbar.svelte +1 -0
- package/dist/components/ui/PageLayout.svelte +4 -3
- package/dist/components/ui/Pagination.svelte +4 -3
- package/dist/components/ui/PathListField.svelte +25 -7
- package/dist/components/ui/PathPickerField.svelte +18 -6
- package/dist/components/ui/PathPickerModal.svelte +40 -19
- package/dist/components/ui/Section.svelte +26 -0
- package/dist/components/ui/Section.svelte.d.ts +9 -0
- package/dist/components/ui/SkipLink.svelte +19 -0
- package/dist/components/ui/SkipLink.svelte.d.ts +6 -0
- package/dist/components/ui/StackList.svelte +4 -13
- package/dist/components/ui/StackListItem.svelte +6 -17
- package/dist/components/ui/StackListItem.svelte.d.ts +3 -3
- package/dist/components/ui/VisualisationGauge.svelte +18 -11
- package/dist/components/ui/VisualisationGauge.svelte.d.ts +1 -0
- package/dist/components/ui/VisualisationSegmentedBar.svelte +14 -22
- package/dist/components/ui/VisualisationSegmentedBar.svelte.d.ts +0 -3
- package/dist/components/util/DeviceFlowAction.svelte +3 -2
- package/dist/components/util/DeviceFlowCode.svelte +10 -8
- package/dist/components/util/RelativeTime.svelte +2 -1
- package/dist/i18n.d.ts +3 -0
- package/dist/i18n.js +13 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/locales/en-XA.d.ts +2 -0
- package/dist/locales/en-XA.js +1 -0
- package/dist/locales/en-XA.po +2345 -0
- package/dist/locales/en.d.ts +2 -0
- package/dist/locales/en.js +1 -0
- package/dist/locales/en.po +2345 -0
- package/dist/options.d.ts +1 -0
- package/dist/options.js +1 -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 +12 -1
- package/dist/services/config.service.js +22 -1
- 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 +4 -2
- package/dist/services/immich.integration.service.js +12 -8
- 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 +11 -1
- package/dist/services/runHistory.service.js +48 -6
- 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/clipboard.d.ts +1 -0
- package/dist/utils/clipboard.js +11 -0
- package/dist/utils/focus.d.ts +12 -0
- package/dist/utils/focus.js +34 -0
- package/dist/utils/format.js +10 -8
- package/dist/utils/handle-error.js +2 -1
- package/package.json +14 -7
- package/dist/components/dashboard/DashboardInstall.svelte +0 -15
- package/dist/components/onboarding/stages/OnboardingStageBackupServices.svelte +0 -68
- package/dist/components/onboarding/stages/OnboardingStageBackupServices.svelte.d.ts +0 -8
- package/dist/components/onboarding/stages/OnboardingStageKeyImport.svelte +0 -57
- package/dist/components/onboarding/stages/OnboardingStageKeyImport.svelte.d.ts +0 -8
- package/dist/components/onboarding/stages/OnboardingStageTelemetry.svelte +0 -60
- package/dist/components/onboarding/stages/OnboardingStageTelemetry.svelte.d.ts +0 -7
|
@@ -3,26 +3,30 @@
|
|
|
3
3
|
import { useMetricsHistory } from "../../../services/metricsHistory.service";
|
|
4
4
|
import { formatDuration } from "../../../utils/format";
|
|
5
5
|
import { getReadableErrorMessage } from "../../../utils/handle-error";
|
|
6
|
+
import type { RepositoryMetricsHistoryDto } from "@futo-org/backups-api-client";
|
|
6
7
|
import {
|
|
7
8
|
Alert,
|
|
8
|
-
|
|
9
|
+
Button,
|
|
9
10
|
getByteUnitString,
|
|
10
|
-
HStack,
|
|
11
11
|
Icon,
|
|
12
12
|
LoadingSpinner,
|
|
13
13
|
Modal,
|
|
14
14
|
ModalBody,
|
|
15
|
-
Stack,
|
|
16
15
|
Text,
|
|
17
16
|
} from "@immich/ui";
|
|
18
17
|
import {
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
mdiCloudAlertOutline,
|
|
19
|
+
mdiCloudCancelOutline,
|
|
20
|
+
mdiCloudCheckOutline,
|
|
21
|
+
mdiCloudUploadOutline,
|
|
21
22
|
mdiDatabaseOutline,
|
|
22
|
-
mdiPlayCircleOutline,
|
|
23
23
|
mdiTimerOutline,
|
|
24
24
|
} from "@mdi/js";
|
|
25
|
+
import StackList from "../../ui/StackList.svelte";
|
|
26
|
+
import StackListItem from "../../ui/StackListItem.svelte";
|
|
25
27
|
import RelativeTime from "../../util/RelativeTime.svelte";
|
|
28
|
+
import { tick } from "svelte";
|
|
29
|
+
import { t } from "svelte-i18n-lingui";
|
|
26
30
|
|
|
27
31
|
type Props = {
|
|
28
32
|
repository: LocalRepositoryDto;
|
|
@@ -40,7 +44,78 @@
|
|
|
40
44
|
|
|
41
45
|
const isoDate = (value: string) => new Date(value).toLocaleString();
|
|
42
46
|
|
|
47
|
+
const describe = (entry: RepositoryMetricsHistoryDto) => {
|
|
48
|
+
if (entry.started != null) {
|
|
49
|
+
return {
|
|
50
|
+
title: $t`Backup started`,
|
|
51
|
+
icon: mdiCloudUploadOutline,
|
|
52
|
+
color: "primary",
|
|
53
|
+
} as const;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
switch (entry.backupStatus) {
|
|
57
|
+
case "complete": {
|
|
58
|
+
return {
|
|
59
|
+
title: $t`Backup finished`,
|
|
60
|
+
icon: mdiCloudCheckOutline,
|
|
61
|
+
color: "success",
|
|
62
|
+
} as const;
|
|
63
|
+
}
|
|
64
|
+
case "warn": {
|
|
65
|
+
return {
|
|
66
|
+
title: $t`Backup finished with warnings`,
|
|
67
|
+
icon: mdiCloudAlertOutline,
|
|
68
|
+
color: "warning",
|
|
69
|
+
} as const;
|
|
70
|
+
}
|
|
71
|
+
case "incomplete": {
|
|
72
|
+
return {
|
|
73
|
+
title: $t`Backup incomplete`,
|
|
74
|
+
icon: mdiCloudAlertOutline,
|
|
75
|
+
color: "warning",
|
|
76
|
+
} as const;
|
|
77
|
+
}
|
|
78
|
+
case "cancelled": {
|
|
79
|
+
return {
|
|
80
|
+
title: $t`Backup cancelled`,
|
|
81
|
+
icon: mdiCloudCancelOutline,
|
|
82
|
+
color: "warning",
|
|
83
|
+
} as const;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (entry.backup != null) {
|
|
88
|
+
return {
|
|
89
|
+
title: $t`Backup failed`,
|
|
90
|
+
icon: mdiCloudAlertOutline,
|
|
91
|
+
color: "danger",
|
|
92
|
+
} as const;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (entry.sizeBytes != null) {
|
|
96
|
+
return {
|
|
97
|
+
title: $t`Size updated`,
|
|
98
|
+
icon: mdiDatabaseOutline,
|
|
99
|
+
color: "primary",
|
|
100
|
+
} as const;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return {
|
|
104
|
+
title: $t`Event`,
|
|
105
|
+
icon: mdiTimerOutline,
|
|
106
|
+
color: "primary",
|
|
107
|
+
} as const;
|
|
108
|
+
};
|
|
109
|
+
|
|
43
110
|
let sentinel = $state<HTMLDivElement | null>(null);
|
|
111
|
+
let historyEnd = $state<HTMLDivElement>();
|
|
112
|
+
|
|
113
|
+
const loadMore = async () => {
|
|
114
|
+
await query.fetchNextPage();
|
|
115
|
+
if (query.hasNextPage) return;
|
|
116
|
+
await tick();
|
|
117
|
+
historyEnd?.focus();
|
|
118
|
+
};
|
|
44
119
|
|
|
45
120
|
$effect(() => {
|
|
46
121
|
if (!sentinel) return;
|
|
@@ -61,7 +136,14 @@
|
|
|
61
136
|
});
|
|
62
137
|
</script>
|
|
63
138
|
|
|
64
|
-
<Modal
|
|
139
|
+
<Modal
|
|
140
|
+
title={$t({
|
|
141
|
+
message: "Metrics history for {name}",
|
|
142
|
+
values: { name: repository.name },
|
|
143
|
+
})}
|
|
144
|
+
size="medium"
|
|
145
|
+
{onClose}
|
|
146
|
+
>
|
|
65
147
|
<ModalBody>
|
|
66
148
|
{#if query.isLoading}
|
|
67
149
|
<LoadingSpinner />
|
|
@@ -69,125 +151,66 @@
|
|
|
69
151
|
<Alert color="danger">{getReadableErrorMessage(query.error)}</Alert>
|
|
70
152
|
{:else if entries.length === 0}
|
|
71
153
|
<Text color="secondary" class="text-center py-6">
|
|
72
|
-
No metrics history yet
|
|
154
|
+
{$t`No metrics history yet.`}
|
|
73
155
|
</Text>
|
|
74
156
|
{:else}
|
|
75
|
-
<
|
|
157
|
+
<StackList>
|
|
76
158
|
{#each entries as entry (entry.id)}
|
|
77
|
-
{@const
|
|
78
|
-
{
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
icon={mdiAlertCircleOutline}
|
|
102
|
-
size="18"
|
|
103
|
-
class="text-warning-500"
|
|
104
|
-
/>
|
|
105
|
-
<Text>Backup finished</Text>
|
|
106
|
-
<Badge size="tiny" color="warning">Warning</Badge>
|
|
107
|
-
{:else if status === 'incomplete'}
|
|
108
|
-
<Icon
|
|
109
|
-
icon={mdiAlertCircleOutline}
|
|
110
|
-
size="18"
|
|
111
|
-
class="text-warning-500"
|
|
112
|
-
/>
|
|
113
|
-
<Text>Backup incomplete</Text>
|
|
114
|
-
<Badge size="tiny" color="warning">Incomplete</Badge>
|
|
115
|
-
{:else if status === 'failed'}
|
|
116
|
-
<Icon
|
|
117
|
-
icon={mdiAlertCircleOutline}
|
|
118
|
-
size="18"
|
|
119
|
-
class="text-danger-500"
|
|
120
|
-
/>
|
|
121
|
-
<Text>Backup finished</Text>
|
|
122
|
-
<Badge size="tiny" color="danger">Failed</Badge>
|
|
123
|
-
{:else if status === 'cancelled'}
|
|
124
|
-
<Icon
|
|
125
|
-
icon={mdiAlertCircleOutline}
|
|
126
|
-
size="18"
|
|
127
|
-
class="text-warning-500"
|
|
128
|
-
/>
|
|
129
|
-
<Text>Backup cancelled</Text>
|
|
130
|
-
<Badge size="tiny" color="warning">Cancelled</Badge>
|
|
131
|
-
{:else if isEnd}
|
|
132
|
-
<Icon
|
|
133
|
-
icon={mdiAlertCircleOutline}
|
|
134
|
-
size="18"
|
|
135
|
-
class="text-danger-500"
|
|
136
|
-
/>
|
|
137
|
-
<Text>Backup finished</Text>
|
|
138
|
-
<Badge size="tiny" color="danger">Failed</Badge>
|
|
139
|
-
{:else if isSize}
|
|
140
|
-
<Icon
|
|
141
|
-
icon={mdiDatabaseOutline}
|
|
142
|
-
size="18"
|
|
143
|
-
class="text-info-500"
|
|
144
|
-
/>
|
|
145
|
-
<Text>Size updated</Text>
|
|
146
|
-
{:else}
|
|
147
|
-
<Icon icon={mdiTimerOutline} size="18" color="secondary" />
|
|
148
|
-
<Text>Event</Text>
|
|
149
|
-
{/if}
|
|
150
|
-
</HStack>
|
|
159
|
+
{@const appearance = describe(entry)}
|
|
160
|
+
<StackListItem title={appearance.title} color={appearance.color}>
|
|
161
|
+
{#snippet icon()}
|
|
162
|
+
<Icon icon={appearance.icon} />
|
|
163
|
+
{/snippet}
|
|
164
|
+
|
|
165
|
+
{#if entry.started}
|
|
166
|
+
{$t({
|
|
167
|
+
message: "Started {date}",
|
|
168
|
+
values: { date: isoDate(entry.started) },
|
|
169
|
+
})}
|
|
170
|
+
{:else if entry.backupDuration != null}
|
|
171
|
+
{$t({
|
|
172
|
+
message: "Duration: {duration}",
|
|
173
|
+
values: { duration: formatDuration(entry.backupDuration) },
|
|
174
|
+
})}
|
|
175
|
+
{:else if entry.sizeBytes != null}
|
|
176
|
+
{$t({
|
|
177
|
+
message: "Size {size}",
|
|
178
|
+
values: { size: getByteUnitString(entry.sizeBytes) },
|
|
179
|
+
})}
|
|
180
|
+
{/if}
|
|
181
|
+
|
|
182
|
+
{#snippet trailing()}
|
|
151
183
|
<Text
|
|
152
184
|
color="secondary"
|
|
153
185
|
size="small"
|
|
186
|
+
class="shrink-0"
|
|
154
187
|
title={isoDate(entry.createdAt)}
|
|
155
188
|
>
|
|
156
189
|
<RelativeTime time={entry.createdAt} />
|
|
157
190
|
</Text>
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
<HStack class="gap-2 flex-wrap pl-7">
|
|
161
|
-
{#if entry.backupDuration != null}
|
|
162
|
-
<Badge size="tiny" color="secondary">
|
|
163
|
-
Duration {formatDuration(entry.backupDuration)}
|
|
164
|
-
</Badge>
|
|
165
|
-
{/if}
|
|
166
|
-
{#if entry.sizeBytes != null}
|
|
167
|
-
<Badge size="tiny" color="secondary">
|
|
168
|
-
Size {getByteUnitString(entry.sizeBytes)}
|
|
169
|
-
</Badge>
|
|
170
|
-
{/if}
|
|
171
|
-
{#if entry.started}
|
|
172
|
-
<Badge size="tiny" color="secondary">
|
|
173
|
-
Started {isoDate(entry.started)}
|
|
174
|
-
</Badge>
|
|
175
|
-
{/if}
|
|
176
|
-
{#if entry.backup}
|
|
177
|
-
<Badge size="tiny" color="secondary">
|
|
178
|
-
Ended {isoDate(entry.backup)}
|
|
179
|
-
</Badge>
|
|
180
|
-
{/if}
|
|
181
|
-
</HStack>
|
|
182
|
-
</Stack>
|
|
191
|
+
{/snippet}
|
|
192
|
+
</StackListItem>
|
|
183
193
|
{/each}
|
|
184
|
-
</
|
|
194
|
+
</StackList>
|
|
185
195
|
|
|
186
196
|
{#if query.hasNextPage}
|
|
187
197
|
<div bind:this={sentinel} class="flex justify-center py-4">
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
198
|
+
<Button
|
|
199
|
+
variant="ghost"
|
|
200
|
+
size="small"
|
|
201
|
+
loading={query.isFetchingNextPage}
|
|
202
|
+
onclick={() => void loadMore()}
|
|
203
|
+
>
|
|
204
|
+
{$t`Load more`}
|
|
205
|
+
</Button>
|
|
206
|
+
</div>
|
|
207
|
+
{:else if (query.data?.pages.length ?? 0) > 1}
|
|
208
|
+
<div
|
|
209
|
+
bind:this={historyEnd}
|
|
210
|
+
tabindex="-1"
|
|
211
|
+
class="flex justify-center py-4 outline-none"
|
|
212
|
+
>
|
|
213
|
+
<Text color="secondary" size="small">{$t`No more history`}</Text>
|
|
191
214
|
</div>
|
|
192
215
|
{/if}
|
|
193
216
|
{/if}
|
|
@@ -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>
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { LocalRepositoryDto } from "../../../fetch-client";
|
|
3
3
|
import { Modal, ModalBody } from "@immich/ui";
|
|
4
4
|
import RepositoryRunHistoryPage from "./RepositoryRunHistoryPage.svelte";
|
|
5
|
+
import { t } from "svelte-i18n-lingui";
|
|
5
6
|
|
|
6
7
|
type Props = {
|
|
7
8
|
repository: LocalRepositoryDto;
|
|
@@ -11,7 +12,10 @@
|
|
|
11
12
|
let { repository, onClose }: Props = $props();
|
|
12
13
|
</script>
|
|
13
14
|
|
|
14
|
-
<Modal title={
|
|
15
|
+
<Modal title={$t({
|
|
16
|
+
message: "Run History for {name}",
|
|
17
|
+
values: { name: repository.name },
|
|
18
|
+
})} size="giant" {onClose}>
|
|
15
19
|
<ModalBody>
|
|
16
20
|
<RepositoryRunHistoryPage {repository} />
|
|
17
21
|
</ModalBody>
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
} from "../../../services/snapshot.service";
|
|
13
13
|
import { Button, HStack } from "@immich/ui";
|
|
14
14
|
import RepositorySnapshotsListItem from "./RepositorySnapshotsListItem.svelte";
|
|
15
|
+
import { t } from "svelte-i18n-lingui";
|
|
15
16
|
|
|
16
17
|
type Props = {
|
|
17
18
|
repository: LocalRepositoryDto;
|
|
@@ -32,12 +33,12 @@
|
|
|
32
33
|
|
|
33
34
|
<StackList>
|
|
34
35
|
{#snippet title()}
|
|
35
|
-
Snapshots
|
|
36
|
+
{$t`Snapshots`}
|
|
36
37
|
{/snippet}
|
|
37
38
|
|
|
38
39
|
{#snippet action()}
|
|
39
40
|
{#if onViewAll && query.data?.length}
|
|
40
|
-
<Button variant="ghost" size="small" onclick={onViewAll}>View all</Button>
|
|
41
|
+
<Button variant="ghost" size="small" onclick={onViewAll}>{$t`View all`}</Button>
|
|
41
42
|
{/if}
|
|
42
43
|
{/snippet}
|
|
43
44
|
|
|
@@ -52,7 +53,7 @@
|
|
|
52
53
|
{/each}
|
|
53
54
|
|
|
54
55
|
{#if snapshots.length === 0}
|
|
55
|
-
<StackListPlaceholder>No backups yet</StackListPlaceholder>
|
|
56
|
+
<StackListPlaceholder>{$t`No backups yet`}</StackListPlaceholder>
|
|
56
57
|
{/if}
|
|
57
58
|
{/snippet}
|
|
58
59
|
</Suspense>
|
|
@@ -64,7 +65,7 @@
|
|
|
64
65
|
size="small"
|
|
65
66
|
variant="outline"
|
|
66
67
|
onclick={() => handlePruneRepository(repository.id)}
|
|
67
|
-
>Clean up old backups now</Button
|
|
68
|
+
>{$t`Clean up old backups now`}</Button
|
|
68
69
|
>
|
|
69
70
|
</HStack>
|
|
70
71
|
{/if}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { FormatBytes, Icon } from "@immich/ui";
|
|
7
7
|
import { mdiHistory } from "@mdi/js";
|
|
8
8
|
import { DateTime } from "luxon";
|
|
9
|
+
import { t, plural } from "svelte-i18n-lingui";
|
|
9
10
|
|
|
10
11
|
type Props = {
|
|
11
12
|
repositoryId: string;
|
|
@@ -15,7 +16,7 @@
|
|
|
15
16
|
|
|
16
17
|
const { repositoryId, snapshot, immich = false }: Props = $props();
|
|
17
18
|
const { Restore, Rollback, Delete } = $derived(
|
|
18
|
-
getSnapshotActions(repositoryId, snapshot, immich),
|
|
19
|
+
getSnapshotActions(repositoryId, snapshot, $t, immich),
|
|
19
20
|
);
|
|
20
21
|
|
|
21
22
|
const title = $derived(
|
|
@@ -31,15 +32,24 @@
|
|
|
31
32
|
<RelativeTime time={snapshot.time} />
|
|
32
33
|
|
|
33
34
|
{#if snapshot.summary}
|
|
34
|
-
·
|
|
35
|
-
{snapshot.summary.totalFiles
|
|
35
|
+
·
|
|
36
|
+
{$plural(snapshot.summary.totalFiles, {
|
|
37
|
+
one: "# file",
|
|
38
|
+
other: "# files",
|
|
39
|
+
})} ·
|
|
36
40
|
<FormatBytes bytes={snapshot.summary.totalBytes} />
|
|
37
41
|
|
|
38
42
|
{#if snapshot.summary.filesNew > 0}
|
|
39
|
-
· {
|
|
43
|
+
· {$t({
|
|
44
|
+
message: "{count} new",
|
|
45
|
+
values: { count: snapshot.summary.filesNew.toLocaleString() },
|
|
46
|
+
})}
|
|
40
47
|
{/if}
|
|
41
48
|
{#if snapshot.summary.filesChanged > 0}
|
|
42
|
-
· {
|
|
49
|
+
· {$t({
|
|
50
|
+
message: "{count} changed",
|
|
51
|
+
values: { count: snapshot.summary.filesChanged.toLocaleString() },
|
|
52
|
+
})}
|
|
43
53
|
{/if}
|
|
44
54
|
{/if}
|
|
45
55
|
</StackListItem>
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
import { mdiRadioboxBlank, mdiRadioboxMarked } from "@mdi/js";
|
|
15
15
|
import { DateTime } from "luxon";
|
|
16
16
|
import RepositorySnapshotsListItem from "./RepositorySnapshotsListItem.svelte";
|
|
17
|
+
import { msg, t } from "svelte-i18n-lingui";
|
|
17
18
|
|
|
18
19
|
type Props = {
|
|
19
20
|
repository: LocalRepositoryDto;
|
|
@@ -37,15 +38,15 @@
|
|
|
37
38
|
};
|
|
38
39
|
|
|
39
40
|
const sortOptions = [
|
|
40
|
-
{ newest: true, title:
|
|
41
|
-
{ newest: false, title:
|
|
41
|
+
{ newest: true, title: msg`Newest first` },
|
|
42
|
+
{ newest: false, title: msg`Oldest first` },
|
|
42
43
|
];
|
|
43
44
|
|
|
44
45
|
const sort = $derived({
|
|
45
|
-
label: newestFirst ?
|
|
46
|
+
label: newestFirst ? $t`Newest first` : $t`Oldest first`,
|
|
46
47
|
items: sortOptions.map(
|
|
47
48
|
(option): ActionItem => ({
|
|
48
|
-
title: option.title,
|
|
49
|
+
title: $t(option.title),
|
|
49
50
|
icon: newestFirst === option.newest
|
|
50
51
|
? mdiRadioboxMarked
|
|
51
52
|
: mdiRadioboxBlank,
|
|
@@ -93,7 +94,7 @@
|
|
|
93
94
|
<OnEvents {onRunUpdate} />
|
|
94
95
|
|
|
95
96
|
<Stack gap={4}>
|
|
96
|
-
<ListToolbar placeholder=
|
|
97
|
+
<ListToolbar placeholder={$t`Search snapshots`} {search} {onSearch} {sort} />
|
|
97
98
|
|
|
98
99
|
<StackList>
|
|
99
100
|
<Suspense {query}>
|
|
@@ -106,7 +107,7 @@
|
|
|
106
107
|
{/each}
|
|
107
108
|
|
|
108
109
|
{#if filtered.length === 0}
|
|
109
|
-
<StackListPlaceholder>No snapshots found</StackListPlaceholder>
|
|
110
|
+
<StackListPlaceholder>{$t`No snapshots found`}</StackListPlaceholder>
|
|
110
111
|
{/if}
|
|
111
112
|
</Suspense>
|
|
112
113
|
</StackList>
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { LocalRepositoryDto } from "../../../fetch-client";
|
|
3
3
|
import { Modal, ModalBody } from "@immich/ui";
|
|
4
4
|
import RepositorySnapshotsPage from "./RepositorySnapshotsPage.svelte";
|
|
5
|
+
import { t } from "svelte-i18n-lingui";
|
|
5
6
|
|
|
6
7
|
type Props = {
|
|
7
8
|
repository: LocalRepositoryDto;
|
|
@@ -11,7 +12,10 @@
|
|
|
11
12
|
let { repository, onClose }: Props = $props();
|
|
12
13
|
</script>
|
|
13
14
|
|
|
14
|
-
<Modal title={
|
|
15
|
+
<Modal title={$t({
|
|
16
|
+
message: "Snapshots for {name}",
|
|
17
|
+
values: { name: repository.name },
|
|
18
|
+
})} size="giant" {onClose}>
|
|
15
19
|
<ModalBody>
|
|
16
20
|
<RepositorySnapshotsPage {repository} />
|
|
17
21
|
</ModalBody>
|