[区域]可以设置区域说明文字

This commit is contained in:
GoEdgeLab
2020-12-10 22:21:26 +08:00
parent 9103f1a7b8
commit f7a0c039d5
6 changed files with 41 additions and 15 deletions

View File

@@ -20,7 +20,8 @@ func (this *CreatePopupAction) RunGet(params struct{}) {
}
func (this *CreatePopupAction) RunPost(params struct {
Name string
Name string
Description string
Must *actions.Must
CSRF *actionutils.CSRF
@@ -29,15 +30,19 @@ func (this *CreatePopupAction) RunPost(params struct {
Field("name", params.Name).
Require("请输入区域名称")
createResp, err := this.RPC().NodeRegionRPC().CreateNodeRegion(this.AdminContext(), &pb.CreateNodeRegionRequest{Name: params.Name})
createResp, err := this.RPC().NodeRegionRPC().CreateNodeRegion(this.AdminContext(), &pb.CreateNodeRegionRequest{
Name: params.Name,
Description: params.Description,
})
if err != nil {
this.ErrorPage(err)
return
}
this.Data["region"] = maps.Map{
"id": createResp.NodeRegionId,
"name": params.Name,
"id": createResp.NodeRegionId,
"name": params.Name,
"description": params.Description,
}
// 日志

View File

@@ -29,10 +29,11 @@ func (this *IndexAction) RunGet(params struct{}) {
}
regionMaps = append(regionMaps, maps.Map{
"id": region.Id,
"isOn": region.IsOn,
"name": region.Name,
"countNodes": countNodesResp.Count,
"id": region.Id,
"isOn": region.IsOn,
"name": region.Name,
"description": region.Description,
"countNodes": countNodesResp.Count,
})
}
this.Data["regions"] = regionMaps

View File

@@ -30,9 +30,10 @@ func (this *UpdatePopupAction) RunGet(params struct {
}
this.Data["region"] = maps.Map{
"id": region.Id,
"isOn": region.IsOn,
"name": region.Name,
"id": region.Id,
"isOn": region.IsOn,
"name": region.Name,
"description": region.Description,
}
this.Show()
@@ -41,8 +42,9 @@ func (this *UpdatePopupAction) RunGet(params struct {
func (this *UpdatePopupAction) RunPost(params struct {
RegionId int64
Name string
IsOn bool
Name string
Description string
IsOn bool
Must *actions.Must
CSRF *actionutils.CSRF
@@ -56,6 +58,7 @@ func (this *UpdatePopupAction) RunPost(params struct {
_, err := this.RPC().NodeRegionRPC().UpdateNodeRegion(this.AdminContext(), &pb.UpdateNodeRegionRequest{
NodeRegionId: params.RegionId,
Name: params.Name,
Description: params.Description,
IsOn: params.IsOn,
})
if err != nil {