修复服务访问日志不能使用集群、节点筛选的Bug

This commit is contained in:
GoEdgeLab
2022-01-20 16:28:43 +08:00
parent ae560e6883
commit 7809763a51
7 changed files with 39 additions and 12 deletions

View File

@@ -29,6 +29,9 @@ func (this *HistoryAction) RunGet(params struct {
RequestId string
HasError int
ClusterId int64
NodeId int64
PageSize int
}) {
if len(params.Day) == 0 {
@@ -44,6 +47,8 @@ func (this *HistoryAction) RunGet(params struct {
this.Data["hasError"] = params.HasError
this.Data["hasWAF"] = params.HasWAF
this.Data["pageSize"] = params.PageSize
this.Data["clusterId"] = params.ClusterId
this.Data["nodeId"] = params.NodeId
day := params.Day
ipList := []string{}
@@ -66,6 +71,8 @@ func (this *HistoryAction) RunGet(params struct {
Keyword: params.Keyword,
Ip: params.Ip,
Domain: params.Domain,
NodeId: params.NodeId,
NodeClusterId: params.ClusterId,
Size: size,
})
if err != nil {
@@ -102,6 +109,8 @@ func (this *HistoryAction) RunGet(params struct {
Keyword: params.Keyword,
Ip: params.Ip,
Domain: params.Domain,
NodeId: params.NodeId,
NodeClusterId: params.ClusterId,
Size: size,
Reverse: true,
})

View File

@@ -22,6 +22,8 @@ func (this *IndexAction) RunGet(params struct {
RequestId string
Ip string
Domain string
ClusterId int64
NodeId int64
Keyword string
}) {
this.Data["serverId"] = params.ServerId
@@ -30,6 +32,8 @@ func (this *IndexAction) RunGet(params struct {
this.Data["domain"] = params.Domain
this.Data["keyword"] = params.Keyword
this.Data["path"] = this.Request.URL.Path
this.Data["clusterId"] = params.ClusterId
this.Data["nodeId"] = params.NodeId
// 记录最近使用
_, err := this.RPC().LatestItemRPC().IncreaseLatestItem(this.AdminContext(), &pb.IncreaseLatestItemRequest{
@@ -50,19 +54,23 @@ func (this *IndexAction) RunPost(params struct {
Keyword string
Ip string
Domain string
ClusterId int64
NodeId int64
Must *actions.Must
}) {
isReverse := len(params.RequestId) > 0
accessLogsResp, err := this.RPC().HTTPAccessLogRPC().ListHTTPAccessLogs(this.AdminContext(), &pb.ListHTTPAccessLogsRequest{
ServerId: params.ServerId,
RequestId: params.RequestId,
Size: 20,
Day: timeutil.Format("Ymd"),
Keyword: params.Keyword,
Ip: params.Ip,
Domain: params.Domain,
Reverse: isReverse,
ServerId: params.ServerId,
RequestId: params.RequestId,
Size: 20,
Day: timeutil.Format("Ymd"),
Keyword: params.Keyword,
Ip: params.Ip,
Domain: params.Domain,
NodeId: params.NodeId,
NodeClusterId: params.ClusterId,
Reverse: isReverse,
})
if err != nil {
this.ErrorPage(err)

View File

@@ -24,6 +24,8 @@ func (this *TodayAction) RunGet(params struct {
Keyword string
Ip string
Domain string
ClusterId int64
NodeId int64
PageSize int
}) {
@@ -40,6 +42,8 @@ func (this *TodayAction) RunGet(params struct {
this.Data["ip"] = params.Ip
this.Data["domain"] = params.Domain
this.Data["hasWAF"] = params.HasWAF
this.Data["clusterId"] = params.ClusterId
this.Data["nodeId"] = params.NodeId
resp, err := this.RPC().HTTPAccessLogRPC().ListHTTPAccessLogs(this.AdminContext(), &pb.ListHTTPAccessLogsRequest{
RequestId: params.RequestId,
@@ -50,6 +54,8 @@ func (this *TodayAction) RunGet(params struct {
Keyword: params.Keyword,
Ip: params.Ip,
Domain: params.Domain,
NodeId: params.NodeId,
NodeClusterId: params.ClusterId,
Size: size,
})
if err != nil {
@@ -87,6 +93,8 @@ func (this *TodayAction) RunGet(params struct {
Keyword: params.Keyword,
Ip: params.Ip,
Domain: params.Domain,
NodeId: params.NodeId,
NodeClusterId: params.ClusterId,
Size: size,
Reverse: true,
})