实现基本的监控终端管理

This commit is contained in:
GoEdgeLab
2021-09-08 19:34:51 +08:00
parent 5d2466cf00
commit 242da2d065
19 changed files with 345 additions and 12 deletions

View File

@@ -304,6 +304,10 @@ func (this *RPCClient) ReportNodeRPC() pb.ReportNodeServiceClient {
return pb.NewReportNodeServiceClient(this.pickConn())
}
func (this *RPCClient) ReportNodeGroupRPC() pb.ReportNodeGroupServiceClient {
return pb.NewReportNodeGroupServiceClient(this.pickConn())
}
func (this *RPCClient) ReportResultRPC() pb.ReportResultServiceClient {
return pb.NewReportResultServiceClient(this.pickConn())
}

View File

@@ -0,0 +1,32 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package groups
import (
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/iwind/TeaGo/maps"
)
type OptionsAction struct {
actionutils.ParentAction
}
func (this *OptionsAction) RunPost(params struct{}) {
resp, err := this.RPC().ReportNodeGroupRPC().FindAllEnabledReportNodeGroups(this.AdminContext(), &pb.FindAllEnabledReportNodeGroupsRequest{})
if err != nil {
this.ErrorPage(err)
return
}
var groupMaps = []maps.Map{}
for _, group := range resp.ReportNodeGroups {
groupMaps = append(groupMaps, maps.Map{
"id": group.Id,
"name": group.Name,
})
}
this.Data["groups"] = groupMaps
this.Success()
}

View File

@@ -246,12 +246,12 @@ func (this *userMustAuth) modules(adminId int64) []maps.Map {
"code": "ipAddr",
"isOn": teaconst.IsPlus,
},
/**{
{
"name": "区域监控",
"url": "/clusters/monitors",
"code": "monitor",
"isOn": teaconst.IsPlus,
},**/
},
{
"name": "SSH认证",
"url": "/clusters/grants",