Files
EdgeAdmin/internal/web/actions/default/nodes/delete.go

27 lines
577 B
Go
Raw Normal View History

2020-07-30 22:41:35 +08:00
package nodes
import (
2020-11-10 21:37:48 +08:00
"github.com/TeaOSLab/EdgeAdmin/internal/oplogs"
2020-07-30 22:41:35 +08:00
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
2020-11-10 21:37:48 +08:00
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
2020-07-30 22:41:35 +08:00
)
type DeleteAction struct {
actionutils.ParentAction
}
func (this *DeleteAction) RunPost(params struct {
NodeId int64
}) {
_, err := this.RPC().NodeRPC().DisableNode(this.AdminContext(), &pb.DisableNodeRequest{NodeId: params.NodeId})
if err != nil {
this.ErrorPage(err)
return
}
2020-11-10 21:37:48 +08:00
// 创建日志
this.CreateLog(oplogs.LevelInfo, "删除节点", params.NodeId)
2020-07-30 22:41:35 +08:00
this.Success()
}