前端页面
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package httpdnsutils
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
)
|
||||
@@ -11,39 +13,55 @@ func AddLeftMenu(action *actionutils.ParentAction) {
|
||||
action.Data["teaSubMenu"] = tab
|
||||
action.Data["leftMenuItems"] = []maps.Map{
|
||||
{
|
||||
"name": "集群管理",
|
||||
"name": "\u96c6\u7fa4\u7ba1\u7406",
|
||||
"url": "/httpdns/clusters",
|
||||
"isActive": tab == "cluster",
|
||||
},
|
||||
{
|
||||
"name": "全局配置",
|
||||
"url": "/httpdns/policies",
|
||||
"isActive": tab == "policy",
|
||||
},
|
||||
{
|
||||
"name": "应用管理",
|
||||
"name": "\u5e94\u7528\u7ba1\u7406",
|
||||
"url": "/httpdns/apps",
|
||||
"isActive": tab == "app",
|
||||
},
|
||||
{
|
||||
"name": "SDK接入引导",
|
||||
"url": "/httpdns/guide",
|
||||
"isActive": tab == "guide",
|
||||
},
|
||||
{
|
||||
"name": "解析日志",
|
||||
"name": "\u8bbf\u95ee\u65e5\u5fd7",
|
||||
"url": "/httpdns/resolveLogs",
|
||||
"isActive": tab == "resolveLogs",
|
||||
},
|
||||
{
|
||||
"name": "运行日志",
|
||||
"name": "\u8fd0\u884c\u65e5\u5fd7",
|
||||
"url": "/httpdns/runtimeLogs",
|
||||
"isActive": tab == "runtimeLogs",
|
||||
},
|
||||
{
|
||||
"name": "解析测试",
|
||||
"name": "\u89e3\u6790\u6d4b\u8bd5",
|
||||
"url": "/httpdns/sandbox",
|
||||
"isActive": tab == "sandbox",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// AddClusterTabbar builds the top tabbar on cluster pages.
|
||||
func AddClusterTabbar(action *actionutils.ParentAction, clusterName string, clusterId int64, selectedTab string) {
|
||||
cid := strconv.FormatInt(clusterId, 10)
|
||||
tabbar := actionutils.NewTabbar()
|
||||
tabbar.Add("", "", "/httpdns/clusters", "arrow left", false)
|
||||
titleItem := tabbar.Add(clusterName, "", "/httpdns/clusters/cluster?clusterId="+cid, "angle right", true)
|
||||
titleItem.IsTitle = true
|
||||
tabbar.Add("\u8282\u70b9\u5217\u8868", "", "/httpdns/clusters/cluster?clusterId="+cid, "server", selectedTab == "node")
|
||||
tabbar.Add("\u96c6\u7fa4\u8bbe\u7f6e", "", "/httpdns/clusters/cluster/settings?clusterId="+cid, "setting", selectedTab == "setting")
|
||||
tabbar.Add("\u5220\u9664\u96c6\u7fa4", "", "/httpdns/clusters/delete?clusterId="+cid, "trash", selectedTab == "delete")
|
||||
actionutils.SetTabbar(action, tabbar)
|
||||
}
|
||||
|
||||
// AddAppTabbar builds the top tabbar on app pages.
|
||||
func AddAppTabbar(action *actionutils.ParentAction, appName string, appId int64, selectedTab string) {
|
||||
aid := strconv.FormatInt(appId, 10)
|
||||
tabbar := actionutils.NewTabbar()
|
||||
tabbar.Add("", "", "/httpdns/apps", "arrow left", false)
|
||||
titleItem := tabbar.Add(appName, "", "/httpdns/apps/domains?appId="+aid, "angle right", true)
|
||||
titleItem.IsTitle = true
|
||||
tabbar.Add("\u57df\u540d\u5217\u8868", "", "/httpdns/apps/domains?appId="+aid, "list", selectedTab == "domains")
|
||||
tabbar.Add("\u5e94\u7528\u8bbe\u7f6e", "", "/httpdns/apps/app/settings?appId="+aid, "setting", selectedTab == "settings")
|
||||
tabbar.Add("\u5220\u9664\u5e94\u7528", "", "/httpdns/apps/delete?appId="+aid, "trash", selectedTab == "delete")
|
||||
actionutils.SetTabbar(action, tabbar)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user