修改定时任务支持的排序顺序

This commit is contained in:
whyour 2025-11-11 01:02:36 +08:00
parent 1deb264913
commit 8fdc69421c

View File

@ -361,8 +361,7 @@ const Crontab = () => {
const getCrons = () => {
setLoading(true);
const { page, size, sorter, filters } = pageConf;
let url = `${
config.apiPrefix
let url = `${config.apiPrefix
}crons?searchValue=${searchText}&page=${page}&size=${size}&filters=${JSON.stringify(
filters,
)}`;
@ -523,8 +522,7 @@ const Crontab = () => {
const enabledOrDisabledCron = (record: any, index: number) => {
Modal.confirm({
title: `确认${
record.isDisabled === 1 ? intl.get('启用') : intl.get('禁用')
title: `确认${record.isDisabled === 1 ? intl.get('启用') : intl.get('禁用')
}`,
content: (
<>
@ -540,8 +538,7 @@ const Crontab = () => {
onOk() {
request
.put(
`${config.apiPrefix}crons/${
record.isDisabled === 1 ? 'enable' : 'disable'
`${config.apiPrefix}crons/${record.isDisabled === 1 ? 'enable' : 'disable'
}`,
[record.id],
)
@ -565,8 +562,7 @@ const Crontab = () => {
const pinOrUnPinCron = (record: any, index: number) => {
Modal.confirm({
title: `确认${
record.isPinned === 1 ? intl.get('取消置顶') : intl.get('置顶')
title: `确认${record.isPinned === 1 ? intl.get('取消置顶') : intl.get('置顶')
}`,
content: (
<>
@ -582,8 +578,7 @@ const Crontab = () => {
onOk() {
request
.put(
`${config.apiPrefix}crons/${
record.isPinned === 1 ? 'unpin' : 'pin'
`${config.apiPrefix}crons/${record.isPinned === 1 ? 'unpin' : 'pin'
}`,
[record.id],
)
@ -1014,6 +1009,7 @@ const Crontab = () => {
)}
<Table
columns={columns}
sortDirections={['descend', 'ascend']}
pagination={{
current: pageConf.page,
pageSize: pageConf.size,