集群增加是否远程启动选项

This commit is contained in:
GoEdgeLab
2022-09-17 15:11:40 +08:00
parent 0c07fcf504
commit 50957d880e
2 changed files with 34 additions and 24 deletions

View File

@@ -80,13 +80,14 @@ func (this *IndexAction) RunGet(params struct {
}
this.Data["cluster"] = maps.Map{
"id": cluster.Id,
"name": cluster.Name,
"installDir": cluster.InstallDir,
"timeZone": cluster.TimeZone,
"nodeMaxThreads": cluster.NodeMaxThreads,
"autoOpenPorts": cluster.AutoOpenPorts,
"clock": clockConfig,
"id": cluster.Id,
"name": cluster.Name,
"installDir": cluster.InstallDir,
"timeZone": cluster.TimeZone,
"nodeMaxThreads": cluster.NodeMaxThreads,
"autoOpenPorts": cluster.AutoOpenPorts,
"clock": clockConfig,
"autoRemoteStart": cluster.AutoRemoteStart,
}
// 默认值
@@ -99,15 +100,16 @@ func (this *IndexAction) RunGet(params struct {
// RunPost 保存设置
func (this *IndexAction) RunPost(params struct {
ClusterId int64
Name string
GrantId int64
InstallDir string
TimeZone string
NodeMaxThreads int32
AutoOpenPorts bool
ClockAutoSync bool
ClockServer string
ClusterId int64
Name string
GrantId int64
InstallDir string
TimeZone string
NodeMaxThreads int32
AutoOpenPorts bool
ClockAutoSync bool
ClockServer string
AutoRemoteStart bool
Must *actions.Must
}) {
@@ -141,14 +143,15 @@ func (this *IndexAction) RunPost(params struct {
}
_, err = this.RPC().NodeClusterRPC().UpdateNodeCluster(this.AdminContext(), &pb.UpdateNodeClusterRequest{
NodeClusterId: params.ClusterId,
Name: params.Name,
NodeGrantId: params.GrantId,
InstallDir: params.InstallDir,
TimeZone: params.TimeZone,
NodeMaxThreads: params.NodeMaxThreads,
AutoOpenPorts: params.AutoOpenPorts,
ClockJSON: clockConfigJSON,
NodeClusterId: params.ClusterId,
Name: params.Name,
NodeGrantId: params.GrantId,
InstallDir: params.InstallDir,
TimeZone: params.TimeZone,
NodeMaxThreads: params.NodeMaxThreads,
AutoOpenPorts: params.AutoOpenPorts,
ClockJSON: clockConfigJSON,
AutoRemoteStart: params.AutoRemoteStart,
})
if err != nil {
this.ErrorPage(err)

View File

@@ -78,6 +78,13 @@
<p class="comment">可选项。默认使用<code-label>pool.ntp.org</code-label></p>
</td>
</tr>
<tr>
<td>自动远程启动</td>
<td>
<checkbox name="autoRemoteStart" v-model="cluster.autoRemoteStart"></checkbox>
<p class="comment">当检测到节点离线时自动尝试远程启动前提是节点已经设置了SSH登录认证</p>
</td>
</tr>
</tbody>
</table>
<submit-btn></submit-btn>