mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-10 07:26:35 +08:00
feat(file): Prevent progress display after file download completion (#8062)
This commit is contained in:
parent
9ee3832cda
commit
6092e768ef
2 changed files with 12 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
||||||
package v2
|
package v2
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
@ -761,7 +762,16 @@ func (b *BaseApi) WgetProcess(c *gin.Context) {
|
||||||
func (b *BaseApi) ProcessKeys(c *gin.Context) {
|
func (b *BaseApi) ProcessKeys(c *gin.Context) {
|
||||||
res := &response.FileProcessKeys{}
|
res := &response.FileProcessKeys{}
|
||||||
keys := global.CACHE.PrefixScanKey("file-wget-")
|
keys := global.CACHE.PrefixScanKey("file-wget-")
|
||||||
res.Keys = keys
|
for _, key := range keys {
|
||||||
|
value := global.CACHE.Get(key)
|
||||||
|
if value == "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
var process files.Process
|
||||||
|
if err := json.Unmarshal([]byte(value), &process); err == nil && process.Percent != 100 {
|
||||||
|
res.Keys = append(res.Keys, key)
|
||||||
|
}
|
||||||
|
}
|
||||||
helper.SuccessWithData(c, res)
|
helper.SuccessWithData(c, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -434,6 +434,7 @@ const mobile = computed(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const search = async () => {
|
const search = async () => {
|
||||||
|
getWgetProcess();
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
if (req.search != '') {
|
if (req.search != '') {
|
||||||
req.sortBy = 'name';
|
req.sortBy = 'name';
|
||||||
|
@ -983,7 +984,6 @@ onMounted(() => {
|
||||||
nextTick(function () {
|
nextTick(function () {
|
||||||
handlePath();
|
handlePath();
|
||||||
});
|
});
|
||||||
getWgetProcess();
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue