mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-14 04:10:26 +08:00
单个服务切换集群时可以选择是否保留节点上的配置/总是可以切换集群,不再受所属用户的影响
This commit is contained in:
@@ -147,13 +147,14 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
|
|
||||||
// RunPost 保存
|
// RunPost 保存
|
||||||
func (this *IndexAction) RunPost(params struct {
|
func (this *IndexAction) RunPost(params struct {
|
||||||
ServerId int64
|
ServerId int64
|
||||||
Name string
|
Name string
|
||||||
Description string
|
Description string
|
||||||
ClusterId int64
|
ClusterId int64
|
||||||
GroupIds []int64
|
KeepOldConfigs bool
|
||||||
IsOn bool
|
GroupIds []int64
|
||||||
UserPlanId int64
|
IsOn bool
|
||||||
|
UserPlanId int64
|
||||||
|
|
||||||
Must *actions.Must
|
Must *actions.Must
|
||||||
}) {
|
}) {
|
||||||
@@ -174,6 +175,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
Name: params.Name,
|
Name: params.Name,
|
||||||
Description: params.Description,
|
Description: params.Description,
|
||||||
NodeClusterId: params.ClusterId,
|
NodeClusterId: params.ClusterId,
|
||||||
|
KeepOldConfigs: params.KeepOldConfigs,
|
||||||
IsOn: params.IsOn,
|
IsOn: params.IsOn,
|
||||||
ServerGroupIds: params.GroupIds,
|
ServerGroupIds: params.GroupIds,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
endpoints: [ {{apiEndpoints}} ]
|
endpoints: [ {{apiEndpoints}} ]
|
||||||
nodeId: "{{node.uniqueId}}"
|
nodeId: "{{node.uniqueId}}"
|
||||||
secret: "{{node.secret}}"</source-code-box>
|
secret: "{{node.secret}}"</source-code-box>
|
||||||
|
<p class="comment">手动替换edge-node安装目录下的<code-label>configs/api.yaml</code-label>文件,然后重新启动生效;如果此文件不存在,则需要创建。</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -29,16 +29,20 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>部署的集群 *</td>
|
<td :class="{'color-border':server.clusterId != oldClusterId}">部署的集群 *</td>
|
||||||
<td>
|
<td>
|
||||||
<div v-if="user != null">{{clusterName}}
|
<select class="ui dropdown auto-width" name="clusterId" v-model="server.clusterId" >
|
||||||
<p class="comment">此选项跟随用户设置,不能单独修改。</p>
|
|
||||||
</div>
|
|
||||||
<select class="ui dropdown auto-width" name="clusterId" v-model="server.clusterId" v-show="user == null">
|
|
||||||
<option v-for="cluster in clusters" :value="cluster.id">{{cluster.name}}</option>
|
<option v-for="cluster in clusters" :value="cluster.id">{{cluster.name}}</option>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</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>
|
<tr>
|
||||||
<td>服务类型 *</td>
|
<td>服务类型 *</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ Tea.context(function () {
|
|||||||
this.userId = 0
|
this.userId = 0
|
||||||
this.plans = []
|
this.plans = []
|
||||||
this.userPlanId = 0
|
this.userPlanId = 0
|
||||||
|
this.oldClusterId = this.server.clusterId
|
||||||
|
|
||||||
if (this.userPlan != null) {
|
if (this.userPlan != null) {
|
||||||
this.userPlanId = this.userPlan.id
|
this.userPlanId = this.userPlan.id
|
||||||
|
|||||||
Reference in New Issue
Block a user