From 65d6432dad5955ed17bb84e12195f14d94f24c40 Mon Sep 17 00:00:00 2001 From: hanhh <18330117883@163.com> Date: Mon, 16 Aug 2021 14:31:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=87=8D=E5=90=AF=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E5=BB=B6=E8=BF=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shell/update.sh | 5 ++--- src/layouts/index.less | 8 ++++++++ src/pages/crontab/logModal.tsx | 16 +++++++++++++--- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/shell/update.sh b/shell/update.sh index dd78859c..208eec6b 100755 --- a/shell/update.sh +++ b/shell/update.sh @@ -135,7 +135,6 @@ add_cron() { ## 更新仓库 update_repo() { - echo -e "--------------------------------------------------------------\n" local url="$1" local path="$2" local blackword="$3" @@ -285,10 +284,10 @@ update_qinglong() { rm -rf $dir_root/build && rm -rf $dir_root/dist cp -rf $ql_static_repo/* $dir_root if [[ $no_restart != "no-restart" ]]; then - reload_pm2 nginx -s reload 2>/dev/null || nginx -c /etc/nginx/nginx.conf - sleep 3 echo -e "重启面板中..." + sleep 3 + reload_pm2 fi else echo -e "\n更新$dir_root失败,请检查原因...\n" diff --git a/src/layouts/index.less b/src/layouts/index.less index c0425d83..773a83db 100644 --- a/src/layouts/index.less +++ b/src/layouts/index.less @@ -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; + } +} diff --git a/src/pages/crontab/logModal.tsx b/src/pages/crontab/logModal.tsx index 2fe35912..b33faca4 100644 --- a/src/pages/crontab/logModal.tsx +++ b/src/pages/crontab/logModal.tsx @@ -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: ( + + 系统将在 + + 秒后自动刷新 + + ), + duration: 10, + }); setTimeout(() => { window.location.reload(); - }, 5000); + }, 10000); } } })