mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-24 15:43:24 +08:00
重启系统添加倒计时提示
This commit is contained in:
parent
0afd8fcbd6
commit
d25ae98c68
|
@ -266,10 +266,9 @@ update_qinglong() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $exit_status -eq 0 ]]; then
|
if [[ $exit_status -eq 0 ]]; then
|
||||||
echo -e "重启青龙面板(后台重启)...\n"
|
|
||||||
cd $dir_root
|
cd $dir_root
|
||||||
nginx -s reload 2>/dev/null || nginx -c /etc/nginx/nginx.conf
|
nginx -s reload 2>/dev/null || nginx -c /etc/nginx/nginx.conf
|
||||||
echo -e "重启面板完成(请5s后刷新页面)..."
|
echo -e "重启面板完成"
|
||||||
pm2 reload all >/dev/null 2>&1
|
pm2 reload all >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Modal, notification, Input, Form } from 'antd';
|
import { Modal, message, Input, Form } from 'antd';
|
||||||
import { request } from '@/utils/http';
|
import { request } from '@/utils/http';
|
||||||
import config from '@/utils/config';
|
import config from '@/utils/config';
|
||||||
import {
|
import {
|
||||||
|
@ -42,6 +42,12 @@ const CronLogModal = ({
|
||||||
getCronLog();
|
getCronLog();
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
|
if (log && log.includes('重启面板完成')) {
|
||||||
|
message.warning({ content: '系统将在5秒后刷新', duration: 5 });
|
||||||
|
setTimeout(() => {
|
||||||
|
window.location.reload();
|
||||||
|
}, 5000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|
|
@ -2,14 +2,20 @@ import { extend } from 'umi-request';
|
||||||
import { notification } from 'antd';
|
import { notification } from 'antd';
|
||||||
import config from './config';
|
import config from './config';
|
||||||
|
|
||||||
|
notification.config({
|
||||||
|
duration: 2.5,
|
||||||
|
});
|
||||||
|
|
||||||
const time = Date.now();
|
const time = Date.now();
|
||||||
const errorHandler = function (error: any) {
|
const errorHandler = function (error: any) {
|
||||||
if (error.response) {
|
if (error.response) {
|
||||||
const message = error.data
|
const message = error.data
|
||||||
? error.data.message || error.data
|
? error.data.message || error.data
|
||||||
: error.response.statusText;
|
: error.response.statusText;
|
||||||
if (error.response.status !== 401) {
|
if (error.response.status !== 401 && error.response.status !== 502) {
|
||||||
notification.error({ message });
|
notification.error({ message });
|
||||||
|
} else {
|
||||||
|
console.log(error.response);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log(error.message);
|
console.log(error.message);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user