mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 21:50:28 +08:00 
			
		
		
		
	修复服务无法创建的Bug
This commit is contained in:
		@@ -57,6 +57,14 @@ func (this *CreateAction) RunGet(params struct{}) {
 | 
				
			|||||||
	// 服务类型
 | 
						// 服务类型
 | 
				
			||||||
	this.Data["serverTypes"] = serverconfigs.AllServerTypes()
 | 
						this.Data["serverTypes"] = serverconfigs.AllServerTypes()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// 检查是否有用户
 | 
				
			||||||
 | 
						countUsersResp, err := this.RPC().UserRPC().CountAllEnabledUsers(this.AdminContext(), &pb.CountAllEnabledUsersRequest{})
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							this.ErrorPage(err)
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						this.Data["hasUsers"] = countUsersResp.Count > 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	this.Show()
 | 
						this.Show()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -94,14 +102,16 @@ func (this *CreateAction) RunPost(params struct {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	// 用户
 | 
						// 用户
 | 
				
			||||||
	var userId = params.UserId
 | 
						var userId = params.UserId
 | 
				
			||||||
	clusterIdResp, err := this.RPC().UserRPC().FindUserNodeClusterId(this.AdminContext(), &pb.FindUserNodeClusterIdRequest{UserId: userId})
 | 
						if userId > 0 {
 | 
				
			||||||
	if err != nil {
 | 
							clusterIdResp, err := this.RPC().UserRPC().FindUserNodeClusterId(this.AdminContext(), &pb.FindUserNodeClusterIdRequest{UserId: userId})
 | 
				
			||||||
		this.ErrorPage(err)
 | 
							if err != nil {
 | 
				
			||||||
		return
 | 
								this.ErrorPage(err)
 | 
				
			||||||
	}
 | 
								return
 | 
				
			||||||
	clusterId = clusterIdResp.NodeClusterId
 | 
							}
 | 
				
			||||||
	if clusterId <= 0 {
 | 
							clusterId = clusterIdResp.NodeClusterId
 | 
				
			||||||
		this.Fail("请选择部署的集群")
 | 
							if clusterId <= 0 {
 | 
				
			||||||
 | 
								this.Fail("请选择部署的集群")
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// 套餐
 | 
						// 套餐
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,7 +11,7 @@
 | 
				
			|||||||
				<input type="text" name="name" maxlength="60" ref="focus"/>
 | 
									<input type="text" name="name" maxlength="60" ref="focus"/>
 | 
				
			||||||
			</td>
 | 
								</td>
 | 
				
			||||||
		</tr>
 | 
							</tr>
 | 
				
			||||||
        <tr>
 | 
					        <tr v-show="hasUsers">
 | 
				
			||||||
            <td>选择用户</td>
 | 
					            <td>选择用户</td>
 | 
				
			||||||
            <td>
 | 
					            <td>
 | 
				
			||||||
                <user-selector @change="changeUserId"></user-selector>
 | 
					                <user-selector @change="changeUserId"></user-selector>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user