ck管理增加排序,禁用,实时状态变成手动获取

This commit is contained in:
whyour
2021-04-10 00:21:51 +08:00
parent ef24fc8354
commit fb98bc44e4
17 changed files with 621 additions and 522 deletions
+16 -4
View File
@@ -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 }}
+8 -2
View File
@@ -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 || '暂无日志');
});
};