mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-03 20:40:26 +08:00
[区域]可以设置区域说明文字
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
// 日志
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user