mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-17 01:14:50 +08:00
ck管理增加排序,禁用,实时状态变成手动获取
This commit is contained in:
@@ -169,7 +169,11 @@ const Crontab = () => {
|
||||
title: '确认删除',
|
||||
content: (
|
||||
<>
|
||||
确认删除定时任务 <Text type="warning">{record.name}</Text> 吗
|
||||
确认删除定时任务{' '}
|
||||
<Text style={{ wordBreak: 'break-all' }} type="warning">
|
||||
{record.name}
|
||||
</Text>{' '}
|
||||
吗
|
||||
</>
|
||||
),
|
||||
onOk() {
|
||||
@@ -201,7 +205,11 @@ const Crontab = () => {
|
||||
title: '确认运行',
|
||||
content: (
|
||||
<>
|
||||
确认运行定时任务 <Text type="warning">{record.name}</Text> 吗
|
||||
确认运行定时任务{' '}
|
||||
<Text style={{ wordBreak: 'break-all' }} type="warning">
|
||||
{record.name}
|
||||
</Text>{' '}
|
||||
吗
|
||||
</>
|
||||
),
|
||||
onOk() {
|
||||
@@ -236,7 +244,11 @@ const Crontab = () => {
|
||||
content: (
|
||||
<>
|
||||
确认{record.status === CrontabStatus.disabled ? '启用' : '禁用'}
|
||||
定时任务 <Text type="warning">{record.name}</Text> 吗
|
||||
定时任务{' '}
|
||||
<Text style={{ wordBreak: 'break-all' }} type="warning">
|
||||
{record.name}
|
||||
</Text>{' '}
|
||||
吗
|
||||
</>
|
||||
),
|
||||
onOk() {
|
||||
@@ -415,7 +427,7 @@ const Crontab = () => {
|
||||
defaultPageSize: 20,
|
||||
}}
|
||||
dataSource={value}
|
||||
rowKey="pin"
|
||||
rowKey="_id"
|
||||
size="middle"
|
||||
bordered
|
||||
scroll={{ x: 768 }}
|
||||
|
||||
@@ -3,6 +3,12 @@ import { Modal, notification, Input, Form } from 'antd';
|
||||
import { request } from '@/utils/http';
|
||||
import config from '@/utils/config';
|
||||
|
||||
enum CrontabStatus {
|
||||
'running',
|
||||
'idle',
|
||||
'disabled',
|
||||
}
|
||||
|
||||
const CronLogModal = ({
|
||||
cron,
|
||||
handleCancel,
|
||||
@@ -12,14 +18,14 @@ const CronLogModal = ({
|
||||
visible: boolean;
|
||||
handleCancel: () => void;
|
||||
}) => {
|
||||
const [value, setValue] = useState<string>('运行中...');
|
||||
const [value, setValue] = useState<string>('启动中...');
|
||||
const [logTimer, setLogTimer] = useState<any>();
|
||||
|
||||
const getCronLog = () => {
|
||||
request
|
||||
.get(`${config.apiPrefix}crons/${cron._id}/log`)
|
||||
.then((data: any) => {
|
||||
setValue(data.data);
|
||||
setValue(data.data || '暂无日志');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user