@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
|
@@ -7,6 +7,7 @@ import { mdiCog, mdiDelete, mdiPause, mdiPlay } from '@mdi/js';
|
|
|
7
7
|
import { handleError } from '../utils/handle-error';
|
|
8
8
|
import { queryClient } from '../query-client';
|
|
9
9
|
import { createMutation, createQuery } from '@tanstack/svelte-query';
|
|
10
|
+
import { gt, msg } from 'svelte-i18n-lingui';
|
|
10
11
|
export const scheduleKeys = {
|
|
11
12
|
all: ['schedules'],
|
|
12
13
|
};
|
|
@@ -44,75 +45,75 @@ export const handleGetSchedules = async () => {
|
|
|
44
45
|
return await sdk.getSchedules();
|
|
45
46
|
}
|
|
46
47
|
catch (error) {
|
|
47
|
-
handleError(error,
|
|
48
|
+
handleError(error, gt `Failed to load schedules`);
|
|
48
49
|
throw error;
|
|
49
50
|
}
|
|
50
51
|
};
|
|
51
52
|
export const useCreateSchedule = () => createMutation(() => ({
|
|
52
53
|
mutationFn: (dto) => sdk.createSchedule(dto),
|
|
53
|
-
onError: (error) => handleError(error,
|
|
54
|
+
onError: (error) => handleError(error, gt `Failed to create schedule`),
|
|
54
55
|
}), () => queryClient);
|
|
55
56
|
export const useUpdateSchedule = () => createMutation(() => ({
|
|
56
57
|
mutationFn: ({ id, dto, }) => sdk.updateSchedule(id, dto),
|
|
57
|
-
onError: (error) => handleError(error,
|
|
58
|
+
onError: (error) => handleError(error, gt `Failed to update schedule`),
|
|
58
59
|
}), () => queryClient);
|
|
59
60
|
export const handlePauseSchedule = async (id, name) => {
|
|
60
61
|
try {
|
|
61
62
|
await sdk.updateSchedule(id, { paused: true });
|
|
62
|
-
toastManager.info(
|
|
63
|
+
toastManager.info(gt({ message: 'Paused schedule "{name}"', values: { name } }));
|
|
63
64
|
}
|
|
64
65
|
catch (error) {
|
|
65
|
-
handleError(error,
|
|
66
|
+
handleError(error, gt `Failed to pause schedule`);
|
|
66
67
|
throw error;
|
|
67
68
|
}
|
|
68
69
|
};
|
|
69
70
|
export const handleResumeSchedule = async (id, name) => {
|
|
70
71
|
try {
|
|
71
72
|
await sdk.updateSchedule(id, { paused: false });
|
|
72
|
-
toastManager.success(
|
|
73
|
+
toastManager.success(gt({ message: 'Resumed schedule "{name}"', values: { name } }));
|
|
73
74
|
}
|
|
74
75
|
catch (error) {
|
|
75
|
-
handleError(error,
|
|
76
|
+
handleError(error, gt `Failed to resume schedule`);
|
|
76
77
|
throw error;
|
|
77
78
|
}
|
|
78
79
|
};
|
|
79
80
|
export const handleRemoveSchedule = async (id, name) => {
|
|
80
81
|
try {
|
|
81
82
|
await sdk.removeSchedule(id);
|
|
82
|
-
toastManager.info(
|
|
83
|
+
toastManager.info(gt({ message: 'Deleted schedule "{name}"', values: { name } }));
|
|
83
84
|
}
|
|
84
85
|
catch (error) {
|
|
85
|
-
handleError(error,
|
|
86
|
+
handleError(error, gt `Failed to delete schedule`);
|
|
86
87
|
throw error;
|
|
87
88
|
}
|
|
88
89
|
};
|
|
89
|
-
export const getScheduleActions = (schedule) => {
|
|
90
|
+
export const getScheduleActions = (schedule, t) => {
|
|
90
91
|
const Resume = {
|
|
91
|
-
title:
|
|
92
|
+
title: t(msg `Resume`),
|
|
92
93
|
icon: mdiPlay,
|
|
93
94
|
onAction: () => void handleResumeSchedule(schedule.id, schedule.name),
|
|
94
95
|
$if: () => schedule.paused,
|
|
95
96
|
};
|
|
96
97
|
const Pause = {
|
|
97
|
-
title:
|
|
98
|
+
title: t(msg `Pause`),
|
|
98
99
|
icon: mdiPause,
|
|
99
100
|
onAction: () => void handlePauseSchedule(schedule.id, schedule.name),
|
|
100
101
|
$if: () => !schedule.paused,
|
|
101
102
|
};
|
|
102
103
|
const Configure = {
|
|
103
|
-
title:
|
|
104
|
+
title: t(msg `Configure`),
|
|
104
105
|
icon: mdiCog,
|
|
105
106
|
onAction: () => void modalManager.open(ConfigureScheduleModal, { schedule }),
|
|
106
107
|
};
|
|
107
108
|
const Delete = {
|
|
108
|
-
title:
|
|
109
|
+
title: t(msg `Delete`),
|
|
109
110
|
icon: mdiDelete,
|
|
110
111
|
color: 'danger',
|
|
111
112
|
onAction: async () => {
|
|
112
113
|
const confirm = await modalManager.showDialog({
|
|
113
|
-
confirmText:
|
|
114
|
-
title:
|
|
115
|
-
prompt:
|
|
114
|
+
confirmText: t(msg `Delete`),
|
|
115
|
+
title: t(msg `Delete Schedule`),
|
|
116
|
+
prompt: t(msg `This schedule will be removed.`),
|
|
116
117
|
});
|
|
117
118
|
if (!confirm) {
|
|
118
119
|
return;
|
|
@@ -3,6 +3,7 @@ import { getProvider } from '../providers';
|
|
|
3
3
|
import { queryClient } from '../query-client';
|
|
4
4
|
import { handleError } from '../utils/handle-error';
|
|
5
5
|
import { createMutation } from '@tanstack/svelte-query';
|
|
6
|
+
import { gt } from 'svelte-i18n-lingui';
|
|
6
7
|
export const startDeviceFlow = (kind, onEvent) => {
|
|
7
8
|
const source = new EventSource(`${getProvider().baseUrl}/api/yucca/auth/${kind}/device`, { withCredentials: true });
|
|
8
9
|
source.addEventListener('message', (event) => {
|
|
@@ -16,5 +17,5 @@ export const startDeviceFlow = (kind, onEvent) => {
|
|
|
16
17
|
};
|
|
17
18
|
export const useCreateSession = () => createMutation(() => ({
|
|
18
19
|
mutationFn: (token) => createSession({ token }),
|
|
19
|
-
onError: (error) => handleError(error,
|
|
20
|
+
onError: (error) => handleError(error, gt `Failed to log in`),
|
|
20
21
|
}), () => queryClient);
|
|
@@ -2,6 +2,7 @@ import { sdk } from '..';
|
|
|
2
2
|
import { SocketEvent } from '../events';
|
|
3
3
|
import { type RepositorySnapshotRestoreFromPointRequestDto, type RepositorySnapshotRestoreRequestDto, type RunDto, type SnapshotDto } from '../fetch-client';
|
|
4
4
|
import { type ActionItem } from '@immich/ui';
|
|
5
|
+
import { gt } from 'svelte-i18n-lingui';
|
|
5
6
|
export declare const snapshotKeys: {
|
|
6
7
|
byRepository: (id: string) => readonly ["snapshots", string];
|
|
7
8
|
};
|
|
@@ -24,7 +25,7 @@ export declare const handleRestoreFromPoint: (repositoryId: string, snapshotId:
|
|
|
24
25
|
export declare const handleForgetSnapshot: (repositoryId: string, snapshotId: string) => Promise<void>;
|
|
25
26
|
export declare const useRollbackSnapshot: () => import("@tanstack/svelte-query").CreateMutationResult<never, Error, sdk.ImmichRollbackRequestDto, unknown>;
|
|
26
27
|
export declare const handleGetSnapshotListing: (id: string, snapshotId: string, path?: string) => Promise<sdk.FilesystemListingResponseDto>;
|
|
27
|
-
export declare const getSnapshotActions: (repositoryId: string, snapshot: SnapshotDto, immich?: boolean) => {
|
|
28
|
+
export declare const getSnapshotActions: (repositoryId: string, snapshot: SnapshotDto, t: typeof gt, immich?: boolean) => {
|
|
28
29
|
Restore: ActionItem;
|
|
29
30
|
Rollback: ActionItem;
|
|
30
31
|
Delete: ActionItem;
|
|
@@ -8,6 +8,7 @@ import { handleError } from '../utils/handle-error';
|
|
|
8
8
|
import { modalManager, toastManager } from '@immich/ui';
|
|
9
9
|
import { mdiBackupRestore, mdiDeleteOutline, mdiHistory } from '@mdi/js';
|
|
10
10
|
import { createMutation, createQuery } from '@tanstack/svelte-query';
|
|
11
|
+
import { gt, msg } from 'svelte-i18n-lingui';
|
|
11
12
|
export const snapshotKeys = {
|
|
12
13
|
byRepository: (id) => ['snapshots', id],
|
|
13
14
|
};
|
|
@@ -38,29 +39,29 @@ export const handleGetSnapshots = async (repositoryId) => {
|
|
|
38
39
|
return await sdk.getSnapshots(repositoryId);
|
|
39
40
|
}
|
|
40
41
|
catch (error) {
|
|
41
|
-
handleError(error,
|
|
42
|
+
handleError(error, gt `Failed to load snapshots`);
|
|
42
43
|
throw error;
|
|
43
44
|
}
|
|
44
45
|
};
|
|
45
46
|
export const useRestoreSnapshot = () => createMutation(() => ({
|
|
46
47
|
mutationFn: ({ repositoryId, snapshotId, options, }) => sdk.restoreSnapshot(repositoryId, snapshotId, options),
|
|
47
|
-
onError: (error) => handleError(error,
|
|
48
|
+
onError: (error) => handleError(error, gt `Failed to start restore`),
|
|
48
49
|
}), () => queryClient);
|
|
49
50
|
export const handleRestoreFromPoint = async (repositoryId, snapshotId, backendId, options) => {
|
|
50
51
|
return await sdk.restoreFromPoint(repositoryId, snapshotId, backendId, options);
|
|
51
52
|
};
|
|
52
53
|
export const handleForgetSnapshot = async (repositoryId, snapshotId) => {
|
|
53
|
-
toastManager.info(
|
|
54
|
+
toastManager.info(gt `Deleting snapshot`, {
|
|
54
55
|
id: snapshotId,
|
|
55
56
|
closable: false,
|
|
56
57
|
timeout: null,
|
|
57
58
|
});
|
|
58
59
|
try {
|
|
59
60
|
await sdk.forgetSnapshot(repositoryId, snapshotId);
|
|
60
|
-
toastManager.success(
|
|
61
|
+
toastManager.success(gt `Deleted snapshot`);
|
|
61
62
|
}
|
|
62
63
|
catch (error) {
|
|
63
|
-
handleError(error,
|
|
64
|
+
handleError(error, gt `Failed to delete snapshot`);
|
|
64
65
|
throw error;
|
|
65
66
|
}
|
|
66
67
|
finally {
|
|
@@ -71,21 +72,21 @@ export const handleForgetSnapshot = async (repositoryId, snapshotId) => {
|
|
|
71
72
|
};
|
|
72
73
|
export const useRollbackSnapshot = () => createMutation(() => ({
|
|
73
74
|
mutationFn: (dto) => sdk.startImmichRollback(dto),
|
|
74
|
-
onError: (error) => handleError(error,
|
|
75
|
+
onError: (error) => handleError(error, gt `Failed to start rollback`),
|
|
75
76
|
}), () => queryClient);
|
|
76
77
|
export const handleGetSnapshotListing = async (id, snapshotId, path) => {
|
|
77
78
|
try {
|
|
78
79
|
return await sdk.getSnapshotListing(id, snapshotId, { path });
|
|
79
80
|
}
|
|
80
81
|
catch (error) {
|
|
81
|
-
handleError(error,
|
|
82
|
+
handleError(error, gt `Failed to load directory listing`);
|
|
82
83
|
throw error;
|
|
83
84
|
}
|
|
84
85
|
};
|
|
85
|
-
export const getSnapshotActions = (repositoryId, snapshot, immich) => {
|
|
86
|
+
export const getSnapshotActions = (repositoryId, snapshot, t, immich) => {
|
|
86
87
|
const removeSnapshot = useRemoveSnapshot(repositoryId);
|
|
87
88
|
const Restore = {
|
|
88
|
-
title:
|
|
89
|
+
title: t(msg `Restore files`),
|
|
89
90
|
icon: mdiBackupRestore,
|
|
90
91
|
onAction: () => void modalManager.open(RestoreSnapshotModal, {
|
|
91
92
|
repository: repositoryId,
|
|
@@ -93,7 +94,7 @@ export const getSnapshotActions = (repositoryId, snapshot, immich) => {
|
|
|
93
94
|
}),
|
|
94
95
|
};
|
|
95
96
|
const Rollback = {
|
|
96
|
-
title:
|
|
97
|
+
title: t(msg `Rollback snapshot`),
|
|
97
98
|
icon: mdiHistory,
|
|
98
99
|
onAction: () => void modalManager.open(RollbackSnapshotModal, {
|
|
99
100
|
repository: repositoryId,
|
|
@@ -102,14 +103,14 @@ export const getSnapshotActions = (repositoryId, snapshot, immich) => {
|
|
|
102
103
|
$if: () => immich === true,
|
|
103
104
|
};
|
|
104
105
|
const Delete = {
|
|
105
|
-
title:
|
|
106
|
+
title: t(msg `Delete`),
|
|
106
107
|
icon: mdiDeleteOutline,
|
|
107
108
|
color: 'danger',
|
|
108
109
|
onAction: async () => {
|
|
109
110
|
const confirm = await modalManager.showDialog({
|
|
110
|
-
confirmText:
|
|
111
|
-
title:
|
|
112
|
-
prompt:
|
|
111
|
+
confirmText: t(msg `Delete`),
|
|
112
|
+
title: t(msg `Delete Snapshot`),
|
|
113
|
+
prompt: t(msg `This snapshot will be permanently removed.`),
|
|
113
114
|
});
|
|
114
115
|
if (!confirm) {
|
|
115
116
|
return;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { sdk } from '..';
|
|
2
2
|
import { handleError } from '../utils/handle-error';
|
|
3
|
+
import { gt } from 'svelte-i18n-lingui';
|
|
3
4
|
export const handleGetRunningTasks = async () => {
|
|
4
5
|
try {
|
|
5
6
|
return await sdk.getRunningTasks();
|
|
6
7
|
}
|
|
7
8
|
catch (error) {
|
|
8
|
-
handleError(error,
|
|
9
|
+
handleError(error, gt `Failed to load running tasks`);
|
|
9
10
|
throw error;
|
|
10
11
|
}
|
|
11
12
|
};
|
|
@@ -14,7 +15,7 @@ export const handleCancelTask = async (parentId) => {
|
|
|
14
15
|
await sdk.cancelTask(parentId);
|
|
15
16
|
}
|
|
16
17
|
catch (error) {
|
|
17
|
-
handleError(error,
|
|
18
|
+
handleError(error, gt `Failed to cancel task`);
|
|
18
19
|
throw error;
|
|
19
20
|
}
|
|
20
21
|
};
|
package/dist/utils/format.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Duration } from 'luxon';
|
|
2
|
+
import { gt, msg } from 'svelte-i18n-lingui';
|
|
2
3
|
export const formatDuration = (ms, unitDisplay = 'narrow') => {
|
|
3
4
|
const seconds = Math.round(ms / 1000);
|
|
4
5
|
return seconds < 1
|
|
@@ -8,17 +9,18 @@ export const formatDuration = (ms, unitDisplay = 'narrow') => {
|
|
|
8
9
|
.toHuman({ unitDisplay });
|
|
9
10
|
};
|
|
10
11
|
const IMMICH_FOLDER_LABELS = {
|
|
11
|
-
upload:
|
|
12
|
-
profile:
|
|
13
|
-
library:
|
|
14
|
-
backups:
|
|
15
|
-
thumbs:
|
|
16
|
-
'encoded-video':
|
|
12
|
+
upload: msg `Photos and videos`,
|
|
13
|
+
profile: msg `Photos and videos`,
|
|
14
|
+
library: msg `Photos and videos`,
|
|
15
|
+
backups: msg `Database backups`,
|
|
16
|
+
thumbs: msg `Thumbnails and previews`,
|
|
17
|
+
'encoded-video': msg `Encoded videos`,
|
|
17
18
|
};
|
|
18
19
|
export const humanizeBackupPath = (path) => {
|
|
19
20
|
if (path.includes('yucca')) {
|
|
20
|
-
return
|
|
21
|
+
return gt `Backup configuration`;
|
|
21
22
|
}
|
|
22
23
|
const basename = path.replace(/\/+$/, '').split('/').pop() ?? path;
|
|
23
|
-
|
|
24
|
+
const label = IMMICH_FOLDER_LABELS[basename];
|
|
25
|
+
return label ? gt(label) : basename;
|
|
24
26
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { toastManager } from '@immich/ui';
|
|
2
|
+
import { gt } from 'svelte-i18n-lingui';
|
|
2
3
|
export function getServerErrorMessage(error) {
|
|
3
4
|
// errors for endpoints without return types aren't parsed as json
|
|
4
5
|
let data = error.data;
|
|
@@ -18,7 +19,7 @@ export function standardizeError(error) {
|
|
|
18
19
|
export function getReadableErrorMessage(error) {
|
|
19
20
|
return (getServerErrorMessage(error) ||
|
|
20
21
|
standardizeError(error).message ||
|
|
21
|
-
|
|
22
|
+
gt `An unknown error occurred`);
|
|
22
23
|
}
|
|
23
24
|
export function handleError(error, localizedMessage) {
|
|
24
25
|
const standardizedError = standardizeError(error);
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@futo-org/backups-orchestrator-ui",
|
|
3
3
|
"repository": "https://github.com/immich-app/yucca",
|
|
4
4
|
"description": "Backups orchestrator (UI library)",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.47.0",
|
|
6
6
|
"license": "Source First License 1.1",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
@@ -26,9 +26,13 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"
|
|
29
|
+
"@lingui/core": "^5.8.0",
|
|
30
|
+
"svelte": "^5.0.0",
|
|
31
|
+
"svelte-i18n-lingui": "^0.2.2"
|
|
30
32
|
},
|
|
31
33
|
"devDependencies": {
|
|
34
|
+
"@lingui/cli": "^5.8.0",
|
|
35
|
+
"@lingui/core": "^5.8.0",
|
|
32
36
|
"@playwright/test": "1.59.1",
|
|
33
37
|
"@sveltejs/adapter-auto": "^7.0.0",
|
|
34
38
|
"@sveltejs/kit": "^2.50.1",
|
|
@@ -45,6 +49,7 @@
|
|
|
45
49
|
"publint": "^0.3.17",
|
|
46
50
|
"svelte": "^5.48.2",
|
|
47
51
|
"svelte-check": "^4.3.5",
|
|
52
|
+
"svelte-i18n-lingui": "^0.2.2",
|
|
48
53
|
"tailwindcss": "^4.1.18",
|
|
49
54
|
"typescript": "^5.9.3",
|
|
50
55
|
"vite": "^7.3.1",
|
|
@@ -64,11 +69,11 @@
|
|
|
64
69
|
"lodash.debounce": "^4.0.8",
|
|
65
70
|
"luxon": "^3.7.2",
|
|
66
71
|
"socket.io-client": "^4.8.3",
|
|
67
|
-
"@futo-org/backups-api-client": "^0.
|
|
72
|
+
"@futo-org/backups-api-client": "^0.47.0"
|
|
68
73
|
},
|
|
69
74
|
"scripts": {
|
|
70
75
|
"dev": "vite dev --port 5174",
|
|
71
|
-
"build": "vite build && npm run prepack",
|
|
76
|
+
"build": "npm run lingui:compile && vite build && npm run prepack",
|
|
72
77
|
"preview": "vite preview --port 4174",
|
|
73
78
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
74
79
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
@@ -76,6 +81,8 @@
|
|
|
76
81
|
"test": "npm run test:unit && npm run test:e2e",
|
|
77
82
|
"test:e2e": "playwright test",
|
|
78
83
|
"test:e2e:create": "playwright codegen http://localhost:36066",
|
|
79
|
-
"generate:fetch-client": "oazapfts --optimistic ../orchestration-api/openapi-specs.json src/lib/fetch-client.ts"
|
|
84
|
+
"generate:fetch-client": "oazapfts --optimistic ../orchestration-api/openapi-specs.json src/lib/fetch-client.ts",
|
|
85
|
+
"lingui:extract": "lingui extract",
|
|
86
|
+
"lingui:compile": "lingui compile --typescript"
|
|
80
87
|
}
|
|
81
88
|
}
|