dashboards: make scripted dashboards work using the old legacy urls

Scripted dashboards are still requested from /dashboard/script/scripted.js
#7883
This commit is contained in:
Marcus Efraimsson
2018-01-31 14:07:49 +01:00
parent a99331cdb9
commit 57edf89033
5 changed files with 22 additions and 4 deletions

View File

@@ -14,7 +14,7 @@ export class SoloPanelCtrl {
$scope.onAppEvent('dashboard-initialized', $scope.initPanelScope);
// if no uid, redirect to new route based on slug
if (!$routeParams.uid) {
if (!($routeParams.type === 'script' || $routeParams.type === 'snapshot') && !$routeParams.uid) {
backendSrv.get(`/api/dashboards/db/${$routeParams.slug}`).then(res => {
if (res) {
$location.path(res.meta.url.replace('/d/', '/d-solo/'));