@futo-org/backups-orchestrator-ui 0.47.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/dialogs/OAuthDeviceFlowModal.svelte +7 -3
- package/dist/components/backups/BackupStatus.svelte +30 -5
- 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/dialogs/RestoreSnapshotModal.svelte +7 -11
- package/dist/components/backups/dialogs/ViewStatusModal.svelte +4 -1
- package/dist/components/backups/metrics-history/MetricsHistoryModal.svelte +131 -124
- package/dist/components/dashboard/DashboardAvgBackupTime.svelte +2 -0
- package/dist/components/dashboard/DashboardBackupHealth.svelte +73 -67
- package/dist/components/dashboard/DashboardCurrentUsage.svelte +6 -1
- package/dist/components/dashboard/DashboardDailyBackupTime.svelte +2 -0
- package/dist/components/dashboard/DashboardPage.svelte +51 -23
- package/dist/components/dashboard/DashboardRecentBackups.svelte +1 -1
- package/dist/components/dashboard/DashboardTotalStored.svelte +3 -1
- package/dist/components/integrations/immich/ImmichBackupsAdminNavButton.svelte +3 -2
- 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 +3 -1
- package/dist/components/integrations/immich/ImmichBackupsSidebarItem.svelte.d.ts +1 -0
- package/dist/components/integrations/immich/ImmichManageBackupOverview.svelte +34 -28
- package/dist/components/integrations/immich/ImmichManageBackupPage.svelte +2 -0
- package/dist/components/integrations/immich/ImmichOnboardingRestoreFlow.svelte +43 -22
- package/dist/components/integrations/immich/ImmichOnboardingSetupFlow.svelte +71 -73
- package/dist/components/integrations/immich/settings/ImmichSettingsBackupContents.svelte +24 -16
- package/dist/components/integrations/immich/settings/ImmichSettingsBandwidth.svelte +25 -21
- package/dist/components/integrations/immich/settings/ImmichSettingsStorage.svelte +8 -1
- package/dist/components/onboarding/OnboardingLogin.svelte +4 -2
- package/dist/components/onboarding/RecoveryKeyDisplay.svelte +17 -10
- package/dist/components/onboarding/SampleOnboarding.svelte +39 -38
- package/dist/components/onboarding/restore-point-flow/RestorePointFlow2SelectSnapshot.svelte +8 -4
- package/dist/components/onboarding/restore-point-flow/RestorePointFlow3ConfirmRestore.svelte +25 -15
- package/dist/components/onboarding/restore-point-flow/RestorePointFlow4Restore.svelte +8 -3
- package/dist/components/onboarding/steps/OnboardingStep1FinishSetup.svelte +0 -1
- package/dist/components/onboarding/steps/OnboardingStep2ConnectAccount.svelte +4 -4
- package/dist/components/onboarding/steps/OnboardingStep3SaveRecoveryKey.svelte +14 -3
- package/dist/components/onboarding/steps/OnboardingStep3SaveRecoveryKey.svelte.d.ts +1 -0
- package/dist/components/onboarding/steps/OnboardingStep4FirstBackup.svelte +4 -4
- 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 +3 -3
- package/dist/components/onboarding/upsell/UpsellExplainFutoBackups.svelte +3 -16
- package/dist/components/onboarding/upsell/UpsellExplainFutoBackups.svelte.d.ts +0 -2
- package/dist/components/onboarding/upsell/UpsellFrequentlyAskedQuestions.svelte +3 -3
- package/dist/components/onboarding/upsell/UpsellFutoBackupsBadge.svelte +1 -1
- package/dist/components/onboarding/upsell/UpsellHowItWorks.svelte +4 -4
- 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 +6 -14
- package/dist/components/onboarding/upsell/UpsellProtectYourImmichLibrary.svelte.d.ts +0 -1
- package/dist/components/schedules/RepositoryPicker.svelte +28 -10
- package/dist/components/schedules/dialogs/ConfigureScheduleModal.svelte +14 -3
- package/dist/components/schedules/dialogs/CreateScheduleModal.svelte +14 -3
- package/dist/components/settings/SettingsBilling.svelte +1 -0
- 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 +1 -1
- package/dist/components/ui/PathListField.svelte +21 -4
- package/dist/components/ui/PathPickerField.svelte +14 -3
- package/dist/components/ui/PathPickerModal.svelte +30 -12
- 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 +4 -16
- 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/DeviceFlowCode.svelte +6 -5
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/locales/en-XA.js +1 -1
- package/dist/locales/en-XA.po +272 -125
- package/dist/locales/en.js +1 -1
- package/dist/locales/en.po +288 -389
- package/dist/options.d.ts +1 -0
- package/dist/options.js +1 -0
- package/dist/services/immich.integration.service.d.ts +2 -1
- package/dist/services/immich.integration.service.js +5 -2
- package/dist/services/log.service.svelte.js +1 -1
- package/dist/services/runHistory.service.d.ts +9 -0
- package/dist/services/runHistory.service.js +43 -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/package.json +4 -4
- package/dist/components/dashboard/DashboardInstall.svelte +0 -16
- package/dist/components/onboarding/stages/OnboardingStageBackupServices.svelte +0 -71
- package/dist/components/onboarding/stages/OnboardingStageBackupServices.svelte.d.ts +0 -8
- package/dist/components/onboarding/stages/OnboardingStageKeyImport.svelte +0 -58
- package/dist/components/onboarding/stages/OnboardingStageKeyImport.svelte.d.ts +0 -8
- package/dist/components/onboarding/stages/OnboardingStageTelemetry.svelte +0 -59
- package/dist/components/onboarding/stages/OnboardingStageTelemetry.svelte.d.ts +0 -7
|
@@ -55,11 +55,15 @@
|
|
|
55
55
|
<ModalBody>
|
|
56
56
|
{#if flow.state.userCode}
|
|
57
57
|
<DeviceFlowCode {flow} />
|
|
58
|
-
{:else if flow.state.error}
|
|
59
|
-
<Text color="danger">{flow.state.error}</Text>
|
|
60
|
-
{:else}
|
|
58
|
+
{:else if !flow.state.error}
|
|
61
59
|
<LoadingSpinner />
|
|
62
60
|
{/if}
|
|
61
|
+
|
|
62
|
+
<div role="alert">
|
|
63
|
+
{#if !flow.state.userCode && flow.state.error}
|
|
64
|
+
<Text color="danger">{flow.state.error}</Text>
|
|
65
|
+
{/if}
|
|
66
|
+
</div>
|
|
63
67
|
</ModalBody>
|
|
64
68
|
<ModalFooter>
|
|
65
69
|
<HStack fullWidth>
|
|
@@ -32,11 +32,13 @@
|
|
|
32
32
|
progress?: number;
|
|
33
33
|
start?: string;
|
|
34
34
|
duration?: string;
|
|
35
|
+
remaining?: string;
|
|
35
36
|
errors?: string[];
|
|
36
37
|
details?: Snippet;
|
|
37
38
|
currentFiles?: string[];
|
|
38
39
|
advanced?: Snippet;
|
|
39
40
|
onRetry?: () => void;
|
|
41
|
+
onCancel?: () => void;
|
|
40
42
|
};
|
|
41
43
|
|
|
42
44
|
const {
|
|
@@ -46,11 +48,13 @@
|
|
|
46
48
|
progress = 0,
|
|
47
49
|
start,
|
|
48
50
|
duration,
|
|
51
|
+
remaining,
|
|
49
52
|
errors = [],
|
|
50
53
|
details,
|
|
51
54
|
currentFiles = [],
|
|
52
55
|
advanced,
|
|
53
56
|
onRetry,
|
|
57
|
+
onCancel,
|
|
54
58
|
}: Props = $props();
|
|
55
59
|
|
|
56
60
|
const phases: Record<BackupStatusType, [string, string, string]> = {
|
|
@@ -83,6 +87,12 @@
|
|
|
83
87
|
forget: msg`Pruning old backups was cancelled`,
|
|
84
88
|
};
|
|
85
89
|
|
|
90
|
+
const cancelLabels: Record<BackupStatusType, string> = {
|
|
91
|
+
backup: msg`Cancel backup`,
|
|
92
|
+
restore: msg`Cancel restore`,
|
|
93
|
+
forget: msg`Cancel prune`,
|
|
94
|
+
};
|
|
95
|
+
|
|
86
96
|
const reassurance: Record<BackupStatusType, string> = {
|
|
87
97
|
backup: msg`No changes were made to your existing backups.`,
|
|
88
98
|
restore: msg`Your backups are untouched — nothing was lost.`,
|
|
@@ -90,7 +100,7 @@
|
|
|
90
100
|
};
|
|
91
101
|
|
|
92
102
|
const running: Record<BackupStatusType, string> = {
|
|
93
|
-
backup: msg`You can close this window and the backup
|
|
103
|
+
backup: msg`Immich is backing up your library. You can close this window and continue using Immich while the backup runs in the background.`,
|
|
94
104
|
restore: msg`You can close this window and the restore will continue in the background.`,
|
|
95
105
|
forget: msg`You can close this window and the prune will continue in the background.`,
|
|
96
106
|
};
|
|
@@ -129,6 +139,8 @@
|
|
|
129
139
|
}
|
|
130
140
|
});
|
|
131
141
|
|
|
142
|
+
const announcement = $derived(backupState === "running" ? phase : headline);
|
|
143
|
+
|
|
132
144
|
const titleColor = $derived(
|
|
133
145
|
backupState === "complete"
|
|
134
146
|
? "success"
|
|
@@ -149,12 +161,15 @@
|
|
|
149
161
|
|
|
150
162
|
<Stack gap={4}>
|
|
151
163
|
<Stack gap={2}>
|
|
152
|
-
<Heading size="medium" color={titleColor} fontWeight="bold">{title}</Heading>
|
|
164
|
+
<Heading tag="h2" size="medium" color={titleColor} fontWeight="bold">{title}</Heading>
|
|
153
165
|
|
|
154
166
|
<Stack gap={1}>
|
|
155
|
-
<Heading size="small">{headline}</Heading>
|
|
167
|
+
<Heading tag="h3" size="small">{headline}</Heading>
|
|
168
|
+
<p role="status" class="sr-only">{announcement}</p>
|
|
156
169
|
|
|
157
|
-
{#if backupState === "running" &&
|
|
170
|
+
{#if backupState === "running" && remaining}
|
|
171
|
+
<Text>{remaining}</Text>
|
|
172
|
+
{:else if backupState === "running" && start}
|
|
158
173
|
<Text color="muted">{$t`Started`} <RelativeTime time={start} /></Text>
|
|
159
174
|
{:else if backupState === "failed"}
|
|
160
175
|
<Text color="muted">{$t(reassurance[type])}</Text>
|
|
@@ -178,8 +193,10 @@
|
|
|
178
193
|
{#if !terminal}
|
|
179
194
|
<ProgressBar
|
|
180
195
|
{progress}
|
|
196
|
+
aria-label={phase}
|
|
197
|
+
valueLabel={`${Math.round(progress * 100)}%`}
|
|
181
198
|
shape="round"
|
|
182
|
-
size="
|
|
199
|
+
size="small"
|
|
183
200
|
class="bg-primary-100 border-none"
|
|
184
201
|
/>
|
|
185
202
|
{/if}
|
|
@@ -208,6 +225,14 @@
|
|
|
208
225
|
|
|
209
226
|
{#if backupState === "running"}
|
|
210
227
|
<Text color="muted">{$t(running[type])}</Text>
|
|
228
|
+
|
|
229
|
+
{#if onCancel}
|
|
230
|
+
<HStack gap={4} wrap>
|
|
231
|
+
<Button variant="ghost" color="danger" shape="round" onclick={onCancel}
|
|
232
|
+
>{$t(cancelLabels[type])}</Button
|
|
233
|
+
>
|
|
234
|
+
</HStack>
|
|
235
|
+
{/if}
|
|
211
236
|
{:else if (backupState === "complete" || backupState === "warned") && details}
|
|
212
237
|
<Text color="muted">{@render details()}</Text>
|
|
213
238
|
{/if}
|
|
@@ -8,11 +8,13 @@ type Props = {
|
|
|
8
8
|
progress?: number;
|
|
9
9
|
start?: string;
|
|
10
10
|
duration?: string;
|
|
11
|
+
remaining?: string;
|
|
11
12
|
errors?: string[];
|
|
12
13
|
details?: Snippet;
|
|
13
14
|
currentFiles?: string[];
|
|
14
15
|
advanced?: Snippet;
|
|
15
16
|
onRetry?: () => void;
|
|
17
|
+
onCancel?: () => void;
|
|
16
18
|
};
|
|
17
19
|
declare const BackupStatus: import("svelte").Component<Props, {}, "">;
|
|
18
20
|
type BackupStatus = ReturnType<typeof BackupStatus>;
|
|
@@ -11,8 +11,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
11
11
|
};
|
|
12
12
|
z_$$bindings?: Bindings;
|
|
13
13
|
}
|
|
14
|
-
declare const
|
|
14
|
+
declare const BackupTaskMonitor: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
15
|
[evt: string]: CustomEvent<any>;
|
|
16
16
|
}, {}, {}, string>;
|
|
17
|
-
type
|
|
18
|
-
export default
|
|
17
|
+
type BackupTaskMonitor = InstanceType<typeof BackupTaskMonitor>;
|
|
18
|
+
export default BackupTaskMonitor;
|
|
@@ -7,13 +7,12 @@
|
|
|
7
7
|
useRestoreSnapshot,
|
|
8
8
|
} from "../../../services/snapshot.service";
|
|
9
9
|
import {
|
|
10
|
+
Field,
|
|
10
11
|
FormModal,
|
|
11
12
|
Heading,
|
|
12
|
-
HStack,
|
|
13
13
|
modalManager,
|
|
14
14
|
Stack,
|
|
15
15
|
Switch,
|
|
16
|
-
Text,
|
|
17
16
|
} from "@immich/ui";
|
|
18
17
|
import { SvelteSet } from "svelte/reactivity";
|
|
19
18
|
import ViewStatusModal from "./ViewStatusModal.svelte";
|
|
@@ -79,17 +78,14 @@
|
|
|
79
78
|
</PathListField>
|
|
80
79
|
|
|
81
80
|
<Stack gap={4}>
|
|
82
|
-
<Heading class="px-1" size="tiny">{$t`Options`}</Heading>
|
|
81
|
+
<Heading tag="h3" class="px-1" size="tiny">{$t`Options`}</Heading>
|
|
83
82
|
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
{$t`Restore files to where they were originally.`}
|
|
89
|
-
</Text>
|
|
90
|
-
</Stack>
|
|
83
|
+
<Field
|
|
84
|
+
label={$t`In-place restore`}
|
|
85
|
+
description={$t`Restore files to where they were originally.`}
|
|
86
|
+
>
|
|
91
87
|
<Switch bind:checked={inPlace} />
|
|
92
|
-
</
|
|
88
|
+
</Field>
|
|
93
89
|
|
|
94
90
|
{#if !inPlace}
|
|
95
91
|
<PathPickerField
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import { options } from "../../../options";
|
|
8
8
|
import { createLogObserver } from "../../../services/log.service.svelte";
|
|
9
9
|
import { useRun, useRunEventHandler } from "../../../services/runHistory.service";
|
|
10
|
+
import { handleCancelTask } from "../../../services/task.service";
|
|
10
11
|
import { formatDuration } from "../../../utils/format";
|
|
11
12
|
import {
|
|
12
13
|
CloseButton,
|
|
@@ -158,9 +159,11 @@
|
|
|
158
159
|
progress={log.status.progress}
|
|
159
160
|
start={run?.start}
|
|
160
161
|
{duration}
|
|
162
|
+
remaining={log.status.text}
|
|
161
163
|
errors={log.errors}
|
|
162
164
|
currentFiles={log.status.currentFiles}
|
|
163
165
|
onRetry={retry}
|
|
166
|
+
onCancel={run ? () => void handleCancelTask(run.repositoryId) : undefined}
|
|
164
167
|
>
|
|
165
168
|
{#snippet details()}
|
|
166
169
|
{#if log.summary && type === "backup"}
|
|
@@ -206,7 +209,7 @@
|
|
|
206
209
|
{#snippet advanced()}
|
|
207
210
|
{#if showAdvanced}
|
|
208
211
|
<Stack gap={1}>
|
|
209
|
-
<Heading size="small">{$t`Event Log`}</Heading>
|
|
212
|
+
<Heading tag="h3" size="small">{$t`Event Log`}</Heading>
|
|
210
213
|
<Scrollable class="h-80 overflow-x-hidden">
|
|
211
214
|
<Stack gap={1}>
|
|
212
215
|
{#each log.events as event, index (index)}
|
|
@@ -3,26 +3,29 @@
|
|
|
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";
|
|
26
29
|
import { t } from "svelte-i18n-lingui";
|
|
27
30
|
|
|
28
31
|
type Props = {
|
|
@@ -41,7 +44,78 @@
|
|
|
41
44
|
|
|
42
45
|
const isoDate = (value: string) => new Date(value).toLocaleString();
|
|
43
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
|
+
|
|
44
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
|
+
};
|
|
45
119
|
|
|
46
120
|
$effect(() => {
|
|
47
121
|
if (!sentinel) return;
|
|
@@ -62,10 +136,14 @@
|
|
|
62
136
|
});
|
|
63
137
|
</script>
|
|
64
138
|
|
|
65
|
-
<Modal
|
|
139
|
+
<Modal
|
|
140
|
+
title={$t({
|
|
66
141
|
message: "Metrics history for {name}",
|
|
67
142
|
values: { name: repository.name },
|
|
68
|
-
})}
|
|
143
|
+
})}
|
|
144
|
+
size="medium"
|
|
145
|
+
{onClose}
|
|
146
|
+
>
|
|
69
147
|
<ModalBody>
|
|
70
148
|
{#if query.isLoading}
|
|
71
149
|
<LoadingSpinner />
|
|
@@ -76,134 +154,63 @@
|
|
|
76
154
|
{$t`No metrics history yet.`}
|
|
77
155
|
</Text>
|
|
78
156
|
{:else}
|
|
79
|
-
<
|
|
157
|
+
<StackList>
|
|
80
158
|
{#each entries as entry (entry.id)}
|
|
81
|
-
{@const
|
|
82
|
-
{
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
icon={mdiAlertCircleOutline}
|
|
106
|
-
size="18"
|
|
107
|
-
class="text-warning-500"
|
|
108
|
-
/>
|
|
109
|
-
<Text>{$t`Backup finished`}</Text>
|
|
110
|
-
<Badge size="tiny" color="warning">{$t`Warning`}</Badge>
|
|
111
|
-
{:else if status === 'incomplete'}
|
|
112
|
-
<Icon
|
|
113
|
-
icon={mdiAlertCircleOutline}
|
|
114
|
-
size="18"
|
|
115
|
-
class="text-warning-500"
|
|
116
|
-
/>
|
|
117
|
-
<Text>{$t`Backup incomplete`}</Text>
|
|
118
|
-
<Badge size="tiny" color="warning">{$t`Incomplete`}</Badge>
|
|
119
|
-
{:else if status === 'failed'}
|
|
120
|
-
<Icon
|
|
121
|
-
icon={mdiAlertCircleOutline}
|
|
122
|
-
size="18"
|
|
123
|
-
class="text-danger-500"
|
|
124
|
-
/>
|
|
125
|
-
<Text>{$t`Backup finished`}</Text>
|
|
126
|
-
<Badge size="tiny" color="danger">{$t`Failed`}</Badge>
|
|
127
|
-
{:else if status === 'cancelled'}
|
|
128
|
-
<Icon
|
|
129
|
-
icon={mdiAlertCircleOutline}
|
|
130
|
-
size="18"
|
|
131
|
-
class="text-warning-500"
|
|
132
|
-
/>
|
|
133
|
-
<Text>{$t`Backup cancelled`}</Text>
|
|
134
|
-
<Badge size="tiny" color="warning">{$t`Cancelled`}</Badge>
|
|
135
|
-
{:else if isEnd}
|
|
136
|
-
<Icon
|
|
137
|
-
icon={mdiAlertCircleOutline}
|
|
138
|
-
size="18"
|
|
139
|
-
class="text-danger-500"
|
|
140
|
-
/>
|
|
141
|
-
<Text>{$t`Backup finished`}</Text>
|
|
142
|
-
<Badge size="tiny" color="danger">{$t`Failed`}</Badge>
|
|
143
|
-
{:else if isSize}
|
|
144
|
-
<Icon
|
|
145
|
-
icon={mdiDatabaseOutline}
|
|
146
|
-
size="18"
|
|
147
|
-
class="text-info-500"
|
|
148
|
-
/>
|
|
149
|
-
<Text>{$t`Size updated`}</Text>
|
|
150
|
-
{:else}
|
|
151
|
-
<Icon icon={mdiTimerOutline} size="18" color="secondary" />
|
|
152
|
-
<Text>{$t`Event`}</Text>
|
|
153
|
-
{/if}
|
|
154
|
-
</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()}
|
|
155
183
|
<Text
|
|
156
184
|
color="secondary"
|
|
157
185
|
size="small"
|
|
186
|
+
class="shrink-0"
|
|
158
187
|
title={isoDate(entry.createdAt)}
|
|
159
188
|
>
|
|
160
189
|
<RelativeTime time={entry.createdAt} />
|
|
161
190
|
</Text>
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
<HStack class="gap-2 flex-wrap pl-7">
|
|
165
|
-
{#if entry.backupDuration != null}
|
|
166
|
-
<Badge size="tiny" color="secondary">
|
|
167
|
-
{$t({
|
|
168
|
-
message: "Duration {duration}",
|
|
169
|
-
values: { duration: formatDuration(entry.backupDuration) },
|
|
170
|
-
})}
|
|
171
|
-
</Badge>
|
|
172
|
-
{/if}
|
|
173
|
-
{#if entry.sizeBytes != null}
|
|
174
|
-
<Badge size="tiny" color="secondary">
|
|
175
|
-
{$t({
|
|
176
|
-
message: "Size {size}",
|
|
177
|
-
values: { size: getByteUnitString(entry.sizeBytes) },
|
|
178
|
-
})}
|
|
179
|
-
</Badge>
|
|
180
|
-
{/if}
|
|
181
|
-
{#if entry.started}
|
|
182
|
-
<Badge size="tiny" color="secondary">
|
|
183
|
-
{$t({
|
|
184
|
-
message: "Started {date}",
|
|
185
|
-
values: { date: isoDate(entry.started) },
|
|
186
|
-
})}
|
|
187
|
-
</Badge>
|
|
188
|
-
{/if}
|
|
189
|
-
{#if entry.backup}
|
|
190
|
-
<Badge size="tiny" color="secondary">
|
|
191
|
-
{$t({
|
|
192
|
-
message: "Ended {date}",
|
|
193
|
-
values: { date: isoDate(entry.backup) },
|
|
194
|
-
})}
|
|
195
|
-
</Badge>
|
|
196
|
-
{/if}
|
|
197
|
-
</HStack>
|
|
198
|
-
</Stack>
|
|
191
|
+
{/snippet}
|
|
192
|
+
</StackListItem>
|
|
199
193
|
{/each}
|
|
200
|
-
</
|
|
194
|
+
</StackList>
|
|
201
195
|
|
|
202
196
|
{#if query.hasNextPage}
|
|
203
197
|
<div bind:this={sentinel} class="flex justify-center py-4">
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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>
|
|
207
214
|
</div>
|
|
208
215
|
{/if}
|
|
209
216
|
{/if}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { LocalRepositoryDto } from "../../fetch-client";
|
|
3
3
|
import { formatDuration } from "../../utils/format";
|
|
4
4
|
import { Card, CardBody } from "@immich/ui";
|
|
5
|
+
import { mdiHistory } from "@mdi/js";
|
|
5
6
|
import { t } from "svelte-i18n-lingui";
|
|
6
7
|
import VisualisationGauge from "../ui/VisualisationGauge.svelte";
|
|
7
8
|
|
|
@@ -29,6 +30,7 @@
|
|
|
29
30
|
<CardBody>
|
|
30
31
|
<VisualisationGauge
|
|
31
32
|
title={$t`Avg. Backup Time`}
|
|
33
|
+
icon={mdiHistory}
|
|
32
34
|
content={avgBackupTime != null ? formatDuration(avgBackupTime) : "—"}
|
|
33
35
|
/>
|
|
34
36
|
</CardBody>
|