From ea1164322b081c98c164da27f93204c1c0a8b6e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 2 Mar 2015 08:33:06 +0100 Subject: [PATCH] Small fixes --- src/app/features/panel/panelSrv.js | 7 +++++-- src/app/panels/dashlist/module.js | 3 +-- src/app/routes/standalone/fromFile.js | 4 ++-- src/index.html | 19 +++++++++++++------ 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/app/features/panel/panelSrv.js b/src/app/features/panel/panelSrv.js index 7411b887303..a3206803c5f 100644 --- a/src/app/features/panel/panelSrv.js +++ b/src/app/features/panel/panelSrv.js @@ -105,9 +105,12 @@ function (angular, _, config) { $scope.getCurrentDatasource().then(function(datasource) { $scope.datasource = datasource; - return $scope.refreshData($scope.datasource).then(function() { + var promise = $scope.refreshData($scope.datasource); + if (promise) { + promise.then(function() { $scope.panelMeta.loading = false; }); + } else { $scope.panelMeta.loading = false; - }); + } }, function(err) { console.log('Panel data error:', err); diff --git a/src/app/panels/dashlist/module.js b/src/app/panels/dashlist/module.js index e5b4a8169e2..098f5acd956 100644 --- a/src/app/panels/dashlist/module.js +++ b/src/app/panels/dashlist/module.js @@ -61,9 +61,8 @@ function (angular, app, _, config, PanelMeta) { params.tag = $scope.panel.tag; } - backendSrv.get('/api/search', params).then(function(result) { + return backendSrv.search(params).then(function(result) { $scope.dashList = result.dashboards; - $scope.panelMeta.loading = false; }); }; diff --git a/src/app/routes/standalone/fromFile.js b/src/app/routes/standalone/fromFile.js index 0eafa0ed650..8fd03d259ef 100644 --- a/src/app/routes/standalone/fromFile.js +++ b/src/app/routes/standalone/fromFile.js @@ -41,7 +41,7 @@ function (angular, $, config, _) { var file_load = function(file) { return $http({ - url: "app/dashboards/"+file.replace(/\.(?!json)/,"/")+'?' + new Date().getTime(), + url: "/dashboards/"+file.replace(/\.(?!json)/,"/")+'?' + new Date().getTime(), method: "GET", transformResponse: function(response) { return renderTemplate(response,$routeParams); @@ -63,7 +63,7 @@ function (angular, $, config, _) { } file_load(fileToLoad).then(function(result) { - $scope.initDashboard(result, $scope); + $scope.initDashboard({meta: {}, model: result}, $scope); }); }); diff --git a/src/index.html b/src/index.html index b5ff55bca8d..8c55154067f 100644 --- a/src/index.html +++ b/src/index.html @@ -11,17 +11,11 @@ - - - - @@ -41,4 +35,17 @@
+ + +