mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-03 12:20:28 +08:00
增加清空节点同步任务、清空DNS同步任务功能
This commit is contained in:
25
internal/web/actions/default/clusters/tasks/deleteAll.go
Normal file
25
internal/web/actions/default/clusters/tasks/deleteAll.go
Normal 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()
|
||||
}
|
||||
@@ -17,6 +17,7 @@ func init() {
|
||||
Post("/check", new(CheckAction)).
|
||||
Post("/delete", new(DeleteAction)).
|
||||
Post("/deleteBatch", new(DeleteBatchAction)).
|
||||
Post("/deleteAll", new(DeleteAllAction)).
|
||||
|
||||
EndAll()
|
||||
})
|
||||
|
||||
25
internal/web/actions/default/dns/tasks/deleteAll.go
Normal file
25
internal/web/actions/default/dns/tasks/deleteAll.go
Normal 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.DNSTask_LogDeleteAllDNSTasks)
|
||||
|
||||
_, err := this.RPC().DNSTaskRPC().DeleteAllDNSTasks(this.AdminContext(), &pb.DeleteAllDNSTasksRequest{})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
|
||||
this.Success()
|
||||
}
|
||||
@@ -16,7 +16,7 @@ func init() {
|
||||
GetPost("/listPopup", new(ListPopupAction)).
|
||||
Post("/check", new(CheckAction)).
|
||||
Post("/delete", new(DeleteAction)).
|
||||
|
||||
Post("/deleteAll", new(DeleteAllAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user