当集群设置不允许记录访问日志时,在网站的访问日志查看页面提醒

This commit is contained in:
GoEdgeLab
2023-07-05 15:55:47 +08:00
parent 1ec1971938
commit f0f5fcff54
7 changed files with 87 additions and 7 deletions

View File

@@ -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/lists"
"github.com/iwind/TeaGo/maps"
@@ -9,7 +8,7 @@ import (
)
type TodayAction struct {
actionutils.ParentAction
BaseAction
}
func (this *TodayAction) Init() {
@@ -50,6 +49,11 @@ func (this *TodayAction) RunGet(params struct {
this.Data["partition"] = params.Partition
this.Data["day"] = timeutil.Format("Ymd")
// 检查集群全局设置
if !this.initClusterAccessLogConfig(params.ServerId) {
return
}
resp, err := this.RPC().HTTPAccessLogRPC().ListHTTPAccessLogs(this.AdminContext(), &pb.ListHTTPAccessLogsRequest{
Partition: params.Partition,
RequestId: params.RequestId,