开源版本也显示域名排行

This commit is contained in:
GoEdgeLab
2021-09-19 16:10:34 +08:00
parent d176d15a83
commit 790f8c8032

View File

@@ -569,7 +569,7 @@ func (this *AdminService) ComposeAdminDashboard(ctx context.Context, req *pb.Com
}) })
} }
// 是否是业版 // 是否是业版
isPlus, err := authority.SharedAuthorityKeyDAO.IsPlus(tx) isPlus, err := authority.SharedAuthorityKeyDAO.IsPlus(tx)
if err != nil { if err != nil {
return nil, err return nil, err
@@ -671,19 +671,17 @@ func (this *AdminService) ComposeAdminDashboard(ctx context.Context, req *pb.Com
} }
// 域名排行 // 域名排行
if isPlus { topDomainStats, err := stats.SharedServerDomainHourlyStatDAO.FindTopDomainStats(tx, hourFrom, hourTo, 10)
topDomainStats, err := stats.SharedServerDomainHourlyStatDAO.FindTopDomainStats(tx, hourFrom, hourTo, 10) if err != nil {
if err != nil { return nil, err
return nil, err }
} for _, stat := range topDomainStats {
for _, stat := range topDomainStats { result.TopDomainStats = append(result.TopDomainStats, &pb.ComposeAdminDashboardResponse_DomainStat{
result.TopDomainStats = append(result.TopDomainStats, &pb.ComposeAdminDashboardResponse_DomainStat{ ServerId: int64(stat.ServerId),
ServerId: int64(stat.ServerId), Domain: stat.Domain,
Domain: stat.Domain, CountRequests: int64(stat.CountRequests),
CountRequests: int64(stat.CountRequests), Bytes: int64(stat.Bytes),
Bytes: int64(stat.Bytes), })
})
}
} }
// 节点排行 // 节点排行