在选择区域弹出框中可以不选区域直接确定返回

This commit is contained in:
GoEdgeLab
2022-10-25 09:43:31 +08:00
parent af483e5f13
commit d391408e9e
3 changed files with 9 additions and 3 deletions

View File

@@ -40,12 +40,18 @@ func (this *SelectPopupAction) RunPost(params struct {
Must *actions.Must
CSRF *actionutils.CSRF
}) {
if params.RegionId <= 0 {
this.Data["region"] = nil
this.Success()
return
}
regionResp, err := this.RPC().NodeRegionRPC().FindEnabledNodeRegion(this.AdminContext(), &pb.FindEnabledNodeRegionRequest{NodeRegionId: params.RegionId})
if err != nil {
this.ErrorPage(err)
return
}
region := regionResp.NodeRegion
var region = regionResp.NodeRegion
if region == nil {
this.NotFound("nodeRegion", params.RegionId)
return