可以在集群中查看待安装节点、并直接安装节点

This commit is contained in:
GoEdgeLab
2020-10-26 21:14:26 +08:00
parent 7bb652162a
commit 16ab3a5497
36 changed files with 850 additions and 185 deletions

View File

@@ -0,0 +1,35 @@
package cluster
import (
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/iwind/TeaGo/maps"
)
type InstallStatusAction struct {
actionutils.ParentAction
}
func (this *InstallStatusAction) RunPost(params struct {
NodeId int64
}) {
resp, err := this.RPC().NodeRPC().FindNodeInstallStatus(this.AdminContext(), &pb.FindNodeInstallStatusRequest{NodeId: params.NodeId})
if err != nil {
this.ErrorPage(err)
return
}
if resp.InstallStatus == nil {
this.Data["status"] = nil
this.Success()
}
this.Data["status"] = maps.Map{
"isRunning": resp.InstallStatus.IsRunning,
"isFinished": resp.InstallStatus.IsFinished,
"isOk": resp.InstallStatus.IsOk,
"error": resp.InstallStatus.Error,
"errorCode": resp.InstallStatus.ErrorCode,
}
this.Success()
}