mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-03 02:10:25 +08:00
实现公用的IP名单
This commit is contained in:
26
internal/web/actions/default/servers/iplists/deleteIP.go
Normal file
26
internal/web/actions/default/servers/iplists/deleteIP.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package iplists
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/oplogs"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
)
|
||||
|
||||
type DeleteIPAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *DeleteIPAction) RunPost(params struct {
|
||||
ItemId int64
|
||||
}) {
|
||||
// 日志
|
||||
defer this.CreateLog(oplogs.LevelInfo, "从IP名单中删除IP %d", params.ItemId)
|
||||
|
||||
_, err := this.RPC().IPItemRPC().DeleteIPItem(this.AdminContext(), &pb.DeleteIPItemRequest{IpItemId: params.ItemId})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
|
||||
this.Success()
|
||||
}
|
||||
Reference in New Issue
Block a user