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,6 +102,7 @@ func (this *CreateAction) RunPost(params struct {
|
|||||||
|
|
||||||
// 用户
|
// 用户
|
||||||
var userId = params.UserId
|
var userId = params.UserId
|
||||||
|
if userId > 0 {
|
||||||
clusterIdResp, err := this.RPC().UserRPC().FindUserNodeClusterId(this.AdminContext(), &pb.FindUserNodeClusterIdRequest{UserId: userId})
|
clusterIdResp, err := this.RPC().UserRPC().FindUserNodeClusterId(this.AdminContext(), &pb.FindUserNodeClusterIdRequest{UserId: userId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
@@ -103,6 +112,7 @@ func (this *CreateAction) RunPost(params struct {
|
|||||||
if clusterId <= 0 {
|
if clusterId <= 0 {
|
||||||
this.Fail("请选择部署的集群")
|
this.Fail("请选择部署的集群")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 套餐
|
// 套餐
|
||||||
var userPlanId = params.UserPlanId
|
var userPlanId = params.UserPlanId
|
||||||
|
|||||||
@@ -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