2020-10-17 21:15:22 +08:00
|
|
|
package settings
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
|
|
|
|
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
|
|
|
|
"github.com/iwind/TeaGo/actions"
|
|
|
|
|
)
|
|
|
|
|
|
2020-10-20 16:45:10 +08:00
|
|
|
type HealthRunPopupAction struct {
|
2020-10-17 21:15:22 +08:00
|
|
|
actionutils.ParentAction
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-20 16:45:10 +08:00
|
|
|
func (this *HealthRunPopupAction) Init() {
|
2020-10-17 21:15:22 +08:00
|
|
|
this.Nav("", "", "")
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-20 16:45:10 +08:00
|
|
|
func (this *HealthRunPopupAction) RunGet(params struct{}) {
|
2020-10-17 21:15:22 +08:00
|
|
|
|
|
|
|
|
this.Show()
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-20 16:45:10 +08:00
|
|
|
func (this *HealthRunPopupAction) RunPost(params struct {
|
2020-10-17 21:15:22 +08:00
|
|
|
ClusterId int64
|
|
|
|
|
|
|
|
|
|
Must *actions.Must
|
|
|
|
|
}) {
|
|
|
|
|
resp, err := this.RPC().NodeClusterRPC().ExecuteNodeClusterHealthCheck(this.AdminContext(), &pb.ExecuteNodeClusterHealthCheckRequest{ClusterId: params.ClusterId})
|
|
|
|
|
if err != nil {
|
|
|
|
|
this.Fail(err.Error())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.Data["results"] = resp.Results
|
|
|
|
|
this.Success()
|
|
|
|
|
}
|