单个服务切换集群时可以选择是否保留节点上的配置/总是可以切换集群,不再受所属用户的影响

This commit is contained in:
GoEdgeLab
2022-04-18 17:18:39 +08:00
parent 9932def081
commit 3c90c5c72d
4 changed files with 20 additions and 12 deletions

View File

@@ -147,13 +147,14 @@ func (this *IndexAction) RunGet(params struct {
// RunPost 保存
func (this *IndexAction) RunPost(params struct {
ServerId int64
Name string
Description string
ClusterId int64
GroupIds []int64
IsOn bool
UserPlanId int64
ServerId int64
Name string
Description string
ClusterId int64
KeepOldConfigs bool
GroupIds []int64
IsOn bool
UserPlanId int64
Must *actions.Must
}) {
@@ -174,6 +175,7 @@ func (this *IndexAction) RunPost(params struct {
Name: params.Name,
Description: params.Description,
NodeClusterId: params.ClusterId,
KeepOldConfigs: params.KeepOldConfigs,
IsOn: params.IsOn,
ServerGroupIds: params.GroupIds,
})

View File

@@ -31,6 +31,7 @@
endpoints: [ {{apiEndpoints}} ]
nodeId: "{{node.uniqueId}}"
secret: "{{node.secret}}"</source-code-box>
<p class="comment">手动替换edge-node安装目录下的<code-label>configs/api.yaml</code-label>文件,然后重新启动生效;如果此文件不存在,则需要创建。</p>
</td>
</tr>
<tr>

View File

@@ -29,16 +29,20 @@
</td>
</tr>
<tr>
<td>部署的集群 *</td>
<td :class="{'color-border':server.clusterId != oldClusterId}">部署的集群 *</td>
<td>
<div v-if="user != null">{{clusterName}}
<p class="comment">此选项跟随用户设置,不能单独修改。</p>
</div>
<select class="ui dropdown auto-width" name="clusterId" v-model="server.clusterId" v-show="user == null">
<select class="ui dropdown auto-width" name="clusterId" v-model="server.clusterId" >
<option v-for="cluster in clusters" :value="cluster.id">{{cluster.name}}</option>
</select>
</td>
</tr>
<tr v-show="server.clusterId != oldClusterId">
<td class="color-border">是否保留原集群配置</td>
<td>
<checkbox name="keepOldConfigs" checked="checked"></checkbox>
<p class="comment">选中表示在先前的集群节点上仍然保留当前服务的配置,直至节点配置全部刷新时才会删除;不选中,则表示立即删除原集群上关于当前服务的配置。</p>
</td>
</tr>
<tr>
<td>服务类型 *</td>
<td>

View File

@@ -7,6 +7,7 @@ Tea.context(function () {
this.userId = 0
this.plans = []
this.userPlanId = 0
this.oldClusterId = this.server.clusterId
if (this.userPlan != null) {
this.userPlanId = this.userPlan.id