全局访问日志增加WAF日志/优化交互/数据看板--WAF--最新拦截记录增加更多链接

This commit is contained in:
刘祥超
2021-08-22 16:34:20 +08:00
parent d9bc1bdfca
commit 4ef8c2bc77
7 changed files with 77 additions and 26 deletions

View File

@@ -25,6 +25,7 @@ func (this *IndexAction) RunGet(params struct {
Ip string
Domain string
HasError int
HasWAF int
RequestId string
ServerId int64
@@ -41,6 +42,7 @@ func (this *IndexAction) RunGet(params struct {
this.Data["domain"] = params.Domain
this.Data["accessLogs"] = []interface{}{}
this.Data["hasError"] = params.HasError
this.Data["hasWAF"] = params.HasWAF
day := params.Day
ipList := []string{}
@@ -52,14 +54,15 @@ func (this *IndexAction) RunGet(params struct {
this.Data["hasError"] = params.HasError
resp, err := this.RPC().HTTPAccessLogRPC().ListHTTPAccessLogs(this.AdminContext(), &pb.ListHTTPAccessLogsRequest{
RequestId: params.RequestId,
ServerId: params.ServerId,
HasError: params.HasError > 0,
Day: day,
Keyword: params.Keyword,
Ip: params.Ip,
Domain: params.Domain,
Size: size,
RequestId: params.RequestId,
ServerId: params.ServerId,
HasError: params.HasError > 0,
HasFirewallPolicy: params.HasWAF > 0,
Day: day,
Keyword: params.Keyword,
Ip: params.Ip,
Domain: params.Domain,
Size: size,
})
if err != nil {
this.ErrorPage(err)
@@ -87,15 +90,16 @@ func (this *IndexAction) RunGet(params struct {
if len(params.RequestId) > 0 {
this.Data["hasPrev"] = true
prevResp, err := this.RPC().HTTPAccessLogRPC().ListHTTPAccessLogs(this.AdminContext(), &pb.ListHTTPAccessLogsRequest{
RequestId: params.RequestId,
ServerId: params.ServerId,
HasError: params.HasError > 0,
Day: day,
Keyword: params.Keyword,
Ip: params.Ip,
Domain: params.Domain,
Size: size,
Reverse: true,
RequestId: params.RequestId,
ServerId: params.ServerId,
HasError: params.HasError > 0,
HasFirewallPolicy: params.HasWAF > 0,
Day: day,
Keyword: params.Keyword,
Ip: params.Ip,
Domain: params.Domain,
Size: size,
Reverse: true,
})
if err != nil {
this.ErrorPage(err)