From 262b29ee28999003cf5a4188e0c3055e334d701c Mon Sep 17 00:00:00 2001 From: shuai Date: Fri, 4 Nov 2022 14:54:59 +0800 Subject: [PATCH] fix: delete upgrade page --- ui/src/i18n/locales/en.json | 9 ----- ui/src/pages/Upgrade/index.tsx | 72 ---------------------------------- ui/src/router/routes.ts | 4 -- ui/src/services/common.ts | 4 -- 4 files changed, 89 deletions(-) delete mode 100644 ui/src/pages/Upgrade/index.tsx diff --git a/ui/src/i18n/locales/en.json b/ui/src/i18n/locales/en.json index 4f0de90b..5b767092 100644 --- a/ui/src/i18n/locales/en.json +++ b/ui/src/i18n/locales/en.json @@ -830,15 +830,6 @@ "installed": "Already installed", "installed_description": "You appear to have already installed. To reinstall please clear your old database tables first." }, - "upgrade": { - "title": "Answer", - "update_btn": "Update data", - "update_title": "Data update required", - "update_description": "<1>Answer has been updated! Before you continue, we have to update your data to the newest version.<1>The update process may take a little while, so please be patient.", - "done_title": "No update required", - "done_btn": "Done", - "done_desscription": "Your Answer data is already up-to-date." - }, "page_404": { "description": "Unfortunately, this page doesn't exist.", "back_home": "Back to homepage" diff --git a/ui/src/pages/Upgrade/index.tsx b/ui/src/pages/Upgrade/index.tsx deleted file mode 100644 index c264e46c..00000000 --- a/ui/src/pages/Upgrade/index.tsx +++ /dev/null @@ -1,72 +0,0 @@ -import { useState } from 'react'; -import { Container, Row, Col, Card, Button, Spinner } from 'react-bootstrap'; -import { useTranslation, Trans } from 'react-i18next'; - -import { PageTitle } from '@/components'; -import { upgradSystem } from '@/services'; - -const Index = () => { - const { t } = useTranslation('translation', { - keyPrefix: 'upgrade', - }); - const [step] = useState(1); - const [loading, setLoading] = useState(false); - - const handleUpdate = async () => { - await upgradSystem(); - setLoading(true); - }; - return ( -
- - - - -

{t('title')}

- - - {step === 1 && ( - <> -
{t('update_title')}
- }} - /> - {loading ? ( - - ) : ( - - )} - - )} - - {step === 2 && ( - <> -
{t('done_title')}
-

{t('done_desscription')}

- - - )} -
-
- -
-
-
- ); -}; - -export default Index; diff --git a/ui/src/router/routes.ts b/ui/src/router/routes.ts index 5723a4e2..24016d0a 100644 --- a/ui/src/router/routes.ts +++ b/ui/src/router/routes.ts @@ -269,9 +269,5 @@ const routes: RouteNode[] = [ path: '/maintenance', page: 'pages/Maintenance', }, - { - path: '/upgrade', - page: 'pages/Upgrade', - }, ]; export default routes; diff --git a/ui/src/services/common.ts b/ui/src/services/common.ts index 7b4db720..1ddc7f18 100644 --- a/ui/src/services/common.ts +++ b/ui/src/services/common.ts @@ -248,7 +248,3 @@ export const changeEmailVerify = (params: { code: string }) => { export const getAppSettings = () => { return request.get('/answer/api/v1/siteinfo'); }; - -export const upgradSystem = () => { - return request.post('/answer/api/v1/upgradation'); -};