Feature/show backup restore progress (#431)

* Extract "Progress" component

* Show backup restore progress
This commit is contained in:
schroda
2023-10-29 01:49:27 +02:00
committed by GitHub
parent 30fd8b0fca
commit 4c6d507405
4 changed files with 99 additions and 30 deletions

View File

@@ -83,6 +83,8 @@ import {
GetMangaQueryVariables,
GetMangasQuery,
GetMangasQueryVariables,
GetRestoreStatusQuery,
GetRestoreStatusQueryVariables,
GetServerSettingsQuery,
GetSourceMangasFetchMutation,
GetSourceMangasFetchMutationVariables,
@@ -199,7 +201,7 @@ import {
import { GET_UPDATE_STATUS } from '@/lib/graphql/queries/UpdaterQuery.ts';
import { CustomCache } from '@/lib/requests/CustomCache.ts';
import { RESTORE_BACKUP } from '@/lib/graphql/mutations/BackupMutation.ts';
import { VALIDATE_BACKUP } from '@/lib/graphql/queries/BackupQuery.ts';
import { GET_RESTORE_STATUS, VALIDATE_BACKUP } from '@/lib/graphql/queries/BackupQuery.ts';
import { DOWNLOAD_STATUS_SUBSCRIPTION } from '@/lib/graphql/subscriptions/DownloaderSubscription.ts';
import { UPDATER_SUBSCRIPTION } from '@/lib/graphql/subscriptions/UpdaterSubscription.ts';
import { GET_SERVER_SETTINGS } from '@/lib/graphql/queries/SettingsQuery.ts';
@@ -1591,6 +1593,12 @@ export class RequestManager {
return this.doRequest(GQLMethod.QUERY, VALIDATE_BACKUP, { backup: file }, options);
}
public useGetBackupRestoreStatus(
options?: QueryHookOptions<GetRestoreStatusQuery, GetRestoreStatusQueryVariables>,
): AbortableApolloUseQueryResponse<GetRestoreStatusQuery, GetRestoreStatusQueryVariables> {
return this.doRequest(GQLMethod.USE_QUERY, GET_RESTORE_STATUS, undefined, options);
}
public getExportBackupUrl(): string {
return this.getValidUrlFor('backup/export/file');
}