diff --git a/app/client/api-client/@tanstack/react-query.gen.ts b/app/client/api-client/@tanstack/react-query.gen.ts index c1269a29..686355de 100644 --- a/app/client/api-client/@tanstack/react-query.gen.ts +++ b/app/client/api-client/@tanstack/react-query.gen.ts @@ -1288,7 +1288,7 @@ export const getMirrorCompatibilityOptions = (options: Options>, diff --git a/app/client/api-client/sdk.gen.ts b/app/client/api-client/sdk.gen.ts index 73460b6e..0c028616 100644 --- a/app/client/api-client/sdk.gen.ts +++ b/app/client/api-client/sdk.gen.ts @@ -210,7 +210,7 @@ export const testConnection = ( */ export const deleteVolume = (options: Options) => (options.client ?? client).delete({ - url: "/api/v1/volumes/{id}", + url: "/api/v1/volumes/{shortId}", ...options, }); @@ -219,7 +219,7 @@ export const deleteVolume = (options: Opti */ export const getVolume = (options: Options) => (options.client ?? client).get({ - url: "/api/v1/volumes/{id}", + url: "/api/v1/volumes/{shortId}", ...options, }); @@ -228,7 +228,7 @@ export const getVolume = (options: Options */ export const updateVolume = (options: Options) => (options.client ?? client).put({ - url: "/api/v1/volumes/{id}", + url: "/api/v1/volumes/{shortId}", ...options, headers: { "Content-Type": "application/json", @@ -241,7 +241,7 @@ export const updateVolume = (options: Opti */ export const mountVolume = (options: Options) => (options.client ?? client).post({ - url: "/api/v1/volumes/{id}/mount", + url: "/api/v1/volumes/{shortId}/mount", ...options, }); @@ -252,7 +252,7 @@ export const unmountVolume = ( options: Options, ) => (options.client ?? client).post({ - url: "/api/v1/volumes/{id}/unmount", + url: "/api/v1/volumes/{shortId}/unmount", ...options, }); @@ -263,7 +263,7 @@ export const healthCheckVolume = ( options: Options, ) => (options.client ?? client).post({ - url: "/api/v1/volumes/{id}/health-check", + url: "/api/v1/volumes/{shortId}/health-check", ...options, }); @@ -272,7 +272,7 @@ export const healthCheckVolume = ( */ export const listFiles = (options: Options) => (options.client ?? client).get({ - url: "/api/v1/volumes/{id}/files", + url: "/api/v1/volumes/{shortId}/files", ...options, }); @@ -331,7 +331,7 @@ export const deleteRepository = ( options: Options, ) => (options.client ?? client).delete({ - url: "/api/v1/repositories/{id}", + url: "/api/v1/repositories/{shortId}", ...options, }); @@ -342,7 +342,7 @@ export const getRepository = ( options: Options, ) => (options.client ?? client).get({ - url: "/api/v1/repositories/{id}", + url: "/api/v1/repositories/{shortId}", ...options, }); @@ -353,7 +353,7 @@ export const updateRepository = ( options: Options, ) => (options.client ?? client).patch({ - url: "/api/v1/repositories/{id}", + url: "/api/v1/repositories/{shortId}", ...options, headers: { "Content-Type": "application/json", @@ -368,7 +368,7 @@ export const deleteSnapshots = ( options: Options, ) => (options.client ?? client).delete({ - url: "/api/v1/repositories/{id}/snapshots", + url: "/api/v1/repositories/{shortId}/snapshots", ...options, headers: { "Content-Type": "application/json", @@ -383,7 +383,7 @@ export const listSnapshots = ( options: Options, ) => (options.client ?? client).get({ - url: "/api/v1/repositories/{id}/snapshots", + url: "/api/v1/repositories/{shortId}/snapshots", ...options, }); @@ -394,7 +394,7 @@ export const refreshSnapshots = ( options: Options, ) => (options.client ?? client).post({ - url: "/api/v1/repositories/{id}/snapshots/refresh", + url: "/api/v1/repositories/{shortId}/snapshots/refresh", ...options, }); @@ -405,7 +405,7 @@ export const deleteSnapshot = ( options: Options, ) => (options.client ?? client).delete({ - url: "/api/v1/repositories/{id}/snapshots/{snapshotId}", + url: "/api/v1/repositories/{shortId}/snapshots/{snapshotId}", ...options, }); @@ -416,7 +416,7 @@ export const getSnapshotDetails = ( options: Options, ) => (options.client ?? client).get({ - url: "/api/v1/repositories/{id}/snapshots/{snapshotId}", + url: "/api/v1/repositories/{shortId}/snapshots/{snapshotId}", ...options, }); @@ -427,7 +427,7 @@ export const listSnapshotFiles = ( options: Options, ) => (options.client ?? client).get({ - url: "/api/v1/repositories/{id}/snapshots/{snapshotId}/files", + url: "/api/v1/repositories/{shortId}/snapshots/{snapshotId}/files", ...options, }); @@ -438,7 +438,7 @@ export const restoreSnapshot = ( options: Options, ) => (options.client ?? client).post({ - url: "/api/v1/repositories/{id}/restore", + url: "/api/v1/repositories/{shortId}/restore", ...options, headers: { "Content-Type": "application/json", @@ -451,7 +451,7 @@ export const restoreSnapshot = ( */ export const cancelDoctor = (options: Options) => (options.client ?? client).delete({ - url: "/api/v1/repositories/{id}/doctor", + url: "/api/v1/repositories/{shortId}/doctor", ...options, }); @@ -460,7 +460,7 @@ export const cancelDoctor = (options: Opti */ export const startDoctor = (options: Options) => (options.client ?? client).post({ - url: "/api/v1/repositories/{id}/doctor", + url: "/api/v1/repositories/{shortId}/doctor", ...options, }); @@ -471,7 +471,7 @@ export const unlockRepository = ( options: Options, ) => (options.client ?? client).post({ - url: "/api/v1/repositories/{id}/unlock", + url: "/api/v1/repositories/{shortId}/unlock", ...options, }); @@ -480,7 +480,7 @@ export const unlockRepository = ( */ export const tagSnapshots = (options: Options) => (options.client ?? client).post({ - url: "/api/v1/repositories/{id}/snapshots/tag", + url: "/api/v1/repositories/{shortId}/snapshots/tag", ...options, headers: { "Content-Type": "application/json", @@ -493,7 +493,7 @@ export const tagSnapshots = (options: Opti */ export const devPanelExec = (options: Options) => (options.client ?? client).sse.post({ - url: "/api/v1/repositories/{id}/exec", + url: "/api/v1/repositories/{shortId}/exec", ...options, headers: { "Content-Type": "application/json", @@ -534,7 +534,7 @@ export const deleteBackupSchedule = ( options: Options, ) => (options.client ?? client).delete({ - url: "/api/v1/backups/{scheduleId}", + url: "/api/v1/backups/{shortId}", ...options, }); @@ -545,7 +545,7 @@ export const getBackupSchedule = ( options: Options, ) => (options.client ?? client).get({ - url: "/api/v1/backups/{scheduleId}", + url: "/api/v1/backups/{shortId}", ...options, }); @@ -556,7 +556,7 @@ export const updateBackupSchedule = ( options: Options, ) => (options.client ?? client).patch({ - url: "/api/v1/backups/{scheduleId}", + url: "/api/v1/backups/{shortId}", ...options, headers: { "Content-Type": "application/json", @@ -571,7 +571,7 @@ export const getBackupScheduleForVolume = options: Options, ) => (options.client ?? client).get({ - url: "/api/v1/backups/volume/{volumeId}", + url: "/api/v1/backups/volume/{volumeShortId}", ...options, }); @@ -580,7 +580,7 @@ export const getBackupScheduleForVolume = */ export const runBackupNow = (options: Options) => (options.client ?? client).post({ - url: "/api/v1/backups/{scheduleId}/run", + url: "/api/v1/backups/{shortId}/run", ...options, }); @@ -589,7 +589,7 @@ export const runBackupNow = (options: Opti */ export const stopBackup = (options: Options) => (options.client ?? client).post({ - url: "/api/v1/backups/{scheduleId}/stop", + url: "/api/v1/backups/{shortId}/stop", ...options, }); @@ -598,7 +598,7 @@ export const stopBackup = (options: Option */ export const runForget = (options: Options) => (options.client ?? client).post({ - url: "/api/v1/backups/{scheduleId}/forget", + url: "/api/v1/backups/{shortId}/forget", ...options, }); @@ -609,7 +609,7 @@ export const getScheduleNotifications = ( options: Options, ) => (options.client ?? client).get({ - url: "/api/v1/backups/{scheduleId}/notifications", + url: "/api/v1/backups/{shortId}/notifications", ...options, }); @@ -620,7 +620,7 @@ export const updateScheduleNotifications = , ) => (options.client ?? client).put({ - url: "/api/v1/backups/{scheduleId}/notifications", + url: "/api/v1/backups/{shortId}/notifications", ...options, headers: { "Content-Type": "application/json", @@ -635,7 +635,7 @@ export const getScheduleMirrors = ( options: Options, ) => (options.client ?? client).get({ - url: "/api/v1/backups/{scheduleId}/mirrors", + url: "/api/v1/backups/{shortId}/mirrors", ...options, }); @@ -646,7 +646,7 @@ export const updateScheduleMirrors = ( options: Options, ) => (options.client ?? client).put({ - url: "/api/v1/backups/{scheduleId}/mirrors", + url: "/api/v1/backups/{shortId}/mirrors", ...options, headers: { "Content-Type": "application/json", @@ -661,12 +661,12 @@ export const getMirrorCompatibility = ( options: Options, ) => (options.client ?? client).get({ - url: "/api/v1/backups/{scheduleId}/mirrors/compatibility", + url: "/api/v1/backups/{shortId}/mirrors/compatibility", ...options, }); /** - * Reorder backup schedules by providing an array of schedule IDs in the desired order + * Reorder backup schedules by providing an array of schedule short IDs in the desired order */ export const reorderBackupSchedules = ( options?: Options, diff --git a/app/client/api-client/types.gen.ts b/app/client/api-client/types.gen.ts index 8e135a75..4b68b145 100644 --- a/app/client/api-client/types.gen.ts +++ b/app/client/api-client/types.gen.ts @@ -346,10 +346,10 @@ export type TestConnectionResponse = TestConnectionResponses[keyof TestConnectio export type DeleteVolumeData = { body?: never; path: { - id: string; + shortId: string; }; query?: never; - url: "/api/v1/volumes/{id}"; + url: "/api/v1/volumes/{shortId}"; }; export type DeleteVolumeResponses = { @@ -366,10 +366,10 @@ export type DeleteVolumeResponse = DeleteVolumeResponses[keyof DeleteVolumeRespo export type GetVolumeData = { body?: never; path: { - id: string; + shortId: string; }; query?: never; - url: "/api/v1/volumes/{id}"; + url: "/api/v1/volumes/{shortId}"; }; export type GetVolumeErrors = { @@ -520,10 +520,10 @@ export type UpdateVolumeData = { name?: string; }; path: { - id: string; + shortId: string; }; query?: never; - url: "/api/v1/volumes/{id}"; + url: "/api/v1/volumes/{shortId}"; }; export type UpdateVolumeErrors = { @@ -610,10 +610,10 @@ export type UpdateVolumeResponse = UpdateVolumeResponses[keyof UpdateVolumeRespo export type MountVolumeData = { body?: never; path: { - id: string; + shortId: string; }; query?: never; - url: "/api/v1/volumes/{id}/mount"; + url: "/api/v1/volumes/{shortId}/mount"; }; export type MountVolumeResponses = { @@ -631,10 +631,10 @@ export type MountVolumeResponse = MountVolumeResponses[keyof MountVolumeResponse export type UnmountVolumeData = { body?: never; path: { - id: string; + shortId: string; }; query?: never; - url: "/api/v1/volumes/{id}/unmount"; + url: "/api/v1/volumes/{shortId}/unmount"; }; export type UnmountVolumeResponses = { @@ -652,10 +652,10 @@ export type UnmountVolumeResponse = UnmountVolumeResponses[keyof UnmountVolumeRe export type HealthCheckVolumeData = { body?: never; path: { - id: string; + shortId: string; }; query?: never; - url: "/api/v1/volumes/{id}/health-check"; + url: "/api/v1/volumes/{shortId}/health-check"; }; export type HealthCheckVolumeErrors = { @@ -680,14 +680,14 @@ export type HealthCheckVolumeResponse = HealthCheckVolumeResponses[keyof HealthC export type ListFilesData = { body?: never; path: { - id: string; + shortId: string; }; query?: { limit?: string; offset?: string; path?: string; }; - url: "/api/v1/volumes/{id}/files"; + url: "/api/v1/volumes/{shortId}/files"; }; export type ListFilesResponses = { @@ -1159,10 +1159,10 @@ export type ListRcloneRemotesResponse = ListRcloneRemotesResponses[keyof ListRcl export type DeleteRepositoryData = { body?: never; path: { - id: string; + shortId: string; }; query?: never; - url: "/api/v1/repositories/{id}"; + url: "/api/v1/repositories/{shortId}"; }; export type DeleteRepositoryResponses = { @@ -1179,10 +1179,10 @@ export type DeleteRepositoryResponse = DeleteRepositoryResponses[keyof DeleteRep export type GetRepositoryData = { body?: never; path: { - id: string; + shortId: string; }; query?: never; - url: "/api/v1/repositories/{id}"; + url: "/api/v1/repositories/{shortId}"; }; export type GetRepositoryResponses = { @@ -1553,10 +1553,10 @@ export type UpdateRepositoryData = { name?: string; }; path: { - id: string; + shortId: string; }; query?: never; - url: "/api/v1/repositories/{id}"; + url: "/api/v1/repositories/{shortId}"; }; export type UpdateRepositoryErrors = { @@ -1775,10 +1775,10 @@ export type DeleteSnapshotsData = { snapshotIds: Array; }; path: { - id: string; + shortId: string; }; query?: never; - url: "/api/v1/repositories/{id}/snapshots"; + url: "/api/v1/repositories/{shortId}/snapshots"; }; export type DeleteSnapshotsResponses = { @@ -1795,12 +1795,12 @@ export type DeleteSnapshotsResponse = DeleteSnapshotsResponses[keyof DeleteSnaps export type ListSnapshotsData = { body?: never; path: { - id: string; + shortId: string; }; query?: { backupId?: string; }; - url: "/api/v1/repositories/{id}/snapshots"; + url: "/api/v1/repositories/{shortId}/snapshots"; }; export type ListSnapshotsResponses = { @@ -1840,10 +1840,10 @@ export type ListSnapshotsResponse = ListSnapshotsResponses[keyof ListSnapshotsRe export type RefreshSnapshotsData = { body?: never; path: { - id: string; + shortId: string; }; query?: never; - url: "/api/v1/repositories/{id}/snapshots/refresh"; + url: "/api/v1/repositories/{shortId}/snapshots/refresh"; }; export type RefreshSnapshotsResponses = { @@ -1861,11 +1861,11 @@ export type RefreshSnapshotsResponse = RefreshSnapshotsResponses[keyof RefreshSn export type DeleteSnapshotData = { body?: never; path: { - id: string; + shortId: string; snapshotId: string; }; query?: never; - url: "/api/v1/repositories/{id}/snapshots/{snapshotId}"; + url: "/api/v1/repositories/{shortId}/snapshots/{snapshotId}"; }; export type DeleteSnapshotResponses = { @@ -1882,11 +1882,11 @@ export type DeleteSnapshotResponse = DeleteSnapshotResponses[keyof DeleteSnapsho export type GetSnapshotDetailsData = { body?: never; path: { - id: string; + shortId: string; snapshotId: string; }; query?: never; - url: "/api/v1/repositories/{id}/snapshots/{snapshotId}"; + url: "/api/v1/repositories/{shortId}/snapshots/{snapshotId}"; }; export type GetSnapshotDetailsResponses = { @@ -1926,7 +1926,7 @@ export type GetSnapshotDetailsResponse = GetSnapshotDetailsResponses[keyof GetSn export type ListSnapshotFilesData = { body?: never; path: { - id: string; + shortId: string; snapshotId: string; }; query?: { @@ -1934,7 +1934,7 @@ export type ListSnapshotFilesData = { offset?: string; path?: string; }; - url: "/api/v1/repositories/{id}/snapshots/{snapshotId}/files"; + url: "/api/v1/repositories/{shortId}/snapshots/{snapshotId}/files"; }; export type ListSnapshotFilesResponses = { @@ -1981,10 +1981,10 @@ export type RestoreSnapshotData = { targetPath?: string; }; path: { - id: string; + shortId: string; }; query?: never; - url: "/api/v1/repositories/{id}/restore"; + url: "/api/v1/repositories/{shortId}/restore"; }; export type RestoreSnapshotResponses = { @@ -2004,10 +2004,10 @@ export type RestoreSnapshotResponse = RestoreSnapshotResponses[keyof RestoreSnap export type CancelDoctorData = { body?: never; path: { - id: string; + shortId: string; }; query?: never; - url: "/api/v1/repositories/{id}/doctor"; + url: "/api/v1/repositories/{shortId}/doctor"; }; export type CancelDoctorErrors = { @@ -2031,10 +2031,10 @@ export type CancelDoctorResponse = CancelDoctorResponses[keyof CancelDoctorRespo export type StartDoctorData = { body?: never; path: { - id: string; + shortId: string; }; query?: never; - url: "/api/v1/repositories/{id}/doctor"; + url: "/api/v1/repositories/{shortId}/doctor"; }; export type StartDoctorErrors = { @@ -2059,10 +2059,10 @@ export type StartDoctorResponse = StartDoctorResponses[keyof StartDoctorResponse export type UnlockRepositoryData = { body?: never; path: { - id: string; + shortId: string; }; query?: never; - url: "/api/v1/repositories/{id}/unlock"; + url: "/api/v1/repositories/{shortId}/unlock"; }; export type UnlockRepositoryResponses = { @@ -2085,10 +2085,10 @@ export type TagSnapshotsData = { set?: Array; }; path: { - id: string; + shortId: string; }; query?: never; - url: "/api/v1/repositories/{id}/snapshots/tag"; + url: "/api/v1/repositories/{shortId}/snapshots/tag"; }; export type TagSnapshotsResponses = { @@ -2108,10 +2108,10 @@ export type DevPanelExecData = { args?: Array; }; path: { - id: string; + shortId: string; }; query?: never; - url: "/api/v1/repositories/{id}/exec"; + url: "/api/v1/repositories/{shortId}/exec"; }; export type DevPanelExecErrors = { @@ -2433,7 +2433,7 @@ export type CreateBackupScheduleData = { enabled: boolean; name: string; repositoryId: string; - volumeId: number; + volumeId: number | string; excludeIfPresent?: Array; excludePatterns?: Array; includePatterns?: Array; @@ -2493,10 +2493,10 @@ export type CreateBackupScheduleResponse = CreateBackupScheduleResponses[keyof C export type DeleteBackupScheduleData = { body?: never; path: { - scheduleId: string; + shortId: string; }; query?: never; - url: "/api/v1/backups/{scheduleId}"; + url: "/api/v1/backups/{shortId}"; }; export type DeleteBackupScheduleResponses = { @@ -2513,10 +2513,10 @@ export type DeleteBackupScheduleResponse = DeleteBackupScheduleResponses[keyof D export type GetBackupScheduleData = { body?: never; path: { - scheduleId: string; + shortId: string; }; query?: never; - url: "/api/v1/backups/{scheduleId}"; + url: "/api/v1/backups/{shortId}"; }; export type GetBackupScheduleResponses = { @@ -2831,10 +2831,10 @@ export type UpdateBackupScheduleData = { tags?: Array; }; path: { - scheduleId: string; + shortId: string; }; query?: never; - url: "/api/v1/backups/{scheduleId}"; + url: "/api/v1/backups/{shortId}"; }; export type UpdateBackupScheduleResponses = { @@ -2876,10 +2876,10 @@ export type UpdateBackupScheduleResponse = UpdateBackupScheduleResponses[keyof U export type GetBackupScheduleForVolumeData = { body?: never; path: { - volumeId: string; + volumeShortId: string; }; query?: never; - url: "/api/v1/backups/volume/{volumeId}"; + url: "/api/v1/backups/volume/{volumeShortId}"; }; export type GetBackupScheduleForVolumeResponses = { @@ -3176,10 +3176,10 @@ export type GetBackupScheduleForVolumeResponse = export type RunBackupNowData = { body?: never; path: { - scheduleId: string; + shortId: string; }; query?: never; - url: "/api/v1/backups/{scheduleId}/run"; + url: "/api/v1/backups/{shortId}/run"; }; export type RunBackupNowResponses = { @@ -3196,10 +3196,10 @@ export type RunBackupNowResponse = RunBackupNowResponses[keyof RunBackupNowRespo export type StopBackupData = { body?: never; path: { - scheduleId: string; + shortId: string; }; query?: never; - url: "/api/v1/backups/{scheduleId}/stop"; + url: "/api/v1/backups/{shortId}/stop"; }; export type StopBackupErrors = { @@ -3223,10 +3223,10 @@ export type StopBackupResponse = StopBackupResponses[keyof StopBackupResponses]; export type RunForgetData = { body?: never; path: { - scheduleId: string; + shortId: string; }; query?: never; - url: "/api/v1/backups/{scheduleId}/forget"; + url: "/api/v1/backups/{shortId}/forget"; }; export type RunForgetResponses = { @@ -3243,10 +3243,10 @@ export type RunForgetResponse = RunForgetResponses[keyof RunForgetResponses]; export type GetScheduleNotificationsData = { body?: never; path: { - scheduleId: string; + shortId: string; }; query?: never; - url: "/api/v1/backups/{scheduleId}/notifications"; + url: "/api/v1/backups/{shortId}/notifications"; }; export type GetScheduleNotificationsResponses = { @@ -3355,10 +3355,10 @@ export type UpdateScheduleNotificationsData = { }>; }; path: { - scheduleId: string; + shortId: string; }; query?: never; - url: "/api/v1/backups/{scheduleId}/notifications"; + url: "/api/v1/backups/{shortId}/notifications"; }; export type UpdateScheduleNotificationsResponses = { @@ -3459,10 +3459,10 @@ export type UpdateScheduleNotificationsResponse = export type GetScheduleMirrorsData = { body?: never; path: { - scheduleId: string; + shortId: string; }; query?: never; - url: "/api/v1/backups/{scheduleId}/mirrors"; + url: "/api/v1/backups/{shortId}/mirrors"; }; export type GetScheduleMirrorsResponses = { @@ -3664,7 +3664,7 @@ export type GetScheduleMirrorsResponses = { updatedAt: number; }; repositoryId: string; - scheduleId: number; + scheduleId: string; }>; }; @@ -3678,10 +3678,10 @@ export type UpdateScheduleMirrorsData = { }>; }; path: { - scheduleId: string; + shortId: string; }; query?: never; - url: "/api/v1/backups/{scheduleId}/mirrors"; + url: "/api/v1/backups/{shortId}/mirrors"; }; export type UpdateScheduleMirrorsResponses = { @@ -3883,7 +3883,7 @@ export type UpdateScheduleMirrorsResponses = { updatedAt: number; }; repositoryId: string; - scheduleId: number; + scheduleId: string; }>; }; @@ -3892,10 +3892,10 @@ export type UpdateScheduleMirrorsResponse = UpdateScheduleMirrorsResponses[keyof export type GetMirrorCompatibilityData = { body?: never; path: { - scheduleId: string; + shortId: string; }; query?: never; - url: "/api/v1/backups/{scheduleId}/mirrors/compatibility"; + url: "/api/v1/backups/{shortId}/mirrors/compatibility"; }; export type GetMirrorCompatibilityResponses = { @@ -3913,7 +3913,7 @@ export type GetMirrorCompatibilityResponse = GetMirrorCompatibilityResponses[key export type ReorderBackupSchedulesData = { body?: { - scheduleIds: Array; + scheduleShortIds: Array; }; path?: never; query?: never; diff --git a/app/client/components/dev-panel.tsx b/app/client/components/dev-panel.tsx index ebd7bfeb..eb242923 100644 --- a/app/client/components/dev-panel.tsx +++ b/app/client/components/dev-panel.tsx @@ -82,7 +82,7 @@ export function DevPanel({ open, onOpenChange }: DevPanelProps) { try { const result = await devPanelExec({ - path: { id: selectedRepoId }, + path: { shortId: selectedRepoId }, body: { command, args: argsArray.length > 0 ? argsArray : undefined }, signal: abortControllerRef.current.signal, }); @@ -155,7 +155,7 @@ export function DevPanel({ open, onOpenChange }: DevPanelProps) { {repositories.map((repo) => ( - + {repo.name} ({repo.type}) ))} diff --git a/app/client/components/file-browsers/snapshot-tree-browser.tsx b/app/client/components/file-browsers/snapshot-tree-browser.tsx index 3eb93026..af8228ec 100644 --- a/app/client/components/file-browsers/snapshot-tree-browser.tsx +++ b/app/client/components/file-browsers/snapshot-tree-browser.tsx @@ -34,7 +34,7 @@ export const SnapshotTreeBrowser = ({ const { data, isLoading, error } = useQuery({ ...listSnapshotFilesOptions({ - path: { id: repositoryId, snapshotId }, + path: { shortId: repositoryId, snapshotId }, query: { path: normalizedBasePath }, }), enabled, @@ -92,7 +92,7 @@ export const SnapshotTreeBrowser = ({ fetchFolder: async (path, offset = 0) => { return await queryClient.ensureQueryData( listSnapshotFilesOptions({ - path: { id: repositoryId, snapshotId }, + path: { shortId: repositoryId, snapshotId }, query: { path, offset: offset.toString(), @@ -104,7 +104,7 @@ export const SnapshotTreeBrowser = ({ prefetchFolder: (path) => { void queryClient.prefetchQuery( listSnapshotFilesOptions({ - path: { id: repositoryId, snapshotId }, + path: { shortId: repositoryId, snapshotId }, query: { path, offset: "0", diff --git a/app/client/components/file-browsers/volume-file-browser.tsx b/app/client/components/file-browsers/volume-file-browser.tsx index 1a9de6ff..338f362d 100644 --- a/app/client/components/file-browsers/volume-file-browser.tsx +++ b/app/client/components/file-browsers/volume-file-browser.tsx @@ -13,7 +13,7 @@ export const VolumeFileBrowser = ({ volumeId, enabled = true, ...uiProps }: Volu const queryClient = useQueryClient(); const { data, isLoading, error } = useQuery({ - ...listFilesOptions({ path: { id: volumeId } }), + ...listFilesOptions({ path: { shortId: volumeId } }), enabled, }); @@ -23,7 +23,7 @@ export const VolumeFileBrowser = ({ volumeId, enabled = true, ...uiProps }: Volu fetchFolder: async (path, offset): Promise => { return await queryClient.ensureQueryData( listFilesOptions({ - path: { id: volumeId }, + path: { shortId: volumeId }, query: { path, offset: offset?.toString() }, }), ); @@ -31,7 +31,7 @@ export const VolumeFileBrowser = ({ volumeId, enabled = true, ...uiProps }: Volu prefetchFolder: (path) => { void queryClient.prefetchQuery( listFilesOptions({ - path: { id: volumeId }, + path: { shortId: volumeId }, query: { path }, }), ); diff --git a/app/client/components/restore-form.tsx b/app/client/components/restore-form.tsx index 63f5970b..161e9f6b 100644 --- a/app/client/components/restore-form.tsx +++ b/app/client/components/restore-form.tsx @@ -92,7 +92,7 @@ export function RestoreForm({ repository, snapshotId, returnPath, basePath }: Re onError: (error) => { restoreCompletedRef.current = true; setIsRestoreActive(false); - handleRepositoryError("Restore failed", error, repository.id); + handleRepositoryError("Restore failed", error, repository.shortId); }, }); @@ -113,7 +113,7 @@ export function RestoreForm({ repository, snapshotId, returnPath, basePath }: Re setShowRestoreResultAlert(false); restoreSnapshot({ - path: { id: repository.id }, + path: { shortId: repository.shortId }, body: { snapshotId, include: includePaths.length > 0 ? includePaths : undefined, @@ -123,7 +123,7 @@ export function RestoreForm({ repository, snapshotId, returnPath, basePath }: Re }, }); }, [ - repository.id, + repository.shortId, snapshotId, excludeXattr, restoreLocation, @@ -280,7 +280,7 @@ export function RestoreForm({ repository, snapshotId, returnPath, basePath }: Re { toast.promise( deleteSnapshots.mutateAsync({ - path: { id: repositoryId }, + path: { shortId: repositoryId }, body: { snapshotIds: Array.from(selectedIds) }, }), { @@ -111,12 +111,12 @@ export const SnapshotsTable = ({ snapshots, repositoryId, backups, listSnapshots }; const handleBulkReTag = () => { - const schedule = backups.find((b) => String(b.id) === targetScheduleId); + const schedule = backups.find((b) => b.shortId === targetScheduleId); if (!schedule) return; toast.promise( tagSnapshots.mutateAsync({ - path: { id: repositoryId }, + path: { shortId: repositoryId }, body: { snapshotIds: Array.from(selectedIds), set: [schedule.shortId], @@ -187,7 +187,7 @@ export const SnapshotsTable = ({ snapshots, repositoryId, backups, listSnapshots e.stopPropagation()} className="hover:underline" > @@ -301,7 +301,7 @@ export const SnapshotsTable = ({ snapshots, repositoryId, backups, listSnapshots {backups.map((backup) => ( - + {backup.name} ))} diff --git a/app/client/components/sortable-card.tsx b/app/client/components/sortable-card.tsx index 1455665d..40d036de 100644 --- a/app/client/components/sortable-card.tsx +++ b/app/client/components/sortable-card.tsx @@ -6,7 +6,7 @@ import type { PropsWithChildren } from "react"; interface SortableBackupCardProps { isDragging?: boolean; - uniqueId: number; + uniqueId: string | number; } export function SortableCard({ isDragging, uniqueId, children }: PropsWithChildren) { diff --git a/app/client/lib/errors.tsx b/app/client/lib/errors.tsx index 01b15c60..0631298a 100644 --- a/app/client/lib/errors.tsx +++ b/app/client/lib/errors.tsx @@ -39,7 +39,7 @@ export const showLockErrorToast = (repositoryId: string, title: string) => { toast.promise( async () => { const result = await unlockRepository({ - path: { id: repositoryId }, + path: { shortId: repositoryId }, throwOnError: true, }); return result.data; diff --git a/app/client/modules/backups/components/backup-card.tsx b/app/client/modules/backups/components/backup-card.tsx index 99b1adc2..935cb938 100644 --- a/app/client/modules/backups/components/backup-card.tsx +++ b/app/client/modules/backups/components/backup-card.tsx @@ -7,8 +7,8 @@ import { Link } from "@tanstack/react-router"; export const BackupCard = ({ schedule }: { schedule: BackupSchedule }) => { return ( - - + +
diff --git a/app/client/modules/backups/components/backup-progress-card.tsx b/app/client/modules/backups/components/backup-progress-card.tsx index 19df47b9..f6bcec64 100644 --- a/app/client/modules/backups/components/backup-progress-card.tsx +++ b/app/client/modules/backups/components/backup-progress-card.tsx @@ -7,22 +7,22 @@ import { formatDuration } from "~/utils/utils"; import { formatBytes } from "~/utils/format-bytes"; type Props = { - scheduleId: number; + scheduleShortId: string; }; -export const BackupProgressCard = ({ scheduleId }: Props) => { +export const BackupProgressCard = ({ scheduleShortId }: Props) => { const { addEventListener } = useServerEvents(); const [progress, setProgress] = useState(null); useEffect(() => { const unsubscribe = addEventListener("backup:progress", (progressData) => { - if (progressData.scheduleId === scheduleId) { + if (progressData.scheduleId === scheduleShortId) { setProgress(progressData); } }); const unsubscribeComplete = addEventListener("backup:completed", (completedData) => { - if (completedData.scheduleId === scheduleId) { + if (completedData.scheduleId === scheduleShortId) { setProgress(null); } }); @@ -31,7 +31,7 @@ export const BackupProgressCard = ({ scheduleId }: Props) => { unsubscribe(); unsubscribeComplete(); }; - }, [addEventListener, scheduleId]); + }, [addEventListener, scheduleShortId]); const percentDone = progress ? Math.round(progress.percent_done * 100) : 0; const currentFile = progress?.current_files[0] || ""; diff --git a/app/client/modules/backups/components/create-schedule-form/basic-info-section.tsx b/app/client/modules/backups/components/create-schedule-form/basic-info-section.tsx index 4c1b8f96..1e2b2ead 100644 --- a/app/client/modules/backups/components/create-schedule-form/basic-info-section.tsx +++ b/app/client/modules/backups/components/create-schedule-form/basic-info-section.tsx @@ -48,7 +48,7 @@ export const BasicInfoSection = ({ form, volume }: BasicInfoSectionProps) => { {repositoriesData?.map((repo) => ( - + {repo.name} diff --git a/app/client/modules/backups/components/create-schedule-form/summary-section.tsx b/app/client/modules/backups/components/create-schedule-form/summary-section.tsx index b2c6abdd..69872f3c 100644 --- a/app/client/modules/backups/components/create-schedule-form/summary-section.tsx +++ b/app/client/modules/backups/components/create-schedule-form/summary-section.tsx @@ -34,7 +34,9 @@ export const SummarySection = ({ volume, frequency, formValues }: SummarySection

Repository

-

{repositoriesData?.find((r) => r.id === formValues.repositoryId)?.name || "—"}

+

+ {repositoriesData?.find((r) => r.shortId === formValues.repositoryId)?.name || "—"} +

{(formValues.includePatterns && formValues.includePatterns.length > 0) || formValues.includePatternsText ? (
diff --git a/app/client/modules/backups/components/create-schedule-form/utils.ts b/app/client/modules/backups/components/create-schedule-form/utils.ts index 1cbbd795..dfd1a0dc 100644 --- a/app/client/modules/backups/components/create-schedule-form/utils.ts +++ b/app/client/modules/backups/components/create-schedule-form/utils.ts @@ -2,9 +2,7 @@ import type { BackupSchedule } from "~/client/lib/types"; import { cronToFormValues } from "../../lib/cron-utils"; import type { InternalFormValues } from "./types"; -export const backupScheduleToFormValues = ( - schedule?: BackupSchedule, -): InternalFormValues | undefined => { +export const backupScheduleToFormValues = (schedule?: BackupSchedule): InternalFormValues | undefined => { if (!schedule) { return undefined; } @@ -18,7 +16,7 @@ export const backupScheduleToFormValues = ( return { name: schedule.name, - repositoryId: schedule.repositoryId, + repositoryId: schedule.repository.shortId, includePatterns: fileBrowserPaths.length > 0 ? fileBrowserPaths : undefined, includePatternsText: textPatterns.length > 0 ? textPatterns.join("\n") : undefined, excludePatternsText: schedule.excludePatterns?.join("\n") || undefined, diff --git a/app/client/modules/backups/components/schedule-mirrors-config.tsx b/app/client/modules/backups/components/schedule-mirrors-config.tsx index 00563381..4740a1d7 100644 --- a/app/client/modules/backups/components/schedule-mirrors-config.tsx +++ b/app/client/modules/backups/components/schedule-mirrors-config.tsx @@ -25,7 +25,7 @@ import type { GetScheduleMirrorsResponse } from "~/client/api-client"; import { Link } from "@tanstack/react-router"; type Props = { - scheduleId: number; + scheduleShortId: string; primaryRepositoryId: string; repositories: Repository[]; initialData: GetScheduleMirrorsResponse; @@ -55,14 +55,14 @@ const buildAssignments = (mirrors: GetScheduleMirrorsResponse) => ]), ); -export const ScheduleMirrorsConfig = ({ scheduleId, primaryRepositoryId, repositories, initialData }: Props) => { +export const ScheduleMirrorsConfig = ({ scheduleShortId, primaryRepositoryId, repositories, initialData }: Props) => { const [assignments, setAssignments] = useState>(() => buildAssignments(initialData)); const [hasChanges, setHasChanges] = useState(false); const [isAddingNew, setIsAddingNew] = useState(false); const { addEventListener } = useServerEvents(); const { data: currentMirrors } = useSuspenseQuery({ - ...getScheduleMirrorsOptions({ path: { scheduleId: scheduleId.toString() } }), + ...getScheduleMirrorsOptions({ path: { shortId: scheduleShortId } }), }); useEffect(() => { @@ -72,7 +72,7 @@ export const ScheduleMirrorsConfig = ({ scheduleId, primaryRepositoryId, reposit }, [currentMirrors, hasChanges]); const { data: compatibility } = useQuery({ - ...getMirrorCompatibilityOptions({ path: { scheduleId: scheduleId.toString() } }), + ...getMirrorCompatibilityOptions({ path: { shortId: scheduleShortId } }), }); const updateMirrors = useMutation({ @@ -100,7 +100,7 @@ export const ScheduleMirrorsConfig = ({ scheduleId, primaryRepositoryId, reposit useEffect(() => { const unsubscribeStarted = addEventListener("mirror:started", (event) => { - if (event.scheduleId !== scheduleId) return; + if (event.scheduleId !== scheduleShortId) return; setAssignments((prev) => { const next = new Map(prev); const existing = next.get(event.repositoryId); @@ -111,7 +111,7 @@ export const ScheduleMirrorsConfig = ({ scheduleId, primaryRepositoryId, reposit }); const unsubscribeCompleted = addEventListener("mirror:completed", (event) => { - if (event.scheduleId !== scheduleId) return; + if (event.scheduleId !== scheduleShortId) return; setAssignments((prev) => { const next = new Map(prev); const existing = next.get(event.repositoryId); @@ -130,7 +130,7 @@ export const ScheduleMirrorsConfig = ({ scheduleId, primaryRepositoryId, reposit unsubscribeStarted(); unsubscribeCompleted(); }; - }, [addEventListener, scheduleId]); + }, [addEventListener, scheduleShortId]); const addRepository = (repositoryId: string) => { const newAssignments = new Map(assignments); @@ -174,7 +174,7 @@ export const ScheduleMirrorsConfig = ({ scheduleId, primaryRepositoryId, reposit enabled: a.enabled, })); updateMirrors.mutate({ - path: { scheduleId: scheduleId.toString() }, + path: { shortId: scheduleShortId }, body: { mirrors: mirrorsList, }, @@ -188,18 +188,18 @@ export const ScheduleMirrorsConfig = ({ scheduleId, primaryRepositoryId, reposit const selectableRepositories = repositories?.filter((r) => { - if (r.id === primaryRepositoryId) return false; - if (assignments.has(r.id)) return false; + if (r.shortId === primaryRepositoryId) return false; + if (assignments.has(r.shortId)) return false; return true; }) || []; const hasAvailableRepositories = selectableRepositories.some((r) => { - const compat = compatibilityMap.get(r.id); + const compat = compatibilityMap.get(r.shortId); return compat?.compatible !== false; }); const assignedRepositories = Array.from(assignments.keys()) - .map((id) => repositories?.find((r) => r.id === id)) + .map((id) => repositories?.find((r) => r.shortId === id)) .filter((r) => r !== undefined); const getStatusVariant = (status: string | null) => { @@ -262,13 +262,13 @@ export const ScheduleMirrorsConfig = ({ scheduleId, primaryRepositoryId, reposit {selectableRepositories.map((repository) => { - const compat = compatibilityMap.get(repository.id); + const compat = compatibilityMap.get(repository.shortId); return ( - +
- +
{repository.name} @@ -322,16 +322,16 @@ export const ScheduleMirrorsConfig = ({ scheduleId, primaryRepositoryId, reposit {assignedRepositories.map((repository) => { - const assignment = assignments.get(repository.id); + const assignment = assignments.get(repository.shortId); if (!assignment) return null; return ( - +
@@ -346,7 +346,7 @@ export const ScheduleMirrorsConfig = ({ scheduleId, primaryRepositoryId, reposit toggleEnabled(repository.id)} + onCheckedChange={() => toggleEnabled(repository.shortId)} /> @@ -363,7 +363,7 @@ export const ScheduleMirrorsConfig = ({ scheduleId, primaryRepositoryId, reposit