mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-04 05:00:25 +08:00
[节点]可以设置节点区域
This commit is contained in:
@@ -138,6 +138,7 @@ func (this *UpdateAction) RunGet(params struct {
|
||||
}
|
||||
}
|
||||
|
||||
// 分组
|
||||
var groupMap maps.Map = nil
|
||||
if node.Group != nil {
|
||||
groupMap = maps.Map{
|
||||
@@ -146,6 +147,15 @@ func (this *UpdateAction) RunGet(params struct {
|
||||
}
|
||||
}
|
||||
|
||||
// 区域
|
||||
var regionMap maps.Map = nil
|
||||
if node.Region != nil {
|
||||
regionMap = maps.Map{
|
||||
"id": node.Region.Id,
|
||||
"name": node.Region.Name,
|
||||
}
|
||||
}
|
||||
|
||||
this.Data["node"] = maps.Map{
|
||||
"id": node.Id,
|
||||
"name": node.Name,
|
||||
@@ -155,6 +165,7 @@ func (this *UpdateAction) RunGet(params struct {
|
||||
"maxCPU": node.MaxCPU,
|
||||
"isOn": node.IsOn,
|
||||
"group": groupMap,
|
||||
"region": regionMap,
|
||||
}
|
||||
|
||||
// 所有集群
|
||||
@@ -182,6 +193,7 @@ func (this *UpdateAction) RunPost(params struct {
|
||||
LoginId int64
|
||||
NodeId int64
|
||||
GroupId int64
|
||||
RegionId int64
|
||||
Name string
|
||||
IPAddressesJSON []byte `alias:"ipAddressesJSON"`
|
||||
ClusterId int64
|
||||
@@ -237,6 +249,7 @@ func (this *UpdateAction) RunPost(params struct {
|
||||
_, err := this.RPC().NodeRPC().UpdateNode(this.AdminContext(), &pb.UpdateNodeRequest{
|
||||
NodeId: params.NodeId,
|
||||
GroupId: params.GroupId,
|
||||
RegionId: params.RegionId,
|
||||
Name: params.Name,
|
||||
ClusterId: params.ClusterId,
|
||||
Login: loginInfo,
|
||||
|
||||
Reference in New Issue
Block a user