public dashboards: finalize db schema & v1 feature complete (#50467)

This PR completes public dashboards v1 functionality and simplifies public dashboard conventions. It exists as a large PR so that we are not making constant changes to the database schema.

models.PublicDashboardConfig model replaced with models.PublicDashboard directly
dashboard_public_config table renamed to dashboard_public
models.Dashboard.IsPublic removed from the dashboard and replaced with models.PublicDashboard.isEnabled
Routing now uses a uuid v4 as an access token for viewing a public dashboard anonymously, PublicDashboard.Uid only used as database identifier
Frontend utilizes uuid for auth'd operations and access token for anonymous access
Default to time range defined on dashboard when viewing public dashboard
Add audit fields to public dashboard

Co-authored-by: Owen Smallwood <owen.smallwood@grafana.com>, Ezequiel Victorero <ezequiel.victorero@grafana.com>, Jesse Weaver <jesse.weaver@grafana.com>
This commit is contained in:
Jeff Levin
2022-06-22 13:58:52 -08:00
committed by GitHub
parent 773c269084
commit d076bedb5e
37 changed files with 1326 additions and 645 deletions

View File

@@ -25,6 +25,7 @@ export interface InitDashboardArgs {
urlSlug?: string;
urlType?: string;
urlFolderId?: string | null;
accessToken?: string;
routeName?: string;
fixUrl: boolean;
}
@@ -61,7 +62,7 @@ async function fetchDashboard(
return dashDTO;
}
case DashboardRoutes.Public: {
return await dashboardLoaderSrv.loadDashboard('public', args.urlSlug, args.urlUid);
return await dashboardLoaderSrv.loadDashboard('public', args.urlSlug, args.accessToken);
}
case DashboardRoutes.Normal: {
const dashDTO: DashboardDTO = await dashboardLoaderSrv.loadDashboard(args.urlType, args.urlSlug, args.urlUid);