mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-03 20:40:26 +08:00
优化界面
This commit is contained in:
@@ -29,9 +29,9 @@ func (this *ClusterHelper) BeforeAction(actionPtr actions.ActionWrapper) (goNext
|
||||
|
||||
action.Data["teaMenu"] = "clusters"
|
||||
|
||||
selectedTabbar := action.Data.GetString("mainTab")
|
||||
clusterId := action.ParamInt64("clusterId")
|
||||
clusterIdString := strconv.FormatInt(clusterId, 10)
|
||||
var selectedTabbar = action.Data.GetString("mainTab")
|
||||
var clusterId = action.ParamInt64("clusterId")
|
||||
var clusterIdString = strconv.FormatInt(clusterId, 10)
|
||||
action.Data["clusterId"] = clusterId
|
||||
|
||||
if clusterId > 0 {
|
||||
@@ -57,18 +57,39 @@ func (this *ClusterHelper) BeforeAction(actionPtr actions.ActionWrapper) (goNext
|
||||
return
|
||||
}
|
||||
|
||||
var nodeId = action.ParamInt64("nodeId")
|
||||
var isInCluster = nodeId <= 0
|
||||
|
||||
var tabbar = actionutils.NewTabbar()
|
||||
tabbar.Add("", "", "/clusters", "arrow left", false)
|
||||
{
|
||||
var item = tabbar.Add(cluster.Name, "", "/clusters/cluster?clusterId="+clusterIdString, "angle right", true)
|
||||
item["isTitle"] = true
|
||||
var url = "/clusters/cluster?clusterId=" + clusterIdString
|
||||
if !isInCluster {
|
||||
url = "/clusters/cluster/nodes?clusterId=" + clusterIdString
|
||||
}
|
||||
|
||||
var item = tabbar.Add(cluster.Name, "", url, "angle right", true)
|
||||
item.IsTitle = true
|
||||
}
|
||||
if teaconst.IsPlus {
|
||||
tabbar.Add("看板", "", "/clusters/cluster/boards?clusterId="+clusterIdString, "chart line area", selectedTabbar == "board")
|
||||
{
|
||||
var item = tabbar.Add("集群看板", "", "/clusters/cluster/boards?clusterId="+clusterIdString, "chart line area", selectedTabbar == "board")
|
||||
item.IsDisabled = !isInCluster
|
||||
}
|
||||
}
|
||||
{
|
||||
var item = tabbar.Add("节点列表", "", "/clusters/cluster/nodes?clusterId="+clusterIdString, "server", selectedTabbar == "node")
|
||||
item.IsDisabled = !isInCluster
|
||||
}
|
||||
|
||||
{
|
||||
var item = tabbar.Add("集群设置", "", "/clusters/cluster/settings?clusterId="+clusterIdString, "setting", selectedTabbar == "setting")
|
||||
item.IsDisabled = !isInCluster
|
||||
}
|
||||
{
|
||||
var item = tabbar.Add("删除集群", "", "/clusters/cluster/delete?clusterId="+clusterIdString, "trash", selectedTabbar == "delete")
|
||||
item.IsDisabled = !isInCluster
|
||||
}
|
||||
tabbar.Add("节点", "", "/clusters/cluster/nodes?clusterId="+clusterIdString, "server", selectedTabbar == "node")
|
||||
tabbar.Add("设置", "", "/clusters/cluster/settings?clusterId="+clusterIdString, "setting", selectedTabbar == "setting")
|
||||
tabbar.Add("删除", "", "/clusters/cluster/delete?clusterId="+clusterIdString, "trash", selectedTabbar == "delete")
|
||||
actionutils.SetTabbar(action, tabbar)
|
||||
|
||||
// 左侧菜单
|
||||
|
||||
@@ -110,7 +110,7 @@ func (this *ServerHelper) createLeftMenu(action *actions.ActionObject) {
|
||||
tabbar.Add("", "", "/servers", "left arrow", false)
|
||||
if len(serverConfig.Name) > 0 {
|
||||
var item = tabbar.Add(serverConfig.Name, "", "/servers/server?serverId="+serverIdString, "angle right", true)
|
||||
item["isTitle"] = true
|
||||
item.IsTitle = true
|
||||
}
|
||||
|
||||
if teaconst.IsPlus {
|
||||
|
||||
Reference in New Issue
Block a user