mirror of
https://github.com/IceWhaleTech/CasaOS.git
synced 2025-11-07 07:09:46 +00:00
Merge branch 'main' into dev
This commit is contained in:
commit
4db4393ed4
@ -199,6 +199,7 @@ func GetDownloadFile(c *gin.Context) {
|
||||
defer ar.Close()
|
||||
commonDir := file.CommonPrefix(filepath.Separator, list...)
|
||||
|
||||
|
||||
currentPath := filepath.Base(commonDir)
|
||||
|
||||
name := "_" + currentPath
|
||||
@ -515,7 +516,9 @@ func PostOperateFileOrDir(c *gin.Context) {
|
||||
if len(service.OpStrArr) == 1 {
|
||||
go service.ExecOpFile()
|
||||
go service.CheckFileStatus()
|
||||
|
||||
go service.MyService.Notify().SendFileOperateNotify(false)
|
||||
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, model.Result{Success: oasis_err2.SUCCESS, Message: oasis_err2.GetMsg(oasis_err2.SUCCESS)})
|
||||
|
||||
@ -47,11 +47,13 @@ type notifyServer struct {
|
||||
func (i *notifyServer) SendFileOperateNotify(nowSend bool) {
|
||||
|
||||
if nowSend {
|
||||
|
||||
len := 0
|
||||
FileQueue.Range(func(k, v interface{}) bool {
|
||||
len++
|
||||
return true
|
||||
})
|
||||
|
||||
model := notify.NotifyModel{}
|
||||
listMsg := make(map[string]interface{})
|
||||
if len == 0 {
|
||||
@ -91,7 +93,9 @@ func (i *notifyServer) SendFileOperateNotify(nowSend bool) {
|
||||
} else {
|
||||
task.Status = "PROCESSING"
|
||||
}
|
||||
|
||||
if temp.ProcessedSize >= temp.TotalSize {
|
||||
|
||||
task.Finished = true
|
||||
task.Status = "FINISHED"
|
||||
FileQueue.Delete(v)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user