Files
EdgeAdmin/internal/web/actions/default/clusters/cluster/init.go

73 lines
3.0 KiB
Go
Raw Normal View History

2020-09-06 16:19:34 +08:00
package cluster
import (
2020-12-03 11:03:12 +08:00
"github.com/TeaOSLab/EdgeAdmin/internal/configloaders"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/boards"
2020-10-28 18:21:11 +08:00
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/groups"
2020-09-06 16:19:34 +08:00
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/node"
nodeboards "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/node/boards"
2021-04-29 16:47:45 +08:00
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/node/monitor"
2021-05-05 19:51:13 +08:00
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/node/thresholds"
2020-09-06 16:19:34 +08:00
clusters "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/clusterutils"
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
"github.com/iwind/TeaGo"
)
func init() {
TeaGo.BeforeStart(func(server *TeaGo.Server) {
server.
2020-12-03 11:03:12 +08:00
Helper(helpers.NewUserMustAuth(configloaders.AdminModuleCodeNode)).
2020-09-06 16:19:34 +08:00
Helper(clusters.NewClusterHelper()).
Prefix("/clusters/cluster").
Get("", new(IndexAction)).
Get("/nodes", new(NodesAction)).
GetPost("/installNodes", new(InstallNodesAction)).
GetPost("/installRemote", new(InstallRemoteAction)).
Post("/installStatus", new(InstallStatusAction)).
2020-10-28 12:35:49 +08:00
GetPost("/upgradeRemote", new(UpgradeRemoteAction)).
Post("/upgradeStatus", new(UpgradeStatusAction)).
2020-10-25 19:45:42 +08:00
GetPost("/delete", new(DeleteAction)).
GetPost("/createNode", new(CreateNodeAction)).
GetPost("/createBatch", new(CreateBatchAction)).
GetPost("/updateNodeSSH", new(UpdateNodeSSHAction)).
2020-10-28 12:47:24 +08:00
GetPost("/installManual", new(InstallManualAction)).
2020-09-06 16:19:34 +08:00
// 节点相关
Prefix("/clusters/cluster/node").
Get("", new(node.IndexAction)).
GetPost("/update", new(node.UpdateAction)).
GetPost("/install", new(node.InstallAction)).
Post("/updateInstallStatus", new(node.UpdateInstallStatusAction)).
Post("/status", new(node.StatusAction)).
Get("/logs", new(node.LogsAction)).
Post("/start", new(node.StartAction)).
Post("/stop", new(node.StopAction)).
Post("/up", new(node.UpAction)).
Get("/monitor", new(monitor.IndexAction)).
Post("/monitor/cpu", new(monitor.CpuAction)).
Post("/monitor/memory", new(monitor.MemoryAction)).
Post("/monitor/load", new(monitor.LoadAction)).
Post("/monitor/trafficIn", new(monitor.TrafficInAction)).
Post("/monitor/trafficOut", new(monitor.TrafficOutAction)).
Post("/monitor/connections", new(monitor.ConnectionsAction)).
Get("/thresholds", new(thresholds.IndexAction)).
Get("/detail", new(node.DetailAction)).
Get("/boards", new(nodeboards.IndexAction)).
2020-10-28 18:21:11 +08:00
// 分组相关
Prefix("/clusters/cluster/groups").
Get("", new(groups.IndexAction)).
GetPost("/createPopup", new(groups.CreatePopupAction)).
GetPost("/updatePopup", new(groups.UpdatePopupAction)).
Post("/delete", new(groups.DeleteAction)).
Post("/sort", new(groups.SortAction)).
GetPost("/selectPopup", new(groups.SelectPopupAction)).
2020-10-28 18:21:11 +08:00
// 看板相关
Prefix("/clusters/cluster/boards").
Get("", new(boards.IndexAction)).
2020-09-06 16:19:34 +08:00
EndAll()
})
}