mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-17 01:14:50 +08:00
修改编辑cron数据交互
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user