2021-05-25 15:47:40 +08:00
|
|
|
package cluster
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/configloaders"
|
2021-05-26 14:43:29 +08:00
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/ns/clusters/cluster/node"
|
2021-05-25 15:47:40 +08:00
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/ns/clusters/clusterutils"
|
|
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
|
|
|
|
|
"github.com/iwind/TeaGo"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
TeaGo.BeforeStart(func(server *TeaGo.Server) {
|
|
|
|
|
server.
|
|
|
|
|
Helper(helpers.NewUserMustAuth(configloaders.AdminModuleCodeNS)).
|
|
|
|
|
Helper(new(clusterutils.ClusterHelper)).
|
|
|
|
|
Data("teaMenu", "ns").
|
|
|
|
|
Data("teaSubMenu", "cluster").
|
|
|
|
|
Prefix("/ns/clusters/cluster").
|
|
|
|
|
Get("", new(IndexAction)).
|
|
|
|
|
GetPost("/delete", new(DeleteAction)).
|
2021-05-26 14:43:29 +08:00
|
|
|
GetPost("/createNode", new(CreateNodeAction)).
|
|
|
|
|
Post("/deleteNode", new(DeleteNodeAction)).
|
2021-06-03 22:09:12 +08:00
|
|
|
Get("/upgradeRemote", new(UpgradeRemoteAction)).
|
2021-08-11 20:59:58 +08:00
|
|
|
GetPost("/updateNodeSSH", new(UpdateNodeSSHAction)).
|
2021-05-26 14:43:29 +08:00
|
|
|
|
|
|
|
|
// 节点相关
|
|
|
|
|
Prefix("/ns/clusters/cluster/node").
|
|
|
|
|
Get("", new(node.IndexAction)).
|
|
|
|
|
Get("/logs", new(node.LogsAction)).
|
|
|
|
|
GetPost("/update", new(node.UpdateAction)).
|
|
|
|
|
GetPost("/install", new(node.InstallAction)).
|
|
|
|
|
Post("/status", new(node.StatusAction)).
|
|
|
|
|
Post("/updateInstallStatus", new(node.UpdateInstallStatusAction)).
|
2021-08-12 11:47:27 +08:00
|
|
|
Post("/start", new(node.StartAction)).
|
|
|
|
|
Post("/stop", new(node.StopAction)).
|
2021-05-25 15:47:40 +08:00
|
|
|
EndAll()
|
|
|
|
|
})
|
|
|
|
|
}
|