Feature/about screen add option to check for and trigger updates (#485)

* [VersionMapping] Require server version "r1436" for preview

* Move ts util types to new type file

* Add buttons for updating server and webUI
This commit is contained in:
schroda
2023-12-09 23:08:27 +01:00
committed by GitHub
parent 2caf88ce51
commit 78310496aa
13 changed files with 389 additions and 39 deletions

View File

@@ -412,6 +412,21 @@ export const FULL_UPDATER_STATUS = gql`
}
`;
export const ABOUT_WEBUI = gql`
fragment ABOUT_WEBUI on AboutWebUI {
channel
tag
}
`;
export const WEBUI_UPDATE_CHECK = gql`
fragment WEBUI_UPDATE_CHECK on WebUIUpdateCheck {
channel
tag
updateAvailable
}
`;
export const WEBUI_UPDATE_INFO = gql`
fragment WEBUI_UPDATE_INFO on WebUIUpdateInfo {
channel

View File

@@ -2143,6 +2143,10 @@ export type PartialUpdaterStatusFragment = { __typename?: 'UpdateStatus', isRunn
export type FullUpdaterStatusFragment = { __typename?: 'UpdateStatus', isRunning: boolean, completeJobs: { __typename?: 'UpdateStatusType', mangas: { __typename?: 'MangaNodeList', totalCount: number, nodes: Array<{ __typename?: 'MangaType', unreadCount: number, downloadCount: number, artist?: string | null, author?: string | null, chaptersLastFetchedAt?: any | null, description?: string | null, genre: Array<string>, id: number, inLibrary: boolean, inLibraryAt: any, initialized: boolean, lastFetchedAt?: any | null, realUrl?: string | null, status: MangaStatus, thumbnailUrl?: string | null, title: string, url: string, chapters: { __typename?: 'ChapterNodeList', totalCount: number }, meta: Array<{ __typename?: 'MangaMetaType', key: string, value: string }>, source?: { __typename?: 'SourceType', displayName: string, iconUrl: string, id: any, isConfigurable: boolean, isNsfw: boolean, lang: string, name: string, supportsLatest: boolean } | null }> } }, failedJobs: { __typename?: 'UpdateStatusType', mangas: { __typename?: 'MangaNodeList', totalCount: number, nodes: Array<{ __typename?: 'MangaType', id: number, title: string, thumbnailUrl?: string | null }> } }, pendingJobs: { __typename?: 'UpdateStatusType', mangas: { __typename?: 'MangaNodeList', totalCount: number, nodes: Array<{ __typename?: 'MangaType', id: number, title: string, thumbnailUrl?: string | null }> } }, runningJobs: { __typename?: 'UpdateStatusType', mangas: { __typename?: 'MangaNodeList', totalCount: number, nodes: Array<{ __typename?: 'MangaType', id: number, title: string, thumbnailUrl?: string | null }> } }, skippedJobs: { __typename?: 'UpdateStatusType', mangas: { __typename?: 'MangaNodeList', totalCount: number, nodes: Array<{ __typename?: 'MangaType', id: number, title: string, thumbnailUrl?: string | null }> } }, updatingCategories: { __typename?: 'UpdateStatusCategoryType', categories: { __typename?: 'CategoryNodeList', totalCount: number, nodes: Array<{ __typename?: 'CategoryType', id: number, name: string, includeInUpdate: IncludeInUpdate }> } }, skippedCategories: { __typename?: 'UpdateStatusCategoryType', categories: { __typename?: 'CategoryNodeList', totalCount: number, nodes: Array<{ __typename?: 'CategoryType', id: number, name: string, includeInUpdate: IncludeInUpdate }> } } };
export type AboutWebuiFragment = { __typename?: 'AboutWebUI', channel: string, tag: string };
export type WebuiUpdateCheckFragment = { __typename?: 'WebUIUpdateCheck', channel: string, tag: string, updateAvailable: boolean };
export type WebuiUpdateInfoFragment = { __typename?: 'WebUIUpdateInfo', channel: string, tag: string };
export type WebuiUpdateStatusFragment = { __typename?: 'WebUIUpdateStatus', progress: number, state: UpdateState, info: { __typename?: 'WebUIUpdateInfo', channel: string, tag: string } };
@@ -2458,6 +2462,11 @@ export type UpdateWebuiMutationVariables = Exact<{
export type UpdateWebuiMutation = { __typename?: 'Mutation', updateWebUI: { __typename?: 'WebUIUpdatePayload', clientMutationId?: string | null, updateStatus: { __typename?: 'WebUIUpdateStatus', progress: number, state: UpdateState, info: { __typename?: 'WebUIUpdateInfo', channel: string, tag: string } } } };
export type ResetWebuiUpdateStatusMutationVariables = Exact<{ [key: string]: never; }>;
export type ResetWebuiUpdateStatusMutation = { __typename?: 'Mutation', resetWebUIUpdateStatus: { __typename?: 'WebUIUpdateStatus', state: UpdateState, info: { __typename?: 'WebUIUpdateInfo', channel: string, tag: string } } };
export type ResetServerSettingsMutationVariables = Exact<{
input: ResetSettingsInput;
}>;

View File

@@ -7,7 +7,7 @@
*/
import gql from 'graphql-tag';
import { WEBUI_UPDATE_STATUS } from '@/lib/graphql/Fragments';
import { WEBUI_UPDATE_INFO, WEBUI_UPDATE_STATUS } from '@/lib/graphql/Fragments';
export const UPDATE_WEBUI = gql`
${WEBUI_UPDATE_STATUS}
@@ -20,3 +20,15 @@ export const UPDATE_WEBUI = gql`
}
}
`;
export const RESET_WEBUI_UPDATE_STATUS = gql`
${WEBUI_UPDATE_INFO}
mutation RESET_WEBUI_UPDATE_STATUS {
resetWebUIUpdateStatus {
info {
...WEBUI_UPDATE_INFO
}
state
}
}
`;

View File

@@ -7,9 +7,10 @@
*/
import gql from 'graphql-tag';
import { WEBUI_UPDATE_STATUS } from '@/lib/graphql/Fragments';
import { ABOUT_WEBUI, WEBUI_UPDATE_CHECK, WEBUI_UPDATE_STATUS } from '@/lib/graphql/Fragments';
export const GET_ABOUT = gql`
${ABOUT_WEBUI}
query GET_ABOUT {
aboutServer {
buildTime
@@ -21,8 +22,7 @@ export const GET_ABOUT = gql`
version
}
aboutWebUI {
channel
tag
...ABOUT_WEBUI
}
}
`;
@@ -38,11 +38,10 @@ export const CHECK_FOR_SERVER_UPDATES = gql`
`;
export const CHECK_FOR_WEBUI_UPDATE = gql`
${WEBUI_UPDATE_CHECK}
query CHECK_FOR_WEBUI_UPDATE {
checkForWebUIUpdate {
channel
tag
updateAvailable
...WEBUI_UPDATE_CHECK
}
}
`;