mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-03 20:40:26 +08:00
实现批量删除网站功能
This commit is contained in:
28
internal/web/actions/default/servers/deleteServers.go
Normal file
28
internal/web/actions/default/servers/deleteServers.go
Normal file
@@ -0,0 +1,28 @@
|
||||
// Copyright 2024 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cn .
|
||||
|
||||
package servers
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
)
|
||||
|
||||
// DeleteServersAction 删除一组网站
|
||||
type DeleteServersAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *DeleteServersAction) RunPost(params struct {
|
||||
ServerIds []int64
|
||||
}) {
|
||||
defer this.CreateLogInfo(codes.Server_LogDeleteServers)
|
||||
|
||||
_, err := this.RPC().ServerRPC().DeleteServers(this.AdminContext(), &pb.DeleteServersRequest{ServerIds: params.ServerIds})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
|
||||
this.Success()
|
||||
}
|
||||
@@ -19,6 +19,7 @@ func init() {
|
||||
GetPost("/create", new(CreateAction)).
|
||||
GetPost("/update", new(UpdateAction)).
|
||||
Post("/nearby", new(NearbyAction)).
|
||||
Post("/deleteServers", new(DeleteServersAction)).
|
||||
|
||||
//
|
||||
GetPost("/addPortPopup", new(AddPortPopupAction)).
|
||||
|
||||
Reference in New Issue
Block a user