dashboards: add new default frontend route for loading a dashboard

New default route /d/<uid>/<slug of dashboard title> where dashboard
are loaded by unique identifier.
If old route /dashboard/db/<slug of dashboard tile> are used,
try to lookup dashboard by slug and redirect to new default route.
 #7883
This commit is contained in:
Marcus Efraimsson
2018-01-31 00:26:26 +01:00
parent 369597f7b2
commit aefcff26a6
4 changed files with 25 additions and 5 deletions

View File

@@ -225,6 +225,10 @@ export class BackendSrv {
return this.get('/api/dashboards/' + type + '/' + slug);
}
getDashboardByUid(uid: string) {
return this.get(`/api/dashboards/uid/${uid}`);
}
saveDashboard(dash, options) {
options = options || {};