mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 06:46:09 +08:00
修改编辑cron数据交互
This commit is contained in:
parent
a6abc15126
commit
1d1eee3513
|
@ -338,7 +338,7 @@ const Crontab = () => {
|
|||
const handleCancel = (needUpdate?: boolean) => {
|
||||
setIsModalVisible(false);
|
||||
if (needUpdate) {
|
||||
getCrons();
|
||||
getCronDetail(editedCron);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -346,15 +346,15 @@ const Crontab = () => {
|
|||
setSearchText(value);
|
||||
};
|
||||
|
||||
const getCronDetail = () => {
|
||||
const getCronDetail = (cron: any) => {
|
||||
request
|
||||
.get(`${config.apiPrefix}crons/${logCron._id}`)
|
||||
.get(`${config.apiPrefix}crons/${cron._id}`)
|
||||
.then((data: any) => {
|
||||
const index = value.findIndex((x) => x._id === logCron._id);
|
||||
const index = value.findIndex((x) => x._id === cron._id);
|
||||
const result = [...value];
|
||||
result.splice(index, 1, {
|
||||
...logCron,
|
||||
status: data.data.status,
|
||||
...cron,
|
||||
...data.data,
|
||||
});
|
||||
setValue(result);
|
||||
})
|
||||
|
@ -423,7 +423,7 @@ const Crontab = () => {
|
|||
<CronLogModal
|
||||
visible={isLogModalVisible}
|
||||
handleCancel={() => {
|
||||
getCronDetail();
|
||||
getCronDetail(logCron);
|
||||
setIsLogModalVisible(false);
|
||||
}}
|
||||
cron={logCron}
|
||||
|
|
Loading…
Reference in New Issue
Block a user