2020-09-06 16:19:34 +08:00
|
|
|
package node
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
2023-06-30 18:08:30 +08:00
|
|
|
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
2020-11-10 21:37:48 +08:00
|
|
|
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
2020-09-06 16:19:34 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type UpdateInstallStatusAction struct {
|
|
|
|
|
actionutils.ParentAction
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (this *UpdateInstallStatusAction) RunPost(params struct {
|
|
|
|
|
NodeId int64
|
|
|
|
|
IsInstalled bool
|
|
|
|
|
}) {
|
2020-11-10 21:37:48 +08:00
|
|
|
// 创建日志
|
2023-06-30 18:08:30 +08:00
|
|
|
defer this.CreateLogInfo(codes.Node_LogUpdateNodeInstallationStatus, params.NodeId)
|
2020-11-10 21:37:48 +08:00
|
|
|
|
2020-09-06 16:19:34 +08:00
|
|
|
_, err := this.RPC().NodeRPC().UpdateNodeIsInstalled(this.AdminContext(), &pb.UpdateNodeIsInstalledRequest{
|
|
|
|
|
NodeId: params.NodeId,
|
|
|
|
|
IsInstalled: params.IsInstalled,
|
|
|
|
|
})
|
|
|
|
|
if err != nil {
|
|
|
|
|
this.ErrorPage(err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.Success()
|
|
|
|
|
}
|