@futo-org/backups-orchestrator-ui 1.11.3 → 1.11.5
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/integrations/immich/ImmichBackupsPage.svelte +16 -3
- package/dist/components/integrations/immich/ImmichBackupsPage.svelte.d.ts +2 -0
- package/dist/components/integrations/immich/ImmichManageBackupPage.svelte +16 -4
- package/dist/components/integrations/immich/ImmichManageBackupPage.svelte.d.ts +9 -0
- package/dist/components/test/ImmichTestUi.svelte +7 -1
- package/dist/events.js +1 -1
- package/dist/fetch-client.d.ts +51 -51
- package/dist/fetch-client.js +101 -101
- package/dist/i18n.d.ts +1 -3
- package/dist/i18n.js +5 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/providers.d.ts +2 -1
- package/dist/providers.js +8 -2
- package/dist/services/backend.service.js +3 -3
- package/dist/services/config.service.js +3 -3
- package/dist/services/filesystem.service.js +1 -1
- package/dist/services/immich.integration.service.js +4 -4
- package/dist/services/integrations.service.js +5 -5
- package/dist/services/job.service.js +6 -6
- package/dist/services/onboarding.service.js +8 -8
- package/dist/services/repository.service.js +15 -13
- package/dist/services/schedule.service.js +8 -8
- package/dist/services/session.service.js +3 -3
- package/dist/services/snapshot.service.js +8 -8
- package/dist/services/supportMode.service.js +3 -3
- package/package.json +5 -7
|
@@ -3,7 +3,7 @@ import { handleError } from '../utils/handle-error';
|
|
|
3
3
|
import { gt } from 'svelte-i18n-lingui';
|
|
4
4
|
export const handleGetFileListing = async (path) => {
|
|
5
5
|
try {
|
|
6
|
-
return await sdk.
|
|
6
|
+
return await sdk.futoBackupsGetFileListing({ path });
|
|
7
7
|
}
|
|
8
8
|
catch (error) {
|
|
9
9
|
handleError(error, gt `Failed to load directory listing`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import BackupsRecoveryKeyModal from '../components/onboarding/dialogs/BackupsRecoveryKeyModal.svelte';
|
|
2
2
|
import { modalManager } from '@immich/ui';
|
|
3
3
|
import { mdiCloudUploadOutline, mdiCogOutline, mdiKeyOutline } from '@mdi/js';
|
|
4
|
-
import {
|
|
4
|
+
import { futoBackupsConfigureImmichDatabaseDump, futoBackupsGetImmichBackupStatus, futoBackupsIgnoreImmichDatabaseDumpWarning, } from '../fetch-client';
|
|
5
5
|
import { queryClient } from '../query-client';
|
|
6
6
|
import { handleError } from '../utils/handle-error';
|
|
7
7
|
import { getBackupOutcome } from '../utils/backup-status';
|
|
@@ -72,7 +72,7 @@ export const toImmichBackupStatus = (data, loading) => {
|
|
|
72
72
|
export const useImmichBackupStatus = () => {
|
|
73
73
|
const query = createQuery(() => ({
|
|
74
74
|
queryKey: immichBackupStatusKeys.all,
|
|
75
|
-
queryFn: () =>
|
|
75
|
+
queryFn: () => futoBackupsGetImmichBackupStatus(),
|
|
76
76
|
}), () => queryClient);
|
|
77
77
|
return {
|
|
78
78
|
get repository() {
|
|
@@ -94,7 +94,7 @@ export const useImmichBackupStatus = () => {
|
|
|
94
94
|
};
|
|
95
95
|
};
|
|
96
96
|
export const useConfigureImmichDatabaseDump = () => createMutation(() => ({
|
|
97
|
-
mutationFn: (dto) =>
|
|
97
|
+
mutationFn: (dto) => futoBackupsConfigureImmichDatabaseDump(dto),
|
|
98
98
|
onSuccess: (_, dto) => updateImmichBackupStatus((data) => ({
|
|
99
99
|
...data,
|
|
100
100
|
databaseDump: data.databaseDump && { ...data.databaseDump, ...dto },
|
|
@@ -102,7 +102,7 @@ export const useConfigureImmichDatabaseDump = () => createMutation(() => ({
|
|
|
102
102
|
onError: (error) => handleError(error, gt `Failed to update Immich database dump settings`),
|
|
103
103
|
}), () => queryClient);
|
|
104
104
|
export const useIgnoreImmichDatabaseDumpWarning = () => createMutation(() => ({
|
|
105
|
-
mutationFn: () =>
|
|
105
|
+
mutationFn: () => futoBackupsIgnoreImmichDatabaseDumpWarning(),
|
|
106
106
|
onSuccess: () => updateImmichBackupStatus((data) => ({
|
|
107
107
|
...data,
|
|
108
108
|
databaseDumpWarningIgnored: true,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SocketEvent } from '../events';
|
|
2
|
-
import {
|
|
2
|
+
import { futoBackupsConfigureImmichIntegration, futoBackupsGetIntegrations, } from '../fetch-client';
|
|
3
3
|
import { queryClient } from '../query-client';
|
|
4
4
|
import { handleError } from '../utils/handle-error';
|
|
5
5
|
import { createMutation, createQuery } from '@tanstack/svelte-query';
|
|
@@ -10,7 +10,7 @@ export const integrationsKeys = {
|
|
|
10
10
|
};
|
|
11
11
|
export const useIntegrations = () => createQuery(() => ({
|
|
12
12
|
queryKey: integrationsKeys.all,
|
|
13
|
-
queryFn: () =>
|
|
13
|
+
queryFn: () => futoBackupsGetIntegrations(),
|
|
14
14
|
}), () => queryClient);
|
|
15
15
|
export const useIntegrationEventHandler = () => ({
|
|
16
16
|
onIntegrationUpdate(event) {
|
|
@@ -18,16 +18,16 @@ export const useIntegrationEventHandler = () => ({
|
|
|
18
18
|
},
|
|
19
19
|
});
|
|
20
20
|
export const useConfigureImmichIntegration = () => createMutation(() => ({
|
|
21
|
-
mutationFn: (dto) =>
|
|
21
|
+
mutationFn: (dto) => futoBackupsConfigureImmichIntegration(dto),
|
|
22
22
|
onError: (error) => handleError(error, gt `Failed to save backup settings`),
|
|
23
23
|
}), () => queryClient);
|
|
24
24
|
export const useConfigureAndStartImmichIntegration = () => createMutation(() => ({
|
|
25
25
|
mutationFn: async () => {
|
|
26
|
-
const { immichState } = await
|
|
26
|
+
const { immichState } = await futoBackupsGetIntegrations();
|
|
27
27
|
if (!immichState) {
|
|
28
28
|
throw new Error(gt `No Immich instance detected.`);
|
|
29
29
|
}
|
|
30
|
-
const { repositoryId } = await
|
|
30
|
+
const { repositoryId } = await futoBackupsConfigureImmichIntegration({
|
|
31
31
|
name: 'Immich',
|
|
32
32
|
worm: false,
|
|
33
33
|
cron: IMMICH_DEFAULT_CRON,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import CancelJobModal from '../components/backups/dialogs/CancelJobModal.svelte';
|
|
2
2
|
import ViewStatusModal from '../components/backups/dialogs/ViewStatusModal.svelte';
|
|
3
3
|
import { SocketEvent } from '../events';
|
|
4
|
-
import {
|
|
4
|
+
import { futoBackupsCancelJob, futoBackupsGetJob, futoBackupsGetJobs, } from '../fetch-client';
|
|
5
5
|
import { getProvider } from '../providers';
|
|
6
6
|
import { queryClient } from '../query-client';
|
|
7
7
|
import { formatDuration } from '../utils/format';
|
|
@@ -50,13 +50,13 @@ export const getRemainingText = (progress, now) => {
|
|
|
50
50
|
};
|
|
51
51
|
export const useJobs = (repositoryId, name) => createQuery(() => ({
|
|
52
52
|
queryKey: jobKeys.byRepository(repositoryId() ?? ''),
|
|
53
|
-
queryFn: () =>
|
|
53
|
+
queryFn: () => futoBackupsGetJobs(repositoryId()).then(({ jobs }) => jobs),
|
|
54
54
|
select: (jobs) => name ? jobs.filter((job) => job.name === name) : jobs,
|
|
55
55
|
enabled: repositoryId() !== undefined,
|
|
56
56
|
}), () => queryClient);
|
|
57
57
|
export const useJob = (jobId) => createQuery(() => ({
|
|
58
58
|
queryKey: jobKeys.byId(jobId),
|
|
59
|
-
queryFn: () =>
|
|
59
|
+
queryFn: () => futoBackupsGetJob(jobId),
|
|
60
60
|
}), () => queryClient);
|
|
61
61
|
export const useJobEventHandler = () => {
|
|
62
62
|
return {
|
|
@@ -133,7 +133,7 @@ export const handleCancelJob = async (jobId, type) => {
|
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
135
135
|
try {
|
|
136
|
-
await
|
|
136
|
+
await futoBackupsCancelJob(jobId);
|
|
137
137
|
}
|
|
138
138
|
catch (error) {
|
|
139
139
|
handleError(error, gt `Failed to cancel task`);
|
|
@@ -148,11 +148,11 @@ export const getJobActions = (job, t) => {
|
|
|
148
148
|
};
|
|
149
149
|
const DownloadLog = {
|
|
150
150
|
title: t(msg `Download Full Log`),
|
|
151
|
-
onAction: () => window.open(`${getProvider().baseUrl}/api/
|
|
151
|
+
onAction: () => window.open(`${getProvider().baseUrl}/api/futo-backups/jobs/${job.id}/download`, '_blank'),
|
|
152
152
|
};
|
|
153
153
|
const DownloadSupportLog = {
|
|
154
154
|
title: t(msg `Download Support Log`),
|
|
155
|
-
onAction: () => window.open(`${getProvider().baseUrl}/api/
|
|
155
|
+
onAction: () => window.open(`${getProvider().baseUrl}/api/futo-backups/jobs/${job.id}/support-log/download`, '_blank'),
|
|
156
156
|
$if: () => Boolean(job.outcome?.support),
|
|
157
157
|
};
|
|
158
158
|
return { ViewLog, DownloadLog, DownloadSupportLog };
|
|
@@ -8,11 +8,11 @@ export const recoveryKeyKeys = {
|
|
|
8
8
|
};
|
|
9
9
|
export const useRecoveryKey = () => createQuery(() => ({
|
|
10
10
|
queryKey: recoveryKeyKeys.all,
|
|
11
|
-
queryFn: () => sdk.
|
|
11
|
+
queryFn: () => sdk.futoBackupsCurrentRecoveryKey(),
|
|
12
12
|
}), () => queryClient);
|
|
13
13
|
export const handleOnboardingStatus = async () => {
|
|
14
14
|
try {
|
|
15
|
-
return await sdk.
|
|
15
|
+
return await sdk.futoBackupsOnboardingStatus();
|
|
16
16
|
}
|
|
17
17
|
catch (error) {
|
|
18
18
|
handleError(error, gt `Failed to load onboarding status`);
|
|
@@ -21,7 +21,7 @@ export const handleOnboardingStatus = async () => {
|
|
|
21
21
|
};
|
|
22
22
|
export const handleCurrentRecoveryKey = async () => {
|
|
23
23
|
try {
|
|
24
|
-
return await sdk.
|
|
24
|
+
return await sdk.futoBackupsCurrentRecoveryKey();
|
|
25
25
|
}
|
|
26
26
|
catch (error) {
|
|
27
27
|
handleError(error, gt `Failed to load recovery key`);
|
|
@@ -30,7 +30,7 @@ export const handleCurrentRecoveryKey = async () => {
|
|
|
30
30
|
};
|
|
31
31
|
export const handleConfirmRecoveryKey = async () => {
|
|
32
32
|
try {
|
|
33
|
-
await sdk.
|
|
33
|
+
await sdk.futoBackupsConfirmRecoveryKey();
|
|
34
34
|
}
|
|
35
35
|
catch (error) {
|
|
36
36
|
handleError(error, gt `Failed to confirm recovery key`);
|
|
@@ -39,7 +39,7 @@ export const handleConfirmRecoveryKey = async () => {
|
|
|
39
39
|
};
|
|
40
40
|
export const handleImportRecoveryKey = async (dto) => {
|
|
41
41
|
try {
|
|
42
|
-
await sdk.
|
|
42
|
+
await sdk.futoBackupsImportRecoveryKey(dto);
|
|
43
43
|
}
|
|
44
44
|
catch (error) {
|
|
45
45
|
handleError(error, gt `Failed to import recovery key`);
|
|
@@ -48,7 +48,7 @@ export const handleImportRecoveryKey = async (dto) => {
|
|
|
48
48
|
};
|
|
49
49
|
export const handleSkipOnboardingExtraConfig = async () => {
|
|
50
50
|
try {
|
|
51
|
-
await sdk.
|
|
51
|
+
await sdk.futoBackupsSkipOnboardingExtraConfig();
|
|
52
52
|
}
|
|
53
53
|
catch (error) {
|
|
54
54
|
handleError(error, gt `Failed to save preferences`);
|
|
@@ -56,10 +56,10 @@ export const handleSkipOnboardingExtraConfig = async () => {
|
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
export const useEnableTelemetry = () => createMutation(() => ({
|
|
59
|
-
mutationFn: () => sdk.
|
|
59
|
+
mutationFn: () => sdk.futoBackupsEnableTelemetry(),
|
|
60
60
|
onError: (error) => handleError(error, gt `Failed to save preferences`),
|
|
61
61
|
}), () => queryClient);
|
|
62
62
|
export const useReportError = () => createMutation(() => ({
|
|
63
|
-
mutationFn: () => sdk.
|
|
63
|
+
mutationFn: () => sdk.futoBackupsReportError(),
|
|
64
64
|
onError: (error) => handleError(error, gt `Failed to report error`),
|
|
65
65
|
}), () => queryClient);
|
|
@@ -7,7 +7,7 @@ import MetricsHistoryModal from '../components/backups/metrics-history/MetricsHi
|
|
|
7
7
|
import RunHistoryModal from '../components/backups/run-history/RunHistoryModal.svelte';
|
|
8
8
|
import SnapshotsListModal from '../components/backups/snapshots-list/SnapshotsListModal.svelte';
|
|
9
9
|
import { SocketEvent } from '../events';
|
|
10
|
-
import {
|
|
10
|
+
import { futoBackupsInspectRepositories, futoBackupsReconfigureRepositoryPrimaryBackend, futoBackupsUpdateRepository, } from '../fetch-client';
|
|
11
11
|
import { getProvider } from '../providers';
|
|
12
12
|
import { queryClient } from '../query-client';
|
|
13
13
|
import { snapshotKeys } from './snapshot.service';
|
|
@@ -31,7 +31,7 @@ export const useRepositories = (initialData) => createQuery(() => ({
|
|
|
31
31
|
}), () => queryClient);
|
|
32
32
|
export const useInspectRepositories = (backendId, initialData) => createQuery(() => ({
|
|
33
33
|
queryKey: repositoryKeys.inspect(backendId),
|
|
34
|
-
queryFn: () =>
|
|
34
|
+
queryFn: () => futoBackupsInspectRepositories({ backend: backendId }).then(({ repositories }) => repositories),
|
|
35
35
|
initialData,
|
|
36
36
|
}), () => queryClient);
|
|
37
37
|
export const useRepositoryEventHandler = () => {
|
|
@@ -62,22 +62,24 @@ export const useRepositoryEventHandler = () => {
|
|
|
62
62
|
};
|
|
63
63
|
export const useCheckImportRepository = (id, backendId) => createQuery(() => ({
|
|
64
64
|
queryKey: repositoryKeys.checkImport(id, backendId),
|
|
65
|
-
queryFn: () => sdk.
|
|
65
|
+
queryFn: () => sdk.futoBackupsCheckImportRepository(id, backendId),
|
|
66
66
|
}), () => queryClient);
|
|
67
67
|
export const useCreateRepository = () => createMutation(() => ({
|
|
68
|
-
mutationFn: (dto) => sdk.
|
|
68
|
+
mutationFn: (dto) => sdk.futoBackupsCreateRepository(dto),
|
|
69
69
|
onError: (error) => handleError(error, gt `Failed to create repository`),
|
|
70
70
|
}), () => queryClient);
|
|
71
71
|
export const useImportRepository = () => createMutation(() => ({
|
|
72
|
-
mutationFn: ({ id, backendId }) => sdk.
|
|
72
|
+
mutationFn: ({ id, backendId }) => sdk.futoBackupsImportRepository(id, backendId),
|
|
73
73
|
onError: (error) => handleError(error, gt `Failed to import repository`),
|
|
74
74
|
}), () => queryClient);
|
|
75
75
|
export const useUpdateRepository = () => createMutation(() => ({
|
|
76
|
-
mutationFn: ({ id, dto, local = false, }) =>
|
|
76
|
+
mutationFn: ({ id, dto, local = false, }) => local
|
|
77
|
+
? sdk.futoBackupsUpdateRepository(id, dto)
|
|
78
|
+
: futoBackupsUpdateRepository(id, dto),
|
|
77
79
|
onError: (error) => handleError(error, gt `Failed to update repository`),
|
|
78
80
|
}), () => queryClient);
|
|
79
81
|
export const useReconfigureRepositoryPrimaryBackend = () => createMutation(() => ({
|
|
80
|
-
mutationFn: ({ id, backendId }) =>
|
|
82
|
+
mutationFn: ({ id, backendId }) => futoBackupsReconfigureRepositoryPrimaryBackend(id, { backendId }),
|
|
81
83
|
onSuccess: (_, { id }) => queryClient.invalidateQueries({
|
|
82
84
|
queryKey: snapshotKeys.byRepository(id),
|
|
83
85
|
}),
|
|
@@ -86,7 +88,7 @@ export const useReconfigureRepositoryPrimaryBackend = () => createMutation(() =>
|
|
|
86
88
|
export const handleCreateBackup = async (id) => {
|
|
87
89
|
try {
|
|
88
90
|
toastManager.info(gt `Started backup`);
|
|
89
|
-
const response = await sdk.
|
|
91
|
+
const response = await sdk.futoBackupsCreateBackup(id);
|
|
90
92
|
void modalManager.open(ViewStatusModal, {
|
|
91
93
|
jobId: response.jobId,
|
|
92
94
|
onRetry: () => void handleCreateBackup(id),
|
|
@@ -101,7 +103,7 @@ export const handleCreateBackup = async (id) => {
|
|
|
101
103
|
export const handlePruneRepository = async (id) => {
|
|
102
104
|
try {
|
|
103
105
|
toastManager.info(gt `Cleaning up old backups`);
|
|
104
|
-
const response = await sdk.
|
|
106
|
+
const response = await sdk.futoBackupsPruneRepository(id);
|
|
105
107
|
void modalManager.open(ViewStatusModal, {
|
|
106
108
|
jobId: response.jobId,
|
|
107
109
|
onRetry: () => void handlePruneRepository(id),
|
|
@@ -121,7 +123,7 @@ const syncRemoteDeletion = (repositoryId) => {
|
|
|
121
123
|
clearTimeout(timeout);
|
|
122
124
|
};
|
|
123
125
|
const onFocus = () => void sdk
|
|
124
|
-
.
|
|
126
|
+
.futoBackupsSyncRepositoryDeletion(repositoryId)
|
|
125
127
|
.then(({ deleted }) => deleted && stop())
|
|
126
128
|
.catch(stop);
|
|
127
129
|
const timeout = setTimeout(stop, REMOTE_DELETION_SYNC_TIMEOUT_MS);
|
|
@@ -133,7 +135,7 @@ const handleRemoveDeletedRepository = async (repositoryId) => {
|
|
|
133
135
|
return;
|
|
134
136
|
}
|
|
135
137
|
try {
|
|
136
|
-
await sdk.
|
|
138
|
+
await sdk.futoBackupsDeleteRepository(repositoryId);
|
|
137
139
|
}
|
|
138
140
|
catch (error) {
|
|
139
141
|
handleError(error, gt `Failed to remove repository`);
|
|
@@ -142,7 +144,7 @@ const handleRemoveDeletedRepository = async (repositoryId) => {
|
|
|
142
144
|
};
|
|
143
145
|
export const handleDeleteRepository = async (repositoryId, local) => {
|
|
144
146
|
try {
|
|
145
|
-
const action = local ? sdk.
|
|
147
|
+
const action = local ? sdk.futoBackupsCreateTicket : createTicket;
|
|
146
148
|
const { redirectTo } = await action({
|
|
147
149
|
action: 'repository.delete',
|
|
148
150
|
repositoryId,
|
|
@@ -163,7 +165,7 @@ export const handleDeleteRepository = async (repositoryId, local) => {
|
|
|
163
165
|
};
|
|
164
166
|
export const handleDisableWormRepository = async (repositoryId, local) => {
|
|
165
167
|
try {
|
|
166
|
-
const action = local ? sdk.
|
|
168
|
+
const action = local ? sdk.futoBackupsCreateTicket : createTicket;
|
|
167
169
|
const { redirectTo } = await action({
|
|
168
170
|
action: 'repository.disable-worm',
|
|
169
171
|
repositoryId,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { sdk } from '..';
|
|
2
2
|
import ConfigureScheduleModal from '../components/schedules/dialogs/ConfigureScheduleModal.svelte';
|
|
3
|
-
import {
|
|
3
|
+
import { futoBackupsGetSchedules, } from '../fetch-client';
|
|
4
4
|
import { SocketEvent } from '../events';
|
|
5
5
|
import { modalManager, toastManager } from '@immich/ui';
|
|
6
6
|
import { mdiCog, mdiDelete, mdiPause, mdiPlay } from '@mdi/js';
|
|
@@ -13,7 +13,7 @@ export const scheduleKeys = {
|
|
|
13
13
|
};
|
|
14
14
|
export const useSchedules = () => createQuery(() => ({
|
|
15
15
|
queryKey: scheduleKeys.all,
|
|
16
|
-
queryFn: () =>
|
|
16
|
+
queryFn: () => futoBackupsGetSchedules().then(({ schedules }) => schedules),
|
|
17
17
|
}), () => queryClient);
|
|
18
18
|
export const useScheduleEventHandler = () => {
|
|
19
19
|
return {
|
|
@@ -42,7 +42,7 @@ export const useScheduleEventHandler = () => {
|
|
|
42
42
|
};
|
|
43
43
|
export const handleGetSchedules = async () => {
|
|
44
44
|
try {
|
|
45
|
-
return await sdk.
|
|
45
|
+
return await sdk.futoBackupsGetSchedules();
|
|
46
46
|
}
|
|
47
47
|
catch (error) {
|
|
48
48
|
handleError(error, gt `Failed to load schedules`);
|
|
@@ -50,16 +50,16 @@ export const handleGetSchedules = async () => {
|
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
export const useCreateSchedule = () => createMutation(() => ({
|
|
53
|
-
mutationFn: (dto) => sdk.
|
|
53
|
+
mutationFn: (dto) => sdk.futoBackupsCreateSchedule(dto),
|
|
54
54
|
onError: (error) => handleError(error, gt `Failed to create schedule`),
|
|
55
55
|
}), () => queryClient);
|
|
56
56
|
export const useUpdateSchedule = () => createMutation(() => ({
|
|
57
|
-
mutationFn: ({ id, dto, }) => sdk.
|
|
57
|
+
mutationFn: ({ id, dto, }) => sdk.futoBackupsUpdateSchedule(id, dto),
|
|
58
58
|
onError: (error) => handleError(error, gt `Failed to update schedule`),
|
|
59
59
|
}), () => queryClient);
|
|
60
60
|
export const handlePauseSchedule = async (id, name) => {
|
|
61
61
|
try {
|
|
62
|
-
await sdk.
|
|
62
|
+
await sdk.futoBackupsUpdateSchedule(id, { paused: true });
|
|
63
63
|
toastManager.info(gt({ message: 'Paused schedule "{name}"', values: { name } }));
|
|
64
64
|
}
|
|
65
65
|
catch (error) {
|
|
@@ -69,7 +69,7 @@ export const handlePauseSchedule = async (id, name) => {
|
|
|
69
69
|
};
|
|
70
70
|
export const handleResumeSchedule = async (id, name) => {
|
|
71
71
|
try {
|
|
72
|
-
await sdk.
|
|
72
|
+
await sdk.futoBackupsUpdateSchedule(id, { paused: false });
|
|
73
73
|
toastManager.success(gt({ message: 'Resumed schedule "{name}"', values: { name } }));
|
|
74
74
|
}
|
|
75
75
|
catch (error) {
|
|
@@ -79,7 +79,7 @@ export const handleResumeSchedule = async (id, name) => {
|
|
|
79
79
|
};
|
|
80
80
|
export const handleRemoveSchedule = async (id, name) => {
|
|
81
81
|
try {
|
|
82
|
-
await sdk.
|
|
82
|
+
await sdk.futoBackupsRemoveSchedule(id);
|
|
83
83
|
toastManager.info(gt({ message: 'Deleted schedule "{name}"', values: { name } }));
|
|
84
84
|
}
|
|
85
85
|
catch (error) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { futoBackupsCreateSession, } from '../fetch-client';
|
|
2
2
|
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
6
|
import { gt } from 'svelte-i18n-lingui';
|
|
7
7
|
export const startDeviceFlow = (kind, onEvent) => {
|
|
8
|
-
const source = new EventSource(`${getProvider().baseUrl}/api/
|
|
8
|
+
const source = new EventSource(`${getProvider().baseUrl}/api/futo-backups/auth/${kind}/device`, { withCredentials: true });
|
|
9
9
|
source.addEventListener('message', (event) => {
|
|
10
10
|
onEvent(JSON.parse(event.data));
|
|
11
11
|
});
|
|
@@ -16,6 +16,6 @@ export const startDeviceFlow = (kind, onEvent) => {
|
|
|
16
16
|
return () => source.close();
|
|
17
17
|
};
|
|
18
18
|
export const useCreateSession = () => createMutation(() => ({
|
|
19
|
-
mutationFn: (token) =>
|
|
19
|
+
mutationFn: (token) => futoBackupsCreateSession({ token }),
|
|
20
20
|
onError: (error) => handleError(error, gt `Failed to log in`),
|
|
21
21
|
}), () => queryClient);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { sdk } from '..';
|
|
2
2
|
import RestoreSnapshotModal from '../components/backups/dialogs/RestoreSnapshotModal.svelte';
|
|
3
3
|
import RollbackSnapshotModal from '../components/backups/dialogs/RollbackSnapshotModal.svelte';
|
|
4
|
-
import {
|
|
4
|
+
import { futoBackupsGetSnapshots, } from '../fetch-client';
|
|
5
5
|
import { queryClient } from '../query-client';
|
|
6
6
|
import { handleError } from '../utils/handle-error';
|
|
7
7
|
import { modalManager, toastManager } from '@immich/ui';
|
|
@@ -13,7 +13,7 @@ export const snapshotKeys = {
|
|
|
13
13
|
};
|
|
14
14
|
export const useSnapshots = (repositoryId) => createQuery(() => ({
|
|
15
15
|
queryKey: snapshotKeys.byRepository(repositoryId),
|
|
16
|
-
queryFn: () =>
|
|
16
|
+
queryFn: () => futoBackupsGetSnapshots(repositoryId).then(({ snapshots }) => snapshots.toSorted((a, b) => b.time.localeCompare(a.time))),
|
|
17
17
|
}), () => queryClient);
|
|
18
18
|
export const useSnapshotEventHandler = () => {
|
|
19
19
|
return {
|
|
@@ -35,7 +35,7 @@ export const useRemoveSnapshot = (repositoryId) => {
|
|
|
35
35
|
};
|
|
36
36
|
export const handleGetSnapshots = async (repositoryId) => {
|
|
37
37
|
try {
|
|
38
|
-
return await sdk.
|
|
38
|
+
return await sdk.futoBackupsGetSnapshots(repositoryId);
|
|
39
39
|
}
|
|
40
40
|
catch (error) {
|
|
41
41
|
handleError(error, gt `Failed to load snapshots`);
|
|
@@ -43,11 +43,11 @@ export const handleGetSnapshots = async (repositoryId) => {
|
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
export const useRestoreSnapshot = () => createMutation(() => ({
|
|
46
|
-
mutationFn: ({ repositoryId, snapshotId, options, }) => sdk.
|
|
46
|
+
mutationFn: ({ repositoryId, snapshotId, options, }) => sdk.futoBackupsRestoreSnapshot(repositoryId, snapshotId, options),
|
|
47
47
|
onError: (error) => handleError(error, gt `Failed to start restore`),
|
|
48
48
|
}), () => queryClient);
|
|
49
49
|
export const handleRestoreFromPoint = async (repositoryId, snapshotId, backendId, options) => {
|
|
50
|
-
return await sdk.
|
|
50
|
+
return await sdk.futoBackupsRestoreFromPoint(repositoryId, snapshotId, backendId, options);
|
|
51
51
|
};
|
|
52
52
|
export const handleForgetSnapshot = async (repositoryId, snapshotId) => {
|
|
53
53
|
toastManager.info(gt `Deleting snapshot`, {
|
|
@@ -56,7 +56,7 @@ export const handleForgetSnapshot = async (repositoryId, snapshotId) => {
|
|
|
56
56
|
timeout: null,
|
|
57
57
|
});
|
|
58
58
|
try {
|
|
59
|
-
await sdk.
|
|
59
|
+
await sdk.futoBackupsForgetSnapshot(repositoryId, snapshotId);
|
|
60
60
|
toastManager.success(gt `Deleted snapshot`);
|
|
61
61
|
}
|
|
62
62
|
catch (error) {
|
|
@@ -70,12 +70,12 @@ export const handleForgetSnapshot = async (repositoryId, snapshotId) => {
|
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
72
|
export const useRollbackSnapshot = () => createMutation(() => ({
|
|
73
|
-
mutationFn: (dto) => sdk.
|
|
73
|
+
mutationFn: (dto) => sdk.futoBackupsStartImmichRollback(dto),
|
|
74
74
|
onError: (error) => handleError(error, gt `Failed to start rollback`),
|
|
75
75
|
}), () => queryClient);
|
|
76
76
|
export const handleGetSnapshotListing = async (id, snapshotId, path) => {
|
|
77
77
|
try {
|
|
78
|
-
return await sdk.
|
|
78
|
+
return await sdk.futoBackupsGetSnapshotListing(id, snapshotId, { path });
|
|
79
79
|
}
|
|
80
80
|
catch (error) {
|
|
81
81
|
handleError(error, gt `Failed to load directory listing`);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { futoBackupsGetSupportMode, futoBackupsUpdateSupportMode, } from '../fetch-client';
|
|
2
2
|
import { queryClient } from '../query-client';
|
|
3
3
|
import { handleError } from '../utils/handle-error';
|
|
4
4
|
import { createMutation, createQuery } from '@tanstack/svelte-query';
|
|
@@ -9,11 +9,11 @@ export const supportModeKeys = {
|
|
|
9
9
|
export const maxSupportModeRuns = 20;
|
|
10
10
|
export const useSupportMode = () => createQuery(() => ({
|
|
11
11
|
queryKey: supportModeKeys.all,
|
|
12
|
-
queryFn: () =>
|
|
12
|
+
queryFn: () => futoBackupsGetSupportMode(),
|
|
13
13
|
}), () => queryClient);
|
|
14
14
|
export const refreshSupportMode = () => void queryClient.invalidateQueries({ queryKey: supportModeKeys.all });
|
|
15
15
|
export const useUpdateSupportMode = () => createMutation(() => ({
|
|
16
|
-
mutationFn: (dto) =>
|
|
16
|
+
mutationFn: (dto) => futoBackupsUpdateSupportMode(dto),
|
|
17
17
|
onSuccess: (supportMode) => queryClient.setQueryData(supportModeKeys.all, supportMode),
|
|
18
18
|
onError: (error) => handleError(error, gt `Failed to save support mode`),
|
|
19
19
|
}), () => queryClient);
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@futo-org/backups-orchestrator-ui",
|
|
3
3
|
"repository": "https://github.com/futo-org/backups",
|
|
4
4
|
"description": "Backups orchestrator (UI library)",
|
|
5
|
-
"version": "1.11.
|
|
5
|
+
"version": "1.11.5",
|
|
6
6
|
"license": "Source First License 1.1",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
@@ -27,14 +27,11 @@
|
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@immich/ui": "^0.90.0",
|
|
30
|
-
"
|
|
31
|
-
"svelte": "^5.0.0",
|
|
32
|
-
"svelte-i18n-lingui": "^0.2.2"
|
|
30
|
+
"svelte": "^5.0.0"
|
|
33
31
|
},
|
|
34
32
|
"devDependencies": {
|
|
35
33
|
"@immich/ui": "^0.90.0",
|
|
36
34
|
"@lingui/cli": "^5.8.0",
|
|
37
|
-
"@lingui/core": "^5.8.0",
|
|
38
35
|
"@playwright/test": "1.63.0",
|
|
39
36
|
"@sveltejs/adapter-auto": "^7.0.1",
|
|
40
37
|
"@sveltejs/kit": "^2.70.3",
|
|
@@ -51,7 +48,6 @@
|
|
|
51
48
|
"publint": "^0.3.25",
|
|
52
49
|
"svelte": "^5.57.1",
|
|
53
50
|
"svelte-check": "^4.7.6",
|
|
54
|
-
"svelte-i18n-lingui": "^0.2.2",
|
|
55
51
|
"tailwindcss": "^4.1.18",
|
|
56
52
|
"typescript": "~6.0.3",
|
|
57
53
|
"vite": "^8.3.2",
|
|
@@ -62,6 +58,7 @@
|
|
|
62
58
|
"svelte"
|
|
63
59
|
],
|
|
64
60
|
"dependencies": {
|
|
61
|
+
"@lingui/core": "^5.8.0",
|
|
65
62
|
"@material-symbols/svg-400": "^0.48.1",
|
|
66
63
|
"@mdi/js": "^7.4.47",
|
|
67
64
|
"@oazapfts/runtime": "^1.2.0",
|
|
@@ -71,7 +68,8 @@
|
|
|
71
68
|
"lodash.debounce": "^4.0.8",
|
|
72
69
|
"luxon": "^3.7.2",
|
|
73
70
|
"socket.io-client": "^4.8.3",
|
|
74
|
-
"
|
|
71
|
+
"svelte-i18n-lingui": "^0.2.2",
|
|
72
|
+
"@futo-org/backups-api-client": "^1.11.5"
|
|
75
73
|
},
|
|
76
74
|
"scripts": {
|
|
77
75
|
"dev": "vite dev --port 5174",
|