diff --git a/public/app/features/dashboard/all.js b/public/app/features/dashboard/all.js index 073ca2ae1d9..65338c3d0f1 100644 --- a/public/app/features/dashboard/all.js +++ b/public/app/features/dashboard/all.js @@ -13,6 +13,7 @@ define([ './timeSrv', './unsavedChangesSrv', './timepicker/timepicker', + './import_list/import_list', './graphiteImportCtrl', './dynamicDashboardSrv', './importCtrl', diff --git a/public/app/features/dashboard/import_list/import_list.ts b/public/app/features/dashboard/import_list/import_list.ts new file mode 100644 index 00000000000..f229e56d425 --- /dev/null +++ b/public/app/features/dashboard/import_list/import_list.ts @@ -0,0 +1,50 @@ +/// + +import angular from 'angular'; +import coreModule from 'app/core/core_module'; + +class DashboardScriptLoader { + +} + +export class DashImportListCtrl { + constructor(private $http) { + console.log('importList', this); + } + + load(json) { + var model = angular.fromJson(json); + console.log(model); + } + + import() { + var url = 'public/app/plugins/datasource/graphite/dashboards/carbon_stats.json'; + this.$http.get(url).then(res => { + this.load(res.data); + }); + } +} + +var template = ` +Import +`; + +export function dashboardImportList() { + return { + restrict: 'E', + template: template, + controller: DashImportListCtrl, + bindToController: true, + controllerAs: 'ctrl', + scope: { + plugin: "=" + } + }; +} + + +coreModule.directive('dashboardImportList', dashboardImportList); + + + + diff --git a/public/app/features/datasources/edit_ctrl.js b/public/app/features/datasources/edit_ctrl.js index c3242f5b565..cbb3cfdd4c5 100644 --- a/public/app/features/datasources/edit_ctrl.js +++ b/public/app/features/datasources/edit_ctrl.js @@ -105,8 +105,6 @@ function (angular, _, config) { $scope.updateFrontendSettings().then(function() { if (test) { $scope.testDatasource(); - } else { - $location.path('datasources'); } }); }); diff --git a/public/app/features/datasources/partials/edit.html b/public/app/features/datasources/partials/edit.html index 00706cb4de5..9fc9eadca64 100644 --- a/public/app/features/datasources/partials/edit.html +++ b/public/app/features/datasources/partials/edit.html @@ -55,6 +55,8 @@ + + Add Save diff --git a/public/app/plugins/datasource/graphite/dashboards/carbon_stats.json b/public/app/plugins/datasource/graphite/dashboards/carbon_stats.json new file mode 100644 index 00000000000..642f32b6e6a --- /dev/null +++ b/public/app/plugins/datasource/graphite/dashboards/carbon_stats.json @@ -0,0 +1,21 @@ +{ + "__inputs": { + "graphite": { + "type": "datasource", + "description": "Graphite datasource" + } + }, + + "title": "Carbon stats", + "version": 1, + "rows": [ + { + "panels": [ + { + "type": "graph", + "datasource": "__$graphite" + } + ] + } + ] +}