diff --git a/pkg/services/navtree/models.go b/pkg/services/navtree/models.go index 99abe7ac4ea..96a249efb50 100644 --- a/pkg/services/navtree/models.go +++ b/pkg/services/navtree/models.go @@ -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", diff --git a/pkg/services/navtree/navtreeimpl/admin.go b/pkg/services/navtree/navtreeimpl/admin.go index ae85a68a9dd..ce30488a36b 100644 --- a/pkg/services/navtree/navtreeimpl/admin.go +++ b/pkg/services/navtree/navtreeimpl/admin.go @@ -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", diff --git a/public/app/core/utils/navBarItem-translations.ts b/public/app/core/utils/navBarItem-translations.ts index 7b246a49f85..c1353ed8cbe 100644 --- a/public/app/core/utils/navBarItem-translations.ts +++ b/public/app/core/utils/navBarItem-translations.ts @@ -118,6 +118,8 @@ export function getNavTitle(navId: string | undefined) { return t('nav.server-settings.title', 'Settings'); case 'storage': return t('nav.storage.title', 'Storage'); + case 'migrate-to-cloud': + return t('nav.migrate-to-cloud.title', 'Migrate to Grafana Cloud'); case 'upgrading': return t('nav.upgrading.title', 'Stats and license'); case 'monitoring': @@ -248,6 +250,11 @@ export function getNavSubTitle(navId: string | undefined) { return t('nav.server-settings.subtitle', 'View the settings defined in your Grafana config'); case 'storage': return t('nav.storage.subtitle', 'Manage file storage'); + case 'migrate-to-cloud': + return t( + 'nav.migrate-to-cloud.subtitle', + 'Copy data sources, dashboards, and alerts from this installation to a cloud stack' + ); case 'support-bundles': return t('nav.support-bundles.subtitle', 'Download support bundles'); case 'admin': diff --git a/public/app/features/admin/migrate-to-cloud/MigrateToCloud.tsx b/public/app/features/admin/migrate-to-cloud/MigrateToCloud.tsx new file mode 100644 index 00000000000..a213fe2ae60 --- /dev/null +++ b/public/app/features/admin/migrate-to-cloud/MigrateToCloud.tsx @@ -0,0 +1,7 @@ +import React from 'react'; + +import { Page } from 'app/core/components/Page/Page'; + +export default function MigrateToCloud() { + return TODO; +} diff --git a/public/app/routes/routes.tsx b/public/app/routes/routes.tsx index 5f2cf1423c0..1f64f907745 100644 --- a/public/app/routes/routes.tsx +++ b/public/app/routes/routes.tsx @@ -362,6 +362,13 @@ export function getAppRoutes(): RouteDescriptor[] { () => import(/* webpackChunkName: "ServerStats" */ 'app/features/admin/ServerStats') ), }, + config.featureToggles.onPremToCloudMigrations && { + path: '/admin/migrate-to-cloud', + roles: () => ['ServerAdmin'], + component: SafeDynamicImport( + () => import(/* webpackChunkName: "MigrateToCloud" */ 'app/features/admin/migrate-to-cloud/MigrateToCloud') + ), + }, // LOGIN / SIGNUP { path: '/login', diff --git a/public/locales/en-US/grafana.json b/public/locales/en-US/grafana.json index 4a5f64e0b05..2edc000e590 100644 --- a/public/locales/en-US/grafana.json +++ b/public/locales/en-US/grafana.json @@ -876,6 +876,10 @@ "manage-folder": { "subtitle": "Manage folder dashboards and permissions" }, + "migrate-to-cloud": { + "subtitle": "Copy data sources, dashboards, and alerts from this installation to a cloud stack", + "title": "Migrate to Grafana Cloud" + }, "monitoring": { "subtitle": "Monitoring and infrastructure apps", "title": "Observability" diff --git a/public/locales/pseudo-LOCALE/grafana.json b/public/locales/pseudo-LOCALE/grafana.json index 2e45e4f0383..9d894e7f4da 100644 --- a/public/locales/pseudo-LOCALE/grafana.json +++ b/public/locales/pseudo-LOCALE/grafana.json @@ -876,6 +876,10 @@ "manage-folder": { "subtitle": "Mäʼnäģę ƒőľđęř đäşĥþőäřđş äʼnđ pęřmįşşįőʼnş" }, + "migrate-to-cloud": { + "subtitle": "Cőpy đäŧä şőūřčęş, đäşĥþőäřđş, äʼnđ äľęřŧş ƒřőm ŧĥįş įʼnşŧäľľäŧįőʼn ŧő ä čľőūđ şŧäčĸ", + "title": "Mįģřäŧę ŧő Ğřäƒäʼnä Cľőūđ" + }, "monitoring": { "subtitle": "Mőʼnįŧőřįʼnģ äʼnđ įʼnƒřäşŧřūčŧūřę äppş", "title": "Øþşęřväþįľįŧy"