Files
grafana/public/app/features/dashboard/folder_dashboards_ctrl.ts

26 lines
696 B
TypeScript
Raw Normal View History

2017-12-20 12:33:33 +01:00
import { FolderPageLoader } from './folder_page_loader';
import locationUtil from 'app/core/utils/location_util';
export class FolderDashboardsCtrl {
navModel: any;
folderId: number;
uid: string;
/** @ngInject */
constructor(private backendSrv, navModelSrv, private $routeParams, $location) {
if (this.$routeParams.uid) {
this.uid = $routeParams.uid;
const loader = new FolderPageLoader(this.backendSrv);
2017-12-13 15:51:59 +01:00
loader.load(this, this.uid, 'manage-folder-dashboards').then(folder => {
const url = locationUtil.stripBaseFromUrl(folder.meta.url);
if (url !== $location.path()) {
$location.path(url).replace();
}
});
}
}
}