mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-06 23:00:25 +08:00
修复服务无法创建的Bug
This commit is contained in:
@@ -57,6 +57,14 @@ func (this *CreateAction) RunGet(params struct{}) {
|
||||
// 服务类型
|
||||
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()
|
||||
}
|
||||
|
||||
@@ -94,6 +102,7 @@ func (this *CreateAction) RunPost(params struct {
|
||||
|
||||
// 用户
|
||||
var userId = params.UserId
|
||||
if userId > 0 {
|
||||
clusterIdResp, err := this.RPC().UserRPC().FindUserNodeClusterId(this.AdminContext(), &pb.FindUserNodeClusterIdRequest{UserId: userId})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
@@ -103,6 +112,7 @@ func (this *CreateAction) RunPost(params struct {
|
||||
if clusterId <= 0 {
|
||||
this.Fail("请选择部署的集群")
|
||||
}
|
||||
}
|
||||
|
||||
// 套餐
|
||||
var userPlanId = params.UserPlanId
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<input type="text" name="name" maxlength="60" ref="focus"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr v-show="hasUsers">
|
||||
<td>选择用户</td>
|
||||
<td>
|
||||
<user-selector @change="changeUserId"></user-selector>
|
||||
|
||||
Reference in New Issue
Block a user