mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 05:00:25 +08:00 
			
		
		
		
	实现CPU线程数和修改节点的启用状态
This commit is contained in:
		@@ -83,6 +83,7 @@ func (this *IndexAction) RunGet(params struct {
 | 
			
		||||
			"id":          node.Id,
 | 
			
		||||
			"name":        node.Name,
 | 
			
		||||
			"isInstalled": node.IsInstalled,
 | 
			
		||||
			"isOn":        node.IsOn,
 | 
			
		||||
			"installStatus": maps.Map{
 | 
			
		||||
				"isRunning":  node.InstallStatus.IsRunning,
 | 
			
		||||
				"isFinished": node.InstallStatus.IsFinished,
 | 
			
		||||
 
 | 
			
		||||
@@ -2,9 +2,9 @@ package node
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"encoding/json"
 | 
			
		||||
	"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
 | 
			
		||||
	"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
 | 
			
		||||
	"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/nodes/grants/grantutils"
 | 
			
		||||
	"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
 | 
			
		||||
	"github.com/iwind/TeaGo/maps"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
@@ -115,6 +115,8 @@ func (this *NodeAction) RunGet(params struct {
 | 
			
		||||
		"isInstalled": node.IsInstalled,
 | 
			
		||||
		"uniqueId":    node.UniqueId,
 | 
			
		||||
		"secret":      node.Secret,
 | 
			
		||||
		"maxCPU":      node.MaxCPU,
 | 
			
		||||
		"isOn":        node.IsOn,
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	this.Show()
 | 
			
		||||
 
 | 
			
		||||
@@ -2,9 +2,9 @@ package node
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"encoding/json"
 | 
			
		||||
	"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
 | 
			
		||||
	"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
 | 
			
		||||
	"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/maps"
 | 
			
		||||
)
 | 
			
		||||
@@ -102,6 +102,8 @@ func (this *UpdateAction) RunGet(params struct {
 | 
			
		||||
		"ipAddresses": ipAddressMaps,
 | 
			
		||||
		"cluster":     clusterMap,
 | 
			
		||||
		"login":       loginMap,
 | 
			
		||||
		"maxCPU":      node.MaxCPU,
 | 
			
		||||
		"isOn":        node.IsOn,
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// 所有集群
 | 
			
		||||
@@ -134,6 +136,8 @@ func (this *UpdateAction) RunPost(params struct {
 | 
			
		||||
	GrantId     int64
 | 
			
		||||
	SshHost     string
 | 
			
		||||
	SshPort     int
 | 
			
		||||
	MaxCPU      int32
 | 
			
		||||
	IsOn        bool
 | 
			
		||||
 | 
			
		||||
	Must *actions.Must
 | 
			
		||||
}) {
 | 
			
		||||
@@ -168,6 +172,8 @@ func (this *UpdateAction) RunPost(params struct {
 | 
			
		||||
		Name:      params.Name,
 | 
			
		||||
		ClusterId: params.ClusterId,
 | 
			
		||||
		Login:     loginInfo,
 | 
			
		||||
		MaxCPU:    params.MaxCPU,
 | 
			
		||||
		IsOn:      params.IsOn,
 | 
			
		||||
	})
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		this.ErrorPage(err)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user