mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
converted dashboard_loaders.js to .ts (#9672)
* converted dashboard_loaders.js to .ts * class name change
This commit is contained in:
parent
c84e3c00fe
commit
bb1097b7c9
@ -1,10 +1,9 @@
|
|||||||
define([
|
import coreModule from '../core_module';
|
||||||
'../core_module',
|
|
||||||
],
|
|
||||||
function (coreModule) {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
coreModule.default.controller('LoadDashboardCtrl', function($scope, $routeParams, dashboardLoaderSrv, backendSrv, $location) {
|
export class LoadDashboardCtrl {
|
||||||
|
|
||||||
|
/** @ngInject */
|
||||||
|
constructor($scope, $routeParams, dashboardLoaderSrv, backendSrv, $location) {
|
||||||
$scope.appEvent("dashboard-fetch-start");
|
$scope.appEvent("dashboard-fetch-start");
|
||||||
|
|
||||||
if (!$routeParams.slug) {
|
if (!$routeParams.slug) {
|
||||||
@ -23,10 +22,13 @@ function (coreModule) {
|
|||||||
dashboardLoaderSrv.loadDashboard($routeParams.type, $routeParams.slug).then(function(result) {
|
dashboardLoaderSrv.loadDashboard($routeParams.type, $routeParams.slug).then(function(result) {
|
||||||
$scope.initDashboard(result, $scope);
|
$scope.initDashboard(result, $scope);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
});
|
export class NewDashboardCtrl {
|
||||||
|
|
||||||
coreModule.default.controller('NewDashboardCtrl', function($scope) {
|
/** @ngInject */
|
||||||
|
constructor($scope) {
|
||||||
$scope.initDashboard({
|
$scope.initDashboard({
|
||||||
meta: { canStar: false, canShare: false, isNew: true },
|
meta: { canStar: false, canShare: false, isNew: true },
|
||||||
dashboard: {
|
dashboard: {
|
||||||
@ -35,12 +37,14 @@ function (coreModule) {
|
|||||||
{
|
{
|
||||||
title: 'Dashboard Row',
|
title: 'Dashboard Row',
|
||||||
height: '250px',
|
height: '250px',
|
||||||
panels:[],
|
panels: [],
|
||||||
isNew: true,
|
isNew: true,
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
}, $scope);
|
}, $scope);
|
||||||
});
|
}
|
||||||
|
}
|
||||||
|
|
||||||
});
|
coreModule.controller('LoadDashboardCtrl', LoadDashboardCtrl);
|
||||||
|
coreModule.controller('NewDashboardCtrl', NewDashboardCtrl);
|
Loading…
Reference in New Issue
Block a user