增加节点停止、启动、安装测试等功能

This commit is contained in:
GoEdgeLab
2020-10-27 12:33:27 +08:00
parent 16ab3a5497
commit 0bf5859112
14 changed files with 299 additions and 158 deletions

View File

@@ -0,0 +1,25 @@
package node
import (
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
)
type StartAction struct {
actionutils.ParentAction
}
func (this *StartAction) RunPost(params struct {
NodeId int64
}) {
resp, err := this.RPC().NodeRPC().StartNode(this.AdminContext(), &pb.StartNodeRequest{NodeId: params.NodeId})
if err != nil {
this.ErrorPage(err)
return
}
if resp.IsOk {
this.Success()
}
this.Fail("启动失败:" + resp.Error)
}