mirror of
https://github.com/whyour/qinglong.git
synced 2025-07-08 20:52:29 +08:00
修改定时任务打开详情交互
This commit is contained in:
parent
8d24949202
commit
6f5a5fe066
|
@ -2,12 +2,6 @@
|
||||||
margin-bottom: 0 !important;
|
margin-bottom: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cron {
|
|
||||||
&:hover {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.crontab-detail {
|
.crontab-detail {
|
||||||
.card-wrapper {
|
.card-wrapper {
|
||||||
height: 80vh;
|
height: 80vh;
|
||||||
|
|
|
@ -93,10 +93,11 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => {
|
||||||
<>
|
<>
|
||||||
<a
|
<a
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
goToScriptManager(record);
|
setDetailCron(record);
|
||||||
|
setIsDetailModalVisible(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{record.labels?.length > 0 && record.labels[0] !== '' ? (
|
{record.labels?.length > 0 && record.labels[0] !== '' && false ? (
|
||||||
<Popover
|
<Popover
|
||||||
placement="right"
|
placement="right"
|
||||||
trigger={isPhone ? 'click' : 'hover'}
|
trigger={isPhone ? 'click' : 'hover'}
|
||||||
|
@ -109,6 +110,7 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => {
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
setSearchValue(`label:${label}`);
|
setSearchValue(`label:${label}`);
|
||||||
|
setSearchText(`label:${label}`);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<a>{label}</a>
|
<a>{label}</a>
|
||||||
|
@ -140,7 +142,7 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => {
|
||||||
title: '命令',
|
title: '命令',
|
||||||
dataIndex: 'command',
|
dataIndex: 'command',
|
||||||
key: 'command',
|
key: 'command',
|
||||||
width: 250,
|
width: 300,
|
||||||
align: 'center' as const,
|
align: 'center' as const,
|
||||||
render: (text: string, record: any) => {
|
render: (text: string, record: any) => {
|
||||||
return (
|
return (
|
||||||
|
@ -152,7 +154,13 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => {
|
||||||
}}
|
}}
|
||||||
ellipsis={{ tooltip: text, rows: 2 }}
|
ellipsis={{ tooltip: text, rows: 2 }}
|
||||||
>
|
>
|
||||||
{text}
|
<a
|
||||||
|
onClick={() => {
|
||||||
|
goToScriptManager(record);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{text}
|
||||||
|
</a>
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -189,10 +197,10 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => {
|
||||||
>
|
>
|
||||||
{record.last_execution_time
|
{record.last_execution_time
|
||||||
? new Date(record.last_execution_time * 1000)
|
? new Date(record.last_execution_time * 1000)
|
||||||
.toLocaleString(language, {
|
.toLocaleString(language, {
|
||||||
hour12: false,
|
hour12: false,
|
||||||
})
|
})
|
||||||
.replace(' 24:', ' 00:')
|
.replace(' 24:', ' 00:')
|
||||||
: '-'}
|
: '-'}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
|
@ -396,9 +404,8 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => {
|
||||||
const { page, size, sorter } = pageConf;
|
const { page, size, sorter } = pageConf;
|
||||||
let url = `${config.apiPrefix}crons?searchValue=${searchText}&page=${page}&size=${size}`;
|
let url = `${config.apiPrefix}crons?searchValue=${searchText}&page=${page}&size=${size}`;
|
||||||
if (sorter && sorter.field) {
|
if (sorter && sorter.field) {
|
||||||
url += `&sortField=${sorter.field}&sortType=${
|
url += `&sortField=${sorter.field}&sortType=${sorter.order === 'ascend' ? 'ASC' : 'DESC'
|
||||||
sorter.order === 'ascend' ? 'ASC' : 'DESC'
|
}`;
|
||||||
}`;
|
|
||||||
}
|
}
|
||||||
if (viewConf) {
|
if (viewConf) {
|
||||||
url += `&queryString=${JSON.stringify({
|
url += `&queryString=${JSON.stringify({
|
||||||
|
@ -562,8 +569,7 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => {
|
||||||
onOk() {
|
onOk() {
|
||||||
request
|
request
|
||||||
.put(
|
.put(
|
||||||
`${config.apiPrefix}crons/${
|
`${config.apiPrefix}crons/${record.isDisabled === 1 ? 'enable' : 'disable'
|
||||||
record.isDisabled === 1 ? 'enable' : 'disable'
|
|
||||||
}`,
|
}`,
|
||||||
{
|
{
|
||||||
data: [record.id],
|
data: [record.id],
|
||||||
|
@ -608,8 +614,7 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => {
|
||||||
onOk() {
|
onOk() {
|
||||||
request
|
request
|
||||||
.put(
|
.put(
|
||||||
`${config.apiPrefix}crons/${
|
`${config.apiPrefix}crons/${record.isPinned === 1 ? 'unpin' : 'pin'
|
||||||
record.isPinned === 1 ? 'unpin' : 'pin'
|
|
||||||
}`,
|
}`,
|
||||||
{
|
{
|
||||||
data: [record.id],
|
data: [record.id],
|
||||||
|
@ -931,14 +936,6 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => {
|
||||||
(a, b) => a - b,
|
(a, b) => a - b,
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
onRow={(record) => {
|
|
||||||
return {
|
|
||||||
onClick: (event) => {
|
|
||||||
setDetailCron(record);
|
|
||||||
setIsDetailModalVisible(true);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}}
|
|
||||||
dataSource={value}
|
dataSource={value}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
size="middle"
|
size="middle"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user