mirror of
https://github.com/grafana/grafana.git
synced 2026-07-30 00:08:10 -05:00
E2C: Initial config to switch between cloud and onprem pages (#83380)
hacky config to switch between cloud and onprem pages
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
import React from 'react';
|
||||
|
||||
import { config } from '@grafana/runtime';
|
||||
import { Page } from 'app/core/components/Page/Page';
|
||||
|
||||
import { EmptyState } from './onprem/EmptyState/EmptyState';
|
||||
import { Page as CloudPage } from './cloud/Page';
|
||||
import { Page as OnPremPage } from './onprem/Page';
|
||||
|
||||
export default function MigrateToCloud() {
|
||||
return (
|
||||
<Page navId="migrate-to-cloud">
|
||||
<EmptyState />
|
||||
</Page>
|
||||
);
|
||||
// TODO replace this with a proper config value when it's available
|
||||
const isMigrationTarget = config.namespace.startsWith('stack-');
|
||||
|
||||
return <Page navId="migrate-to-cloud">{isMigrationTarget ? <CloudPage /> : <OnPremPage />}</Page>;
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import { GrafanaTheme2 } from '@grafana/data';
|
||||
import { Box, Stack, TextLink, useStyles2 } from '@grafana/ui';
|
||||
import { t, Trans } from 'app/core/internationalization';
|
||||
|
||||
import { InfoItem } from '../../shared/InfoItem';
|
||||
import { InfoItem } from '../shared/InfoItem';
|
||||
|
||||
export const InfoPane = () => {
|
||||
const styles = useStyles2(getStyles);
|
||||
+1
-1
@@ -3,7 +3,7 @@ import React from 'react';
|
||||
import { Box, Button, Text } from '@grafana/ui';
|
||||
import { t, Trans } from 'app/core/internationalization';
|
||||
|
||||
import { InfoItem } from '../../shared/InfoItem';
|
||||
import { InfoItem } from '../shared/InfoItem';
|
||||
|
||||
export const MigrationTokenPane = () => {
|
||||
const onGenerateToken = () => {
|
||||
+1
-1
@@ -7,7 +7,7 @@ import { Grid, useStyles2 } from '@grafana/ui';
|
||||
import { InfoPane } from './InfoPane';
|
||||
import { MigrationTokenPane } from './MigrationTokenPane';
|
||||
|
||||
export const EmptyState = () => {
|
||||
export const Page = () => {
|
||||
const styles = useStyles2(getStyles);
|
||||
|
||||
return (
|
||||
@@ -0,0 +1,8 @@
|
||||
import React from 'react';
|
||||
|
||||
import { EmptyState } from './EmptyState/EmptyState';
|
||||
|
||||
export const Page = () => {
|
||||
// TODO logic to determine whether to show the empty state or the resource table
|
||||
return <EmptyState />;
|
||||
};
|
||||
Reference in New Issue
Block a user