2020-09-06 16:19:34 +08:00
|
|
|
package node
|
2020-07-30 22:41:35 +08:00
|
|
|
|
|
|
|
|
import (
|
2020-10-27 12:33:27 +08:00
|
|
|
"fmt"
|
2024-07-27 15:42:58 +08:00
|
|
|
"strconv"
|
|
|
|
|
|
2021-07-06 20:06:20 +08:00
|
|
|
teaconst "github.com/TeaOSLab/EdgeAdmin/internal/const"
|
2020-07-30 22:41:35 +08:00
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
2021-07-06 20:06:20 +08:00
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/node/nodeutils"
|
2020-07-30 22:41:35 +08:00
|
|
|
)
|
|
|
|
|
|
2021-05-26 14:43:29 +08:00
|
|
|
type IndexAction struct {
|
2020-07-30 22:41:35 +08:00
|
|
|
actionutils.ParentAction
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-26 14:43:29 +08:00
|
|
|
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
|
|
|
}
|
|
|
|
|
|
2021-05-26 14:43:29 +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
|
|
|
|
2021-07-06 20:06:20 +08:00
|
|
|
if teaconst.IsPlus {
|
|
|
|
|
this.RedirectURL("/clusters/cluster/node/boards?clusterId=" + fmt.Sprintf("%d", this.Data["clusterId"]) + "&nodeId=" + strconv.FormatInt(params.NodeId, 10))
|
2021-05-12 21:37:43 +08:00
|
|
|
} else {
|
2021-07-26 10:09:07 +08:00
|
|
|
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
|
|
|
}
|
|
|
|
|
}
|