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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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",

View File

@ -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':

View File

@ -0,0 +1,7 @@
import React from 'react';
import { Page } from 'app/core/components/Page/Page';
export default function MigrateToCloud() {
return <Page navId="migrate-to-cloud">TODO</Page>;
}

View File

@ -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',

View File

@ -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"

View File

@ -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"