可以在创建、修改节点的时候选择分组,可以根据分组筛选节点

This commit is contained in:
刘祥超
2020-10-28 20:00:27 +08:00
parent cd4f4c41f6
commit 181976f79f
21 changed files with 310 additions and 33 deletions

View File

@@ -4,6 +4,7 @@ import (
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/iwind/TeaGo/actions"
"github.com/iwind/TeaGo/maps"
)
type CreatePopupAction struct {
@@ -31,7 +32,7 @@ func (this *CreatePopupAction) RunPost(params struct {
params.Must.
Field("name", params.Name).
Require("请输入分组名称")
_, err := this.RPC().NodeGroupRPC().CreateNodeGroup(this.AdminContext(), &pb.CreateNodeGroupRequest{
createResp, err := this.RPC().NodeGroupRPC().CreateNodeGroup(this.AdminContext(), &pb.CreateNodeGroupRequest{
ClusterId: params.ClusterId,
Name: params.Name,
})
@@ -40,5 +41,10 @@ func (this *CreatePopupAction) RunPost(params struct {
return
}
this.Data["group"] = maps.Map{
"id": createResp.GroupId,
"name": params.Name,
}
this.Success()
}