mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-16 05:36:36 +08:00
实现数据看板--WAF
This commit is contained in:
28
internal/web/actions/default/dashboard/boards/wafLogs.go
Normal file
28
internal/web/actions/default/dashboard/boards/wafLogs.go
Normal file
@@ -0,0 +1,28 @@
|
||||
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
|
||||
|
||||
package boards
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
timeutil "github.com/iwind/TeaGo/utils/time"
|
||||
)
|
||||
|
||||
type WafLogsAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *WafLogsAction) RunPost(params struct{}) {
|
||||
resp, err := this.RPC().HTTPAccessLogRPC().ListHTTPAccessLogs(this.AdminContext(), &pb.ListHTTPAccessLogsRequest{
|
||||
HasFirewallPolicy: true,
|
||||
Reverse: false,
|
||||
Day: timeutil.Format("Ymd"),
|
||||
Size: 5,
|
||||
})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
this.Data["accessLogs"] = resp.HttpAccessLogs
|
||||
this.Success()
|
||||
}
|
||||
Reference in New Issue
Block a user