IPBox把IP加入黑名单可以选择过期时间/可以从已经添加的名单中删除/已经添加的名单中显示过期时间

This commit is contained in:
GoEdgeLab
2021-12-02 17:11:44 +08:00
parent 54eda21f7d
commit 889417beda
7 changed files with 145 additions and 18 deletions

View File

@@ -0,0 +1,27 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package ipbox
import (
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
)
type DeleteFromListAction struct {
actionutils.ParentAction
}
func (this *DeleteFromListAction) RunPost(params struct {
ListId int64
ItemId int64
}) {
defer this.CreateLogInfo("从IP名单 %d 中删除IP %d", params.ListId, params.ItemId)
_, err := this.RPC().IPItemRPC().DeleteIPItem(this.AdminContext(), &pb.DeleteIPItemRequest{IpItemId: params.ItemId})
if err != nil {
this.ErrorPage(err)
return
}
this.Success()
}