增加重启刷新延迟

This commit is contained in:
hanhh
2021-08-16 14:31:14 +08:00
parent 4929fa0440
commit 65d6432dad
3 changed files with 23 additions and 6 deletions
+8
View File
@@ -245,3 +245,11 @@ input:-webkit-autofill:active {
padding: 0;
}
}
.ant-message .ant-statistic {
display: inline-block;
.ant-statistic-content {
font-size: 14px;
padding: 0 3px;
}
}
+13 -3
View File
@@ -1,5 +1,5 @@
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 config from '@/utils/config';
import {
@@ -13,6 +13,7 @@ enum CrontabStatus {
'disabled',
'queued',
}
const { Countdown } = Statistic;
const CronLogModal = ({
cron,
@@ -52,10 +53,19 @@ const CronLogModal = ({
log.includes('重启面板') &&
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(() => {
window.location.reload();
}, 5000);
}, 10000);
}
}
})