mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 08:35:43 -06:00
* Dashboard embed: Set up route * Dashboard embed: Cleanup * Dashboard embed: Separate routes * Dashboard embed: Render dashboard page * Dashboard embed: Add toolbar * Dashboard embed: Send JSON on save * Dashboard embed: Add JSON param * Dashboard embed: Make the dashboard editable * Fix sending dashboard to remote server * Add notifications * Add "dashboardEmbed" feature toggle * Use the toggle * Update toggles * Add toggle on backend * Add get JSON endpoint * Add drawer * Close drawer on success * Update toggles * Cleanup * Update toggle * Allow embedding for the d-embed url * Allow embedding via custom X-Allow-Embedding header * Use callbackUrl * Cleanup * Update public/app/features/dashboard/containers/EmbeddedDashboardPage.tsx Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com> * Use theme for spacing * Update toggles * Update public/app/features/dashboard/components/EmbeddedDashboard/SaveDashboardForm.tsx Co-authored-by: Polina Boneva <13227501+polibb@users.noreply.github.com> * Add select data source modal --------- Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com> Co-authored-by: Polina Boneva <13227501+polibb@users.noreply.github.com>
56 lines
1.6 KiB
TypeScript
56 lines
1.6 KiB
TypeScript
import { SafeDynamicImport } from '../../core/components/DynamicImports/SafeDynamicImport';
|
|
import { config } from '../../core/config';
|
|
import { RouteDescriptor } from '../../core/navigation/types';
|
|
import { DashboardRoutes } from '../../types';
|
|
|
|
export const getPublicDashboardRoutes = (): RouteDescriptor[] => {
|
|
if (config.featureToggles.publicDashboards) {
|
|
return [
|
|
{
|
|
path: '/dashboard/public',
|
|
pageClass: 'page-dashboard',
|
|
routeName: DashboardRoutes.Public,
|
|
component: SafeDynamicImport(
|
|
() =>
|
|
import(
|
|
/* webpackChunkName: "ListPublicDashboardPage" */ '../../features/manage-dashboards/PublicDashboardListPage'
|
|
)
|
|
),
|
|
},
|
|
{
|
|
path: '/public-dashboards/:accessToken',
|
|
pageClass: 'page-dashboard',
|
|
routeName: DashboardRoutes.Public,
|
|
chromeless: true,
|
|
component: SafeDynamicImport(
|
|
() =>
|
|
import(
|
|
/* webpackChunkName: "PublicDashboardPage" */ '../../features/dashboard/containers/PublicDashboardPage'
|
|
)
|
|
),
|
|
},
|
|
];
|
|
}
|
|
return [];
|
|
};
|
|
|
|
export const getEmbeddedDashboardRoutes = (): RouteDescriptor[] => {
|
|
if (config.featureToggles.dashboardEmbed) {
|
|
return [
|
|
{
|
|
path: '/d-embed',
|
|
pageClass: 'dashboard-embed',
|
|
routeName: DashboardRoutes.Embedded,
|
|
component: SafeDynamicImport(
|
|
() =>
|
|
import(
|
|
/* webpackChunkName: "EmbeddedDashboardPage" */ '../../features/dashboard/containers/EmbeddedDashboardPage'
|
|
)
|
|
),
|
|
},
|
|
];
|
|
}
|
|
|
|
return [];
|
|
};
|