域名服务增加访问日志

This commit is contained in:
刘祥超
2021-06-02 11:53:24 +08:00
parent e9e4abff03
commit 442dd195ca
17 changed files with 829 additions and 121 deletions

View File

@@ -6,6 +6,7 @@ import (
teaconst "github.com/TeaOSLab/EdgeAPI/internal/const"
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
"github.com/TeaOSLab/EdgeAPI/internal/db/models/authority"
"github.com/TeaOSLab/EdgeAPI/internal/db/models/nameservers"
"github.com/TeaOSLab/EdgeAPI/internal/db/models/stats"
"github.com/TeaOSLab/EdgeAPI/internal/errors"
rpcutils "github.com/TeaOSLab/EdgeAPI/internal/rpc/utils"
@@ -546,6 +547,12 @@ func (this *AdminService) ComposeAdminDashboard(ctx context.Context, req *pb.Com
})
}
// 是否是企业版
isPlus, err := authority.SharedAuthorityKeyDAO.IsPlus(tx)
if err != nil {
return nil, err
}
// 边缘节点升级信息
{
upgradeInfo := &pb.ComposeAdminDashboardResponse_UpgradeInfo{
@@ -560,7 +567,7 @@ func (this *AdminService) ComposeAdminDashboard(ctx context.Context, req *pb.Com
}
// 监控节点升级信息
{
if isPlus {
upgradeInfo := &pb.ComposeAdminDashboardResponse_UpgradeInfo{
NewVersion: teaconst.MonitorNodeVersion,
}
@@ -573,7 +580,7 @@ func (this *AdminService) ComposeAdminDashboard(ctx context.Context, req *pb.Com
}
// 认证节点升级信息
{
if isPlus {
upgradeInfo := &pb.ComposeAdminDashboardResponse_UpgradeInfo{
NewVersion: teaconst.AuthorityNodeVersion,
}
@@ -586,7 +593,7 @@ func (this *AdminService) ComposeAdminDashboard(ctx context.Context, req *pb.Com
}
// 用户节点升级信息
{
if isPlus {
upgradeInfo := &pb.ComposeAdminDashboardResponse_UpgradeInfo{
NewVersion: teaconst.UserNodeVersion,
}
@@ -611,5 +618,18 @@ func (this *AdminService) ComposeAdminDashboard(ctx context.Context, req *pb.Com
resp.ApiNodeUpgradeInfo = upgradeInfo
}
// DNS节点升级信息
if isPlus {
upgradeInfo := &pb.ComposeAdminDashboardResponse_UpgradeInfo{
NewVersion: teaconst.DNSNodeVersion,
}
countNodes, err := nameservers.SharedNSNodeDAO.CountAllLowerVersionNodes(tx, upgradeInfo.NewVersion)
if err != nil {
return nil, err
}
upgradeInfo.CountNodes = countNodes
resp.NsNodeUpgradeInfo = upgradeInfo
}
return resp, nil
}