Files
EdgeAdmin/internal/web/actions/default/servers/iplists/readAll.go
2024-05-17 17:56:37 +08:00

30 lines
734 B
Go

// Copyright 2022 GoEdge CDN goedge.cdn@gmail.com. All rights reserved.
package iplists
import (
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
)
type ReadAllAction struct {
actionutils.ParentAction
}
func (this *ReadAllAction) RunPost(params struct{}) {
defer this.CreateLogInfo(codes.IPItem_LogReadAllIPItems)
_, err := this.RPC().IPItemRPC().UpdateIPItemsRead(this.AdminContext(), &pb.UpdateIPItemsReadRequest{})
if err != nil {
this.ErrorPage(err)
return
}
// 通知左侧菜单Badge更新
helpers.NotifyIPItemsCountChanges()
this.Success()
}