mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2026-04-04 21:15:19 +08:00
当集群设置不允许记录访问日志时,在网站的访问日志查看页面提醒
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package log
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/iwind/TeaGo/actions"
|
||||
"github.com/iwind/TeaGo/lists"
|
||||
@@ -10,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
type IndexAction struct {
|
||||
actionutils.ParentAction
|
||||
BaseAction
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
@@ -36,6 +35,11 @@ func (this *IndexAction) RunGet(params struct {
|
||||
this.Data["clusterId"] = params.ClusterId
|
||||
this.Data["nodeId"] = params.NodeId
|
||||
|
||||
// 检查集群全局设置
|
||||
if !this.initClusterAccessLogConfig(params.ServerId) {
|
||||
return
|
||||
}
|
||||
|
||||
// 记录最近使用
|
||||
_, err := this.RPC().LatestItemRPC().IncreaseLatestItem(this.AdminContext(), &pb.IncreaseLatestItemRequest{
|
||||
ItemType: "server",
|
||||
@@ -83,7 +87,7 @@ func (this *IndexAction) RunPost(params struct {
|
||||
|
||||
var ipList = []string{}
|
||||
var wafMaps = []maps.Map{}
|
||||
|
||||
|
||||
var accessLogs = accessLogsResp.HttpAccessLogs
|
||||
if len(accessLogs) == 0 {
|
||||
accessLogs = []*pb.HTTPAccessLog{}
|
||||
|
||||
Reference in New Issue
Block a user