mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 22:18:07 +08:00
fix: 计划任务详情页删除时刷新选中值 (#1616)
This commit is contained in:
parent
1a891cb048
commit
f40b053e5b
@ -186,6 +186,8 @@ func (u *CronjobService) HandleRmExpired(backType, backupPath, localDir string,
|
|||||||
itemPath := strings.TrimPrefix(backupPath, "/")
|
itemPath := strings.TrimPrefix(backupPath, "/")
|
||||||
itemPath = strings.TrimSuffix(itemPath, "/") + "/"
|
itemPath = strings.TrimSuffix(itemPath, "/") + "/"
|
||||||
fileItem = itemPath + strings.TrimPrefix(file, localDir+"/")
|
fileItem = itemPath + strings.TrimPrefix(file, localDir+"/")
|
||||||
|
} else {
|
||||||
|
fileItem = strings.TrimPrefix(file, localDir+"/")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_, _ = backClient.Delete(fileItem)
|
_, _ = backClient.Delete(fileItem)
|
||||||
|
@ -528,12 +528,17 @@ const search = async () => {
|
|||||||
if (!currentRecord.value) {
|
if (!currentRecord.value) {
|
||||||
currentRecord.value = records.value[0];
|
currentRecord.value = records.value[0];
|
||||||
} else {
|
} else {
|
||||||
|
let beDelete = true;
|
||||||
for (const item of records.value) {
|
for (const item of records.value) {
|
||||||
if (item.id === currentRecord.value.id) {
|
if (item.id === currentRecord.value.id) {
|
||||||
|
beDelete = false;
|
||||||
currentRecord.value = item;
|
currentRecord.value = item;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (beDelete) {
|
||||||
|
currentRecord.value = records.value[0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (currentRecord.value?.records) {
|
if (currentRecord.value?.records) {
|
||||||
loadRecord(currentRecord.value);
|
loadRecord(currentRecord.value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user