Files
EdgeAdmin/internal/web/actions/default/clusters/cluster/node/index.go

36 lines
948 B
Go
Raw Normal View History

2020-09-06 16:19:34 +08:00
package node
2020-07-30 22:41:35 +08:00
import (
"fmt"
2024-07-27 15:42:58 +08:00
"strconv"
teaconst "github.com/TeaOSLab/EdgeAdmin/internal/const"
2020-07-30 22:41:35 +08:00
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/node/nodeutils"
2020-07-30 22:41:35 +08:00
)
type IndexAction struct {
2020-07-30 22:41:35 +08:00
actionutils.ParentAction
}
func (this *IndexAction) Init() {
2020-09-06 16:19:34 +08:00
this.Nav("", "node", "node")
this.SecondMenu("nodes")
2020-07-30 22:41:35 +08:00
}
func (this *IndexAction) RunGet(params struct {
2020-07-30 22:41:35 +08:00
NodeId int64
}) {
2021-09-13 16:47:34 +08:00
_, err := nodeutils.InitNodeInfo(this.Parent(), params.NodeId)
2020-08-21 21:09:42 +08:00
if err != nil {
this.ErrorPage(err)
return
}
2020-12-10 16:11:41 +08:00
if teaconst.IsPlus {
this.RedirectURL("/clusters/cluster/node/boards?clusterId=" + fmt.Sprintf("%d", this.Data["clusterId"]) + "&nodeId=" + strconv.FormatInt(params.NodeId, 10))
} else {
this.RedirectURL("/clusters/cluster/node/detail?clusterId=" + fmt.Sprintf("%d", this.Data["clusterId"]) + "&nodeId=" + strconv.FormatInt(params.NodeId, 10))
2020-07-30 22:41:35 +08:00
}
}