节点设置中不显示阈值设置

This commit is contained in:
GoEdgeLab
2021-09-25 19:57:22 +08:00
parent a4b7e1ce84
commit 6ee4e9799f

View File

@@ -4,6 +4,7 @@ package nodeutils
import ( import (
"errors" "errors"
teaconst "github.com/TeaOSLab/EdgeAdmin/internal/const"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/iwind/TeaGo/maps" "github.com/iwind/TeaGo/maps"
@@ -49,7 +50,7 @@ func InitNodeInfo(parentAction *actionutils.ParentAction, nodeId int64) (*pb.Nod
var query = "clusterId=" + types.String(clusterId) + "&nodeId=" + types.String(nodeId) var query = "clusterId=" + types.String(clusterId) + "&nodeId=" + types.String(nodeId)
var menuItem = parentAction.Data.GetString("secondMenuItem") var menuItem = parentAction.Data.GetString("secondMenuItem")
parentAction.Data["leftMenuItems"] = []maps.Map{ var menuItems = []maps.Map{
{ {
"name": "基础设置", "name": "基础设置",
"url": prefix + "/update?" + query, "url": prefix + "/update?" + query,
@@ -65,11 +66,17 @@ func InitNodeInfo(parentAction *actionutils.ParentAction, nodeId int64) (*pb.Nod
"url": prefix + "/settings/cache?" + query, "url": prefix + "/settings/cache?" + query,
"isActive": menuItem == "cache", "isActive": menuItem == "cache",
}, },
{ }
"name": "阈值设置", if teaconst.IsPlus {
"url": prefix + "/settings/thresholds?" + query, menuItems = append(menuItems, []maps.Map{
"isActive": menuItem == "threshold", {
}, "name": "阈值设置",
"url": prefix + "/settings/thresholds?" + query,
"isActive": menuItem == "threshold",
},
}...)
}
menuItems = append(menuItems, []maps.Map{
{ {
"name": "SSH设置", "name": "SSH设置",
"url": prefix + "/settings/ssh?" + query, "url": prefix + "/settings/ssh?" + query,
@@ -80,7 +87,8 @@ func InitNodeInfo(parentAction *actionutils.ParentAction, nodeId int64) (*pb.Nod
"url": prefix + "/settings/system?" + query, "url": prefix + "/settings/system?" + query,
"isActive": menuItem == "system", "isActive": menuItem == "system",
}, },
} }...)
parentAction.Data["leftMenuItems"] = menuItems
return nodeResp.Node, nil return nodeResp.Node, nil
} }