增加清空节点同步任务、清空DNS同步任务功能

This commit is contained in:
GoEdgeLab
2023-07-02 17:29:00 +08:00
parent 198139446d
commit 99c930bde7
8 changed files with 81 additions and 7 deletions

View File

@@ -0,0 +1,25 @@
// Copyright 2023 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cn .
package tasks
import (
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
)
type DeleteAllAction struct {
actionutils.ParentAction
}
func (this *DeleteAllAction) RunPost(params struct{}) {
defer this.CreateLogInfo(codes.NodeTask_LogDeleteAllNodeTasks)
_, err := this.RPC().NodeTaskRPC().DeleteAllNodeTasks(this.AdminContext(), &pb.DeleteAllNodeTasksRequest{})
if err != nil {
this.ErrorPage(err)
return
}
this.Success()
}

View File

@@ -17,6 +17,7 @@ func init() {
Post("/check", new(CheckAction)).
Post("/delete", new(DeleteAction)).
Post("/deleteBatch", new(DeleteBatchAction)).
Post("/deleteAll", new(DeleteAllAction)).
EndAll()
})