mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 23:06:06 +08:00
增加重启刷新延迟
This commit is contained in:
parent
4929fa0440
commit
65d6432dad
|
@ -135,7 +135,6 @@ add_cron() {
|
||||||
|
|
||||||
## 更新仓库
|
## 更新仓库
|
||||||
update_repo() {
|
update_repo() {
|
||||||
echo -e "--------------------------------------------------------------\n"
|
|
||||||
local url="$1"
|
local url="$1"
|
||||||
local path="$2"
|
local path="$2"
|
||||||
local blackword="$3"
|
local blackword="$3"
|
||||||
|
@ -285,10 +284,10 @@ update_qinglong() {
|
||||||
rm -rf $dir_root/build && rm -rf $dir_root/dist
|
rm -rf $dir_root/build && rm -rf $dir_root/dist
|
||||||
cp -rf $ql_static_repo/* $dir_root
|
cp -rf $ql_static_repo/* $dir_root
|
||||||
if [[ $no_restart != "no-restart" ]]; then
|
if [[ $no_restart != "no-restart" ]]; then
|
||||||
reload_pm2
|
|
||||||
nginx -s reload 2>/dev/null || nginx -c /etc/nginx/nginx.conf
|
nginx -s reload 2>/dev/null || nginx -c /etc/nginx/nginx.conf
|
||||||
sleep 3
|
|
||||||
echo -e "重启面板中..."
|
echo -e "重启面板中..."
|
||||||
|
sleep 3
|
||||||
|
reload_pm2
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo -e "\n更新$dir_root失败,请检查原因...\n"
|
echo -e "\n更新$dir_root失败,请检查原因...\n"
|
||||||
|
|
|
@ -245,3 +245,11 @@ input:-webkit-autofill:active {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ant-message .ant-statistic {
|
||||||
|
display: inline-block;
|
||||||
|
.ant-statistic-content {
|
||||||
|
font-size: 14px;
|
||||||
|
padding: 0 3px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Modal, message, Input, Form } from 'antd';
|
import { Modal, message, Input, Form, Statistic } from 'antd';
|
||||||
import { request } from '@/utils/http';
|
import { request } from '@/utils/http';
|
||||||
import config from '@/utils/config';
|
import config from '@/utils/config';
|
||||||
import {
|
import {
|
||||||
|
@ -13,6 +13,7 @@ enum CrontabStatus {
|
||||||
'disabled',
|
'disabled',
|
||||||
'queued',
|
'queued',
|
||||||
}
|
}
|
||||||
|
const { Countdown } = Statistic;
|
||||||
|
|
||||||
const CronLogModal = ({
|
const CronLogModal = ({
|
||||||
cron,
|
cron,
|
||||||
|
@ -52,10 +53,19 @@ const CronLogModal = ({
|
||||||
log.includes('重启面板') &&
|
log.includes('重启面板') &&
|
||||||
cron.status === CrontabStatus.running
|
cron.status === CrontabStatus.running
|
||||||
) {
|
) {
|
||||||
message.warning({ content: '系统将在5秒后自动刷新', duration: 5 });
|
message.warning({
|
||||||
|
content: (
|
||||||
|
<span>
|
||||||
|
系统将在
|
||||||
|
<Countdown format="ss" value={Date.now() + 1000 * 10} />
|
||||||
|
秒后自动刷新
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
duration: 10,
|
||||||
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}, 5000);
|
}, 10000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user