mirror of
https://github.com/whyour/qinglong.git
synced 2025-07-07 20:06:08 +08:00
修复重启系统
This commit is contained in:
parent
9c258ab113
commit
b31eab02d7
|
@ -216,7 +216,7 @@ export default (app: Router) => {
|
||||||
'/reload',
|
'/reload',
|
||||||
celebrate({
|
celebrate({
|
||||||
body: Joi.object({
|
body: Joi.object({
|
||||||
type: Joi.string().required(),
|
type: Joi.string().optional().allow('').allow(null),
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
async (req: Request, res: Response, next: NextFunction) => {
|
async (req: Request, res: Response, next: NextFunction) => {
|
||||||
|
|
|
@ -114,9 +114,9 @@ const CheckUpdate = ({ systemInfo }: any) => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const reloadSystem = () => {
|
const reloadSystem = (type?: string) => {
|
||||||
request
|
request
|
||||||
.put(`${config.apiPrefix}system/reload`, { type: 'system' })
|
.put(`${config.apiPrefix}system/reload`, { type })
|
||||||
.then((_data: any) => {
|
.then((_data: any) => {
|
||||||
message.success({
|
message.success({
|
||||||
content: (
|
content: (
|
||||||
|
@ -150,7 +150,7 @@ const CheckUpdate = ({ systemInfo }: any) => {
|
||||||
content: intl.get('系统安装包下载成功,确认重启'),
|
content: intl.get('系统安装包下载成功,确认重启'),
|
||||||
okText: intl.get('重启'),
|
okText: intl.get('重启'),
|
||||||
onOk() {
|
onOk() {
|
||||||
reloadSystem();
|
reloadSystem('system');
|
||||||
},
|
},
|
||||||
onCancel() {
|
onCancel() {
|
||||||
modalRef.current.update({
|
modalRef.current.update({
|
||||||
|
@ -218,7 +218,11 @@ const CheckUpdate = ({ systemInfo }: any) => {
|
||||||
<Button type="primary" onClick={checkUpgrade}>
|
<Button type="primary" onClick={checkUpgrade}>
|
||||||
{intl.get('检查更新')}
|
{intl.get('检查更新')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button type="primary" onClick={reloadSystem} style={{ marginLeft: 8 }}>
|
<Button
|
||||||
|
type="primary"
|
||||||
|
onClick={() => reloadSystem()}
|
||||||
|
style={{ marginLeft: 8 }}
|
||||||
|
>
|
||||||
{intl.get('重新启动')}
|
{intl.get('重新启动')}
|
||||||
</Button>
|
</Button>
|
||||||
</>
|
</>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user