mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-09 08:40:26 +08:00
实现CPU线程数和修改节点的启用状态
This commit is contained in:
@@ -83,6 +83,7 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
"id": node.Id,
|
"id": node.Id,
|
||||||
"name": node.Name,
|
"name": node.Name,
|
||||||
"isInstalled": node.IsInstalled,
|
"isInstalled": node.IsInstalled,
|
||||||
|
"isOn": node.IsOn,
|
||||||
"installStatus": maps.Map{
|
"installStatus": maps.Map{
|
||||||
"isRunning": node.InstallStatus.IsRunning,
|
"isRunning": node.InstallStatus.IsRunning,
|
||||||
"isFinished": node.InstallStatus.IsFinished,
|
"isFinished": node.InstallStatus.IsFinished,
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ package node
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
|
||||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/nodes/grants/grantutils"
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/nodes/grants/grantutils"
|
||||||
|
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||||
"github.com/iwind/TeaGo/maps"
|
"github.com/iwind/TeaGo/maps"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -115,6 +115,8 @@ func (this *NodeAction) RunGet(params struct {
|
|||||||
"isInstalled": node.IsInstalled,
|
"isInstalled": node.IsInstalled,
|
||||||
"uniqueId": node.UniqueId,
|
"uniqueId": node.UniqueId,
|
||||||
"secret": node.Secret,
|
"secret": node.Secret,
|
||||||
|
"maxCPU": node.MaxCPU,
|
||||||
|
"isOn": node.IsOn,
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Show()
|
this.Show()
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ package node
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
|
||||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/nodes/grants/grantutils"
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/nodes/grants/grantutils"
|
||||||
|
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||||
"github.com/iwind/TeaGo/actions"
|
"github.com/iwind/TeaGo/actions"
|
||||||
"github.com/iwind/TeaGo/maps"
|
"github.com/iwind/TeaGo/maps"
|
||||||
)
|
)
|
||||||
@@ -102,6 +102,8 @@ func (this *UpdateAction) RunGet(params struct {
|
|||||||
"ipAddresses": ipAddressMaps,
|
"ipAddresses": ipAddressMaps,
|
||||||
"cluster": clusterMap,
|
"cluster": clusterMap,
|
||||||
"login": loginMap,
|
"login": loginMap,
|
||||||
|
"maxCPU": node.MaxCPU,
|
||||||
|
"isOn": node.IsOn,
|
||||||
}
|
}
|
||||||
|
|
||||||
// 所有集群
|
// 所有集群
|
||||||
@@ -134,6 +136,8 @@ func (this *UpdateAction) RunPost(params struct {
|
|||||||
GrantId int64
|
GrantId int64
|
||||||
SshHost string
|
SshHost string
|
||||||
SshPort int
|
SshPort int
|
||||||
|
MaxCPU int32
|
||||||
|
IsOn bool
|
||||||
|
|
||||||
Must *actions.Must
|
Must *actions.Must
|
||||||
}) {
|
}) {
|
||||||
@@ -168,6 +172,8 @@ func (this *UpdateAction) RunPost(params struct {
|
|||||||
Name: params.Name,
|
Name: params.Name,
|
||||||
ClusterId: params.ClusterId,
|
ClusterId: params.ClusterId,
|
||||||
Login: loginInfo,
|
Login: loginInfo,
|
||||||
|
MaxCPU: params.MaxCPU,
|
||||||
|
IsOn: params.IsOn,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
|
|||||||
@@ -72,7 +72,10 @@
|
|||||||
<span v-else>-</span>
|
<span v-else>-</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div v-if="node.isInstalled">
|
<div v-if="!node.isOn">
|
||||||
|
<label-on :v-is-on="node.isOn"></label-on>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="node.isInstalled">
|
||||||
<div v-if="node.status.isActive">
|
<div v-if="node.status.isActive">
|
||||||
<span v-if="!node.isSynced" class="red">同步中</span>
|
<span v-if="!node.isSynced" class="red">同步中</span>
|
||||||
<span v-else class="green">运行中</span>
|
<span v-else class="green">运行中</span>
|
||||||
|
|||||||
@@ -10,6 +10,10 @@
|
|||||||
<td class="title">节点名称</td>
|
<td class="title">节点名称</td>
|
||||||
<td>{{node.name}}</td>
|
<td>{{node.name}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>状态</td>
|
||||||
|
<td><label-on :v-is-on="node.isOn"></label-on></td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>IP地址</td>
|
<td>IP地址</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -60,6 +64,13 @@
|
|||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>CPU线程数</td>
|
||||||
|
<td>
|
||||||
|
<span v-if="node.maxCPU > 0">{{node.maxCPU}}线程</span>
|
||||||
|
<span v-else class="disabled">没有限制。</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h3>安装信息</h3>
|
<h3>安装信息</h3>
|
||||||
|
|||||||
@@ -29,6 +29,9 @@
|
|||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2"><strong>SSH登录信息:</strong></td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>SSH主机地址</td>
|
<td>SSH主机地址</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -49,6 +52,28 @@
|
|||||||
<grant-selector :v-grant="grant"></grant-selector>
|
<grant-selector :v-grant="grant"></grant-selector>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
||||||
|
</tr>
|
||||||
|
<tbody v-show="moreOptionsVisible">
|
||||||
|
<tr>
|
||||||
|
<td>CPU线程数</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="maxCPU" v-model="node.maxCPU"/>
|
||||||
|
<p class="comment">当前节点可以使用的最多的CPU线程数,如果为0表示可以使用全部CPU。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>是否启用</td>
|
||||||
|
<td>
|
||||||
|
<div class="ui checkbox">
|
||||||
|
<input type="checkbox" name="isOn" value="1" v-model="node.isOn"/>
|
||||||
|
<label></label>
|
||||||
|
</div>
|
||||||
|
<p class="comment">如果不启用此节点,此节点上的所有服务将不能访问。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<submit-btn></submit-btn>
|
<submit-btn></submit-btn>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
Reference in New Issue
Block a user