fix(file): fix issue with download process not work (#8237)

This commit is contained in:
zhengkunwang 2025-03-25 17:27:34 +08:00 committed by GitHub
parent 06b7ae2a38
commit b871c710b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 4 deletions

View file

@ -789,9 +789,6 @@ func (b *BaseApi) ProcessKeys(c *gin.Context) {
continue
}
res.Keys = append(res.Keys, key)
if process.Percent == 100 {
global.CACHE.Del(key)
}
}
helper.SuccessWithData(c, res)
}

View file

@ -142,6 +142,9 @@ func getDownloadProcess(progress DownloadProgress) (res []byte, err error) {
downloadProcess := &files.Process{}
_ = json.Unmarshal([]byte(value), downloadProcess)
result = append(result, *downloadProcess)
if downloadProcess.Percent == 100 {
global.CACHE.Del(k)
}
}
res, err = json.Marshal(result)
return

View file

@ -1,5 +1,11 @@
<template>
<DrawerPro v-model="open" :header="title" @close="handleClose" size="large" :fullScreen="true">
<DrawerPro
v-model="open"
:header="title"
@close="handleClose"
:size="globalStore.isFullScreen ? 'full' : 'large'"
:fullScreen="true"
>
<template #content>
<div v-if="req.file != 'config'">
<el-tabs v-model="req.file" type="card" @tab-click="handleChange">
@ -36,6 +42,8 @@ import { operateSupervisorProcessFile } from '@/api/modules/host-tool';
import i18n from '@/lang';
import { TabsPaneContext } from 'element-plus';
import { MsgSuccess } from '@/utils/message';
import { GlobalStore } from '@/store';
const globalStore = GlobalStore();
const loading = ref(false);
const content = ref('');