From 87cdda41065943568bc99109c65c8fe2434c6f88 Mon Sep 17 00:00:00 2001 From: Alexander Emelin Date: Thu, 16 Sep 2021 18:34:12 +0300 Subject: [PATCH] Live: return pipeline menu, now with feature toggle (#39280) --- pkg/api/index.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/pkg/api/index.go b/pkg/api/index.go index bc445f464f8..c039bb9e941 100644 --- a/pkg/api/index.go +++ b/pkg/api/index.go @@ -318,6 +318,30 @@ func (hs *HTTPServer) getNavTree(c *models.ReqContext, hasEditPerm bool) ([]*dto }) } + if hs.Cfg.FeatureToggles["live-pipeline"] { + liveNavLinks := []*dtos.NavLink{} + + liveNavLinks = append(liveNavLinks, &dtos.NavLink{ + Text: "Status", Id: "live-status", Url: hs.Cfg.AppSubURL + "/live", Icon: "exchange-alt", + }) + liveNavLinks = append(liveNavLinks, &dtos.NavLink{ + Text: "Pipeline", Id: "live-pipeline", Url: hs.Cfg.AppSubURL + "/live/pipeline", Icon: "arrow-to-right", + }) + liveNavLinks = append(liveNavLinks, &dtos.NavLink{ + Text: "Cloud", Id: "live-cloud", Url: hs.Cfg.AppSubURL + "/live/cloud", Icon: "cloud-upload", + }) + + navTree = append(navTree, &dtos.NavLink{ + Id: "live", + Text: "Live", + SubTitle: "Event Streaming", + Icon: "exchange-alt", + Url: hs.Cfg.AppSubURL + "/live", + Children: liveNavLinks, + HideFromMenu: true, + }) + } + if len(configNodes) > 0 { navTree = append(navTree, &dtos.NavLink{ Id: dtos.NavIDCfg,