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()
|
defer ar.Close()
|
||||||
commonDir := file.CommonPrefix(filepath.Separator, list...)
|
commonDir := file.CommonPrefix(filepath.Separator, list...)
|
||||||
|
|
||||||
|
|
||||||
currentPath := filepath.Base(commonDir)
|
currentPath := filepath.Base(commonDir)
|
||||||
|
|
||||||
name := "_" + currentPath
|
name := "_" + currentPath
|
||||||
@ -515,7 +516,9 @@ func PostOperateFileOrDir(c *gin.Context) {
|
|||||||
if len(service.OpStrArr) == 1 {
|
if len(service.OpStrArr) == 1 {
|
||||||
go service.ExecOpFile()
|
go service.ExecOpFile()
|
||||||
go service.CheckFileStatus()
|
go service.CheckFileStatus()
|
||||||
|
|
||||||
go service.MyService.Notify().SendFileOperateNotify(false)
|
go service.MyService.Notify().SendFileOperateNotify(false)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
c.JSON(http.StatusOK, model.Result{Success: oasis_err2.SUCCESS, Message: oasis_err2.GetMsg(oasis_err2.SUCCESS)})
|
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) {
|
func (i *notifyServer) SendFileOperateNotify(nowSend bool) {
|
||||||
|
|
||||||
if nowSend {
|
if nowSend {
|
||||||
|
|
||||||
len := 0
|
len := 0
|
||||||
FileQueue.Range(func(k, v interface{}) bool {
|
FileQueue.Range(func(k, v interface{}) bool {
|
||||||
len++
|
len++
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
|
|
||||||
model := notify.NotifyModel{}
|
model := notify.NotifyModel{}
|
||||||
listMsg := make(map[string]interface{})
|
listMsg := make(map[string]interface{})
|
||||||
if len == 0 {
|
if len == 0 {
|
||||||
@ -91,7 +93,9 @@ func (i *notifyServer) SendFileOperateNotify(nowSend bool) {
|
|||||||
} else {
|
} else {
|
||||||
task.Status = "PROCESSING"
|
task.Status = "PROCESSING"
|
||||||
}
|
}
|
||||||
|
|
||||||
if temp.ProcessedSize >= temp.TotalSize {
|
if temp.ProcessedSize >= temp.TotalSize {
|
||||||
|
|
||||||
task.Finished = true
|
task.Finished = true
|
||||||
task.Status = "FINISHED"
|
task.Status = "FINISHED"
|
||||||
FileQueue.Delete(v)
|
FileQueue.Delete(v)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user