mirror of https://gitee.com/answerdev/answer.git
fix: delete upgrade page
This commit is contained in:
parent
25ab726cd1
commit
262b29ee28
|
@ -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><1>The update process may take a little while, so please be patient.</1>",
|
||||
"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"
|
||||
|
|
|
@ -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 (
|
||||
<div className="page-wrap2">
|
||||
<Container style={{ paddingTop: '74px' }}>
|
||||
<PageTitle title={t('upgrade', { keyPrefix: 'page_title' })} />
|
||||
<Row className="justify-content-center">
|
||||
<Col lg={6}>
|
||||
<h2 className="text-center mb-4">{t('title')}</h2>
|
||||
<Card>
|
||||
<Card.Body>
|
||||
{step === 1 && (
|
||||
<>
|
||||
<h5>{t('update_title')}</h5>
|
||||
<Trans
|
||||
i18nKey="upgrade.update_description"
|
||||
components={{ 1: <p /> }}
|
||||
/>
|
||||
{loading ? (
|
||||
<Button variant="primary" disabled className="float-end">
|
||||
<Spinner
|
||||
as="span"
|
||||
animation="border"
|
||||
size="sm"
|
||||
role="status"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<span> {t('update_btn')}</span>
|
||||
</Button>
|
||||
) : (
|
||||
<Button className="float-end" onClick={handleUpdate}>
|
||||
{t('update_btn')}
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
{step === 2 && (
|
||||
<>
|
||||
<h5>{t('done_title')}</h5>
|
||||
<p>{t('done_desscription')}</p>
|
||||
<Button className="float-end" href="/">
|
||||
{t('done_btn')}
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
</Card.Body>
|
||||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
</Container>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Index;
|
|
@ -269,9 +269,5 @@ const routes: RouteNode[] = [
|
|||
path: '/maintenance',
|
||||
page: 'pages/Maintenance',
|
||||
},
|
||||
{
|
||||
path: '/upgrade',
|
||||
page: 'pages/Upgrade',
|
||||
},
|
||||
];
|
||||
export default routes;
|
||||
|
|
|
@ -248,7 +248,3 @@ export const changeEmailVerify = (params: { code: string }) => {
|
|||
export const getAppSettings = () => {
|
||||
return request.get<Type.SiteSettings>('/answer/api/v1/siteinfo');
|
||||
};
|
||||
|
||||
export const upgradSystem = () => {
|
||||
return request.post('/answer/api/v1/upgradation');
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue