diff --git a/internal/web/actions/default/servers/server/log/history.go b/internal/web/actions/default/servers/server/log/history.go index 06e641f7..9cd5d5cc 100644 --- a/internal/web/actions/default/servers/server/log/history.go +++ b/internal/web/actions/default/servers/server/log/history.go @@ -24,6 +24,7 @@ func (this *HistoryAction) RunGet(params struct { Keyword string Ip string Domain string + HasWAF int RequestId string HasError int @@ -39,6 +40,7 @@ func (this *HistoryAction) 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{} @@ -50,14 +52,15 @@ func (this *HistoryAction) 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) @@ -85,15 +88,16 @@ func (this *HistoryAction) 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) diff --git a/internal/web/actions/default/servers/server/log/today.go b/internal/web/actions/default/servers/server/log/today.go index 8597db2d..e9e8a68f 100644 --- a/internal/web/actions/default/servers/server/log/today.go +++ b/internal/web/actions/default/servers/server/log/today.go @@ -20,6 +20,7 @@ func (this *TodayAction) RunGet(params struct { RequestId string ServerId int64 HasError int + HasWAF int Keyword string Ip string Domain string @@ -31,16 +32,18 @@ func (this *TodayAction) RunGet(params struct { this.Data["keyword"] = params.Keyword this.Data["ip"] = params.Ip this.Data["domain"] = params.Domain + this.Data["hasWAF"] = params.HasWAF resp, err := this.RPC().HTTPAccessLogRPC().ListHTTPAccessLogs(this.AdminContext(), &pb.ListHTTPAccessLogsRequest{ - RequestId: params.RequestId, - ServerId: params.ServerId, - HasError: params.HasError > 0, - Day: timeutil.Format("Ymd"), - 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: timeutil.Format("Ymd"), + Keyword: params.Keyword, + Ip: params.Ip, + Domain: params.Domain, + Size: size, }) if err != nil { this.ErrorPage(err) @@ -69,15 +72,16 @@ func (this *TodayAction) 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: timeutil.Format("Ymd"), - 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: timeutil.Format("Ymd"), + Keyword: params.Keyword, + Ip: params.Ip, + Domain: params.Domain, + Size: size, + Reverse: true, }) if err != nil { this.ErrorPage(err) diff --git a/web/public/js/components/server/http-access-log-search-box.js b/web/public/js/components/server/http-access-log-search-box.js index dc0f668c..35a3be1e 100644 --- a/web/public/js/components/server/http-access-log-search-box.js +++ b/web/public/js/components/server/http-access-log-search-box.js @@ -65,14 +65,14 @@ Vue.component("http-access-log-search-box", {