mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 23:06:06 +08:00
修复定时任务状态筛选
This commit is contained in:
parent
f19dd21155
commit
a25bfb6912
|
@ -18,7 +18,7 @@ import { TASK_PREFIX, QL_PREFIX } from '../config/const';
|
||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
export default class CronService {
|
export default class CronService {
|
||||||
constructor(@Inject('logger') private logger: winston.Logger) { }
|
constructor(@Inject('logger') private logger: winston.Logger) {}
|
||||||
|
|
||||||
private isSixCron(cron: Crontab) {
|
private isSixCron(cron: Crontab) {
|
||||||
const { schedule } = cron;
|
const { schedule } = cron;
|
||||||
|
@ -246,8 +246,12 @@ export default class CronService {
|
||||||
for (const key of filterKeys) {
|
for (const key of filterKeys) {
|
||||||
let q: any = {};
|
let q: any = {};
|
||||||
if (!filterQuery[key]) continue;
|
if (!filterQuery[key]) continue;
|
||||||
if (key === 'status' && filterQuery[key].includes(2)) {
|
if (key === 'status') {
|
||||||
q = { [Op.or]: [{ [key]: filterQuery[key] }, { isDisabled: 1 }] };
|
if (filterQuery[key].includes(2)) {
|
||||||
|
q = { [Op.or]: [{ [key]: filterQuery[key] }, { isDisabled: 1 }] };
|
||||||
|
} else {
|
||||||
|
q = { [Op.and]: [{ [key]: filterQuery[key] }, { isDisabled: 0 }] };
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
q[key] = filterQuery[key];
|
q[key] = filterQuery[key];
|
||||||
}
|
}
|
||||||
|
@ -264,7 +268,11 @@ export default class CronService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async find({ log_path }: { log_path: string }): Promise<Crontab | null> {
|
public async find({
|
||||||
|
log_path,
|
||||||
|
}: {
|
||||||
|
log_path: string;
|
||||||
|
}): Promise<Crontab | null> {
|
||||||
try {
|
try {
|
||||||
const result = await CrontabModel.findOne({ where: { log_path } });
|
const result = await CrontabModel.findOne({ where: { log_path } });
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -279,13 +279,6 @@ const Crontab = () => {
|
||||||
value: 3,
|
value: 3,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
onFilter: (value, record) => {
|
|
||||||
if (record.isDisabled && record.status !== 0) {
|
|
||||||
return value === 2;
|
|
||||||
} else {
|
|
||||||
return record.status === value;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<>
|
<>
|
||||||
{(!record.isDisabled || record.status !== CrontabStatus.idle) && (
|
{(!record.isDisabled || record.status !== CrontabStatus.idle) && (
|
||||||
|
@ -1051,7 +1044,7 @@ const Crontab = () => {
|
||||||
rowSelection={rowSelection}
|
rowSelection={rowSelection}
|
||||||
rowClassName={getRowClassName}
|
rowClassName={getRowClassName}
|
||||||
onChange={onPageChange}
|
onChange={onPageChange}
|
||||||
components={isPhone ? undefined : vt}
|
// components={isPhone ? undefined : vt}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<CronLogModal
|
<CronLogModal
|
||||||
|
|
Loading…
Reference in New Issue
Block a user