diff --git a/back/loaders/initData.ts b/back/loaders/initData.ts
index ee87da6f..52eabf69 100644
--- a/back/loaders/initData.ts
+++ b/back/loaders/initData.ts
@@ -9,8 +9,8 @@ const initData = [
name: '更新面板',
command: `ql update`,
schedule: `${randomSchedule(60, 1)} ${randomSchedule(
- 24,
- 7,
+ 6,
+ 1,
).toString()} * * *`,
status: CrontabStatus.idle,
},
diff --git a/src/pages/crontab/index.tsx b/src/pages/crontab/index.tsx
index b94a1752..555b0095 100644
--- a/src/pages/crontab/index.tsx
+++ b/src/pages/crontab/index.tsx
@@ -14,7 +14,7 @@ import {
} from 'antd';
import {
ClockCircleOutlined,
- SyncOutlined,
+ Loading3QuartersOutlined,
CloseCircleOutlined,
FileTextOutlined,
EllipsisOutlined,
@@ -105,7 +105,7 @@ const Crontab = () => {
)}
{record.status === CrontabStatus.running && (
- } color="processing">
+ } color="processing">
运行中
)}
diff --git a/src/pages/crontab/logModal.tsx b/src/pages/crontab/logModal.tsx
index 452797aa..0cd50cdd 100644
--- a/src/pages/crontab/logModal.tsx
+++ b/src/pages/crontab/logModal.tsx
@@ -2,6 +2,10 @@ import React, { useEffect, useState } from 'react';
import { Modal, notification, Input, Form } from 'antd';
import { request } from '@/utils/http';
import config from '@/utils/config';
+import {
+ Loading3QuartersOutlined,
+ CheckCircleOutlined,
+} from '@ant-design/icons';
enum CrontabStatus {
'running',
@@ -20,6 +24,7 @@ const CronLogModal = ({
}) => {
const [value, setValue] = useState('启动中...');
const [loading, setLoading] = useState(true);
+ const [excuting, setExcuting] = useState(true);
const getCronLog = (isFirst?: boolean) => {
if (isFirst) {
@@ -31,6 +36,7 @@ const CronLogModal = ({
if (localStorage.getItem('logCron') === cron._id) {
const log = data.data as string;
setValue(log || '暂无日志');
+ setExcuting(log && !log.includes('执行结束'));
if (log && !log.includes('执行结束')) {
setTimeout(() => {
getCronLog();
@@ -50,6 +56,16 @@ const CronLogModal = ({
handleCancel();
};
+ const titleElement = () => {
+ return (
+ <>
+ 日志-{cron && cron.name}{' '}
+ {excuting && }
+ {!excuting && }
+ >
+ );
+ };
+
useEffect(() => {
if (cron) {
getCronLog(true);
@@ -58,7 +74,7 @@ const CronLogModal = ({
return (
cancel()}