diff --git a/src/i18n/locale/en.json b/src/i18n/locale/en.json index 9b6003bc..65b94b62 100644 --- a/src/i18n/locale/en.json +++ b/src/i18n/locale/en.json @@ -286,8 +286,11 @@ "label": { "browse": "Browse", "client": "Client", + "discord": "Discord", "display": "Display", "filter": "Filter", + "github": "GitHub", + "links": "Links", "loading": "Loading…", "never": "Never", "none": "None", @@ -493,14 +496,22 @@ }, "settings": { "about": { - "label": { - "build_time": "Build time", - "discord": "Discord", - "github": "GitHub", - "server_address": "Server address", - "server_version": "Server version" + "server": { + "label": { + "address": "Server address", + "build_time": "Build time", + "github": "$t(global.label.github) $t(settings.server.title.server)", + "version": "Server version" + } }, - "title": "About" + "title": "About", + "webui": { + "label": { + "channel": "$t(settings.webui.title.webui) channel", + "github": "$t(global.label.github) $t(settings.webui.title.webui)", + "version": "$t(settings.webui.title.webui) version" + } + } }, "backup": { "automated": { diff --git a/src/lib/graphql/generated/graphql.ts b/src/lib/graphql/generated/graphql.ts index 2f1c1302..27a5cd9a 100644 --- a/src/lib/graphql/generated/graphql.ts +++ b/src/lib/graphql/generated/graphql.ts @@ -2604,7 +2604,7 @@ export type GetMangasQuery = { __typename?: 'Query', mangas: { __typename?: 'Man export type GetAboutQueryVariables = Exact<{ [key: string]: never; }>; -export type GetAboutQuery = { __typename?: 'Query', aboutServer: { __typename?: 'AboutServerPayload', buildTime: any, buildType: string, discord: string, github: string, name: string, revision: string, version: string } }; +export type GetAboutQuery = { __typename?: 'Query', aboutServer: { __typename?: 'AboutServerPayload', buildTime: any, buildType: string, discord: string, github: string, name: string, revision: string, version: string }, aboutWebUI: { __typename?: 'WebUIUpdateInfo', channel: string, tag: string, updateAvailable: boolean } }; export type CheckForServerUpdatesQueryVariables = Exact<{ [key: string]: never; }>; diff --git a/src/lib/graphql/queries/ServerInfoQuery.ts b/src/lib/graphql/queries/ServerInfoQuery.ts index 91d469d0..1e84a0d2 100644 --- a/src/lib/graphql/queries/ServerInfoQuery.ts +++ b/src/lib/graphql/queries/ServerInfoQuery.ts @@ -20,6 +20,11 @@ export const GET_ABOUT = gql` revision version } + aboutWebUI { + channel + tag + updateAvailable + } } `; diff --git a/src/screens/settings/About.tsx b/src/screens/settings/About.tsx index 63ac4c64..c33a2a2d 100644 --- a/src/screens/settings/About.tsx +++ b/src/screens/settings/About.tsx @@ -11,6 +11,8 @@ import List from '@mui/material/List'; import ListItem from '@mui/material/ListItem'; import ListItemText from '@mui/material/ListItemText'; import { useTranslation } from 'react-i18next'; +import ListSubheader from '@mui/material/ListSubheader'; +import { Divider } from '@mui/material'; import { requestManager } from '@/lib/requests/RequestManager.ts'; import { ListItemLink } from '@/components/util/ListItemLink'; import { NavBarContext, useSetDefaultBackTo } from '@/components/context/NavbarContext'; @@ -26,41 +28,84 @@ export function About() { }, [t]); const { data } = requestManager.useGetAbout(); - const about = data?.aboutServer; + const { aboutServer, aboutWebUI } = data ?? {}; useSetDefaultBackTo('settings'); - if (about === undefined) { + if (!aboutServer || !aboutWebUI) { return ; } const version = () => { - if (about.buildType === 'Stable') return `${about.version}`; - return `${about.version}-${about.revision}`; + if (aboutServer.buildType === 'Stable') return `${aboutServer.version}`; + return `${aboutServer.version}-${aboutServer.revision}`; }; - const buildTime = () => new Date(about.buildTime * 1000).toUTCString(); + const buildTime = () => new Date(aboutServer.buildTime * 1000).toUTCString(); return ( - - - - - - - - - - - - - - - + + {t('settings.server.title.server')} + + } + > + + + + + + + + + + + + + {t('settings.webui.title.webui')} + + } + > + + + + + + + + + + {t('global.label.links')} + + } + > + + + + + + + + + + ); } diff --git a/src/screens/settings/ServerSettings.tsx b/src/screens/settings/ServerSettings.tsx index 10c7979c..1ddd8277 100644 --- a/src/screens/settings/ServerSettings.tsx +++ b/src/screens/settings/ServerSettings.tsx @@ -91,7 +91,7 @@ export const ServerSettings = () => { } >