瀏覽代碼

feat(alerting): add submenu for alerting

bergquist 9 年之前
父節點
當前提交
149c2ae913
共有 1 個文件被更改,包括 9 次插入3 次删除
  1. 9 3
      pkg/api/index.go

+ 9 - 3
pkg/api/index.go

@@ -80,10 +80,16 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) {
 	})
 
 	if setting.AlertingEnabled && (c.OrgRole == m.ROLE_ADMIN || c.OrgRole == m.ROLE_EDITOR) {
+		alertChildNavs := []*dtos.NavLink{
+			{Text: "Home", Url: setting.AppSubUrl + "/alerting"},
+			{Text: "Notifications", Url: setting.AppSubUrl + "/alerting/notifications"},
+		}
+
 		data.MainNavLinks = append(data.MainNavLinks, &dtos.NavLink{
-			Text: "Alerting",
-			Icon: "icon-gf icon-gf-monitoring",
-			Url:  setting.AppSubUrl + "/alerting",
+			Text:     "Alerting",
+			Icon:     "icon-gf icon-gf-monitoring",
+			Url:      setting.AppSubUrl + "/alerting",
+			Children: alertChildNavs,
 		})
 	}