Cloud migration UI: Add migrate-to-cloud route (#83072)

* add migrate-to-cloud route

* fix chunk name

* gate route behind feature toggle

* update permission checks
This commit is contained in:
Ashley Harrison
2024-02-21 15:50:13 +00:00
committed by GitHub
parent e1edec02d0
commit c75502dd8c
7 changed files with 40 additions and 0 deletions

View File

@@ -142,6 +142,7 @@ func (root *NavTreeRoot) ApplyAdminIA() {
generalNodeLinks = AppendIfNotNil(generalNodeLinks, root.FindById("global-orgs"))
generalNodeLinks = AppendIfNotNil(generalNodeLinks, root.FindById("feature-toggles"))
generalNodeLinks = AppendIfNotNil(generalNodeLinks, root.FindById("storage"))
generalNodeLinks = AppendIfNotNil(generalNodeLinks, root.FindById("migrate-to-cloud"))
generalNode := &NavLink{
Text: "General",

View File

@@ -135,6 +135,16 @@ func (s *ServiceImpl) getAdminNode(c *contextmodel.ReqContext) (*navtree.NavLink
configNodes = append(configNodes, storage)
}
if s.features.IsEnabled(ctx, featuremgmt.FlagOnPremToCloudMigrations) && c.SignedInUser.IsGrafanaAdmin {
migrateToCloud := &navtree.NavLink{
Text: "Migrate to Grafana Cloud",
Id: "migrate-to-cloud",
SubTitle: "Copy data sources, dashboards, and alerts from this installation to a cloud stack",
Url: s.cfg.AppSubURL + "/admin/migrate-to-cloud",
}
configNodes = append(configNodes, migrateToCloud)
}
configNode := &navtree.NavLink{
Id: navtree.NavIDCfg,
Text: "Administration",