mirror of
https://github.com/whyour/qinglong.git
synced 2025-11-13 11:06:07 +08:00
修改定时任务支持的排序顺序
This commit is contained in:
parent
1deb264913
commit
8fdc69421c
|
|
@ -247,8 +247,8 @@ const Crontab = () => {
|
|||
>
|
||||
{record.last_execution_time
|
||||
? dayjs(record.last_execution_time * 1000).format(
|
||||
'YYYY-MM-DD HH:mm:ss',
|
||||
)
|
||||
'YYYY-MM-DD HH:mm:ss',
|
||||
)
|
||||
: '-'}
|
||||
</span>
|
||||
);
|
||||
|
|
@ -361,11 +361,10 @@ const Crontab = () => {
|
|||
const getCrons = () => {
|
||||
setLoading(true);
|
||||
const { page, size, sorter, filters } = pageConf;
|
||||
let url = `${
|
||||
config.apiPrefix
|
||||
}crons?searchValue=${searchText}&page=${page}&size=${size}&filters=${JSON.stringify(
|
||||
filters,
|
||||
)}`;
|
||||
let url = `${config.apiPrefix
|
||||
}crons?searchValue=${searchText}&page=${page}&size=${size}&filters=${JSON.stringify(
|
||||
filters,
|
||||
)}`;
|
||||
if (sorter && sorter.column && sorter.order) {
|
||||
url += `&sorter=${JSON.stringify({
|
||||
field: sorter.column.key,
|
||||
|
|
@ -523,9 +522,8 @@ 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: (
|
||||
<>
|
||||
{intl.get('确认')}
|
||||
|
|
@ -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,9 +562,8 @@ 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: (
|
||||
<>
|
||||
{intl.get('确认')}
|
||||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user