FEMT: Add feature toggle and expose the service in regular grafana (#104428)

This commit is contained in:
Ryan McKinley
2025-04-25 12:24:25 +03:00
committed by GitHub
parent 29b3738bc8
commit 7b492d7e16
11 changed files with 225 additions and 44 deletions

View File

@ -48,6 +48,7 @@ import (
"github.com/grafana/grafana/pkg/services/dashboards"
"github.com/grafana/grafana/pkg/services/datasources"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/frontend"
"github.com/grafana/grafana/pkg/services/org"
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginaccesscontrol"
publicdashboardsapi "github.com/grafana/grafana/pkg/services/publicdashboards/api"
@ -85,6 +86,14 @@ func (hs *HTTPServer) registerRoutes() {
r.Get("/login", hs.LoginView)
r.Get("/invite/:code", hs.Index)
if hs.Features.IsEnabledGlobally(featuremgmt.FlagMultiTenantFrontend) {
index, err := frontend.NewIndexProvider(hs.Cfg, hs.License)
if err != nil {
panic(err) // ???
}
r.Get("/mtfe", index.HandleRequest)
}
// authed views
r.Get("/", reqSignedIn, hs.Index)
r.Get("/profile/", reqSignedInNoAnonymous, hs.Index)