1
0
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:
ssongliu 2023-07-12 14:35:15 +08:00 committed by GitHub
parent 1a891cb048
commit f40b053e5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -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)

View File

@ -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);