From 12e2bf2f859b72f84c7387268cd34133c53fc818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 28 Aug 2014 16:44:16 +0200 Subject: [PATCH] Trying to restore broken features and some polishing --- src/app/controllers/dashboardCtrl.js | 26 +++++++++--------- src/app/partials/annotations_editor.html | 34 +++++++++++++++--------- src/app/partials/dasheditor.html | 25 +++++++++++------ src/app/partials/submenu.html | 5 ++-- src/app/partials/templating_editor.html | 2 ++ src/app/services/panelMove.js | 10 +++++-- src/app/services/templateSrv.js | 5 +--- 7 files changed, 65 insertions(+), 42 deletions(-) diff --git a/src/app/controllers/dashboardCtrl.js b/src/app/controllers/dashboardCtrl.js index 99b7a45a84f..346c25ec1a4 100644 --- a/src/app/controllers/dashboardCtrl.js +++ b/src/app/controllers/dashboardCtrl.js @@ -48,28 +48,22 @@ function (angular, $, config, _) { $scope.dashboard = dashboardSrv.create(dashboardData); $scope.dashboardViewState = dashboardViewStateSrv.create($scope); - $scope.grafana.style = $scope.dashboard.style; - + // init services timeSrv.init($scope.dashboard); templateValuesSrv.init($scope.dashboard); + panelMoveSrv.init($scope.dashboard, $scope); - $scope.submenuEnabled = $scope.dashboard.templating.enable || $scope.dashboard.annotations.enable; - - var panelMove = panelMoveSrv.create($scope.dashboard); - - $scope.panelMoveDrop = panelMove.onDrop; - $scope.panelMoveStart = panelMove.onStart; - $scope.panelMoveStop = panelMove.onStop; - $scope.panelMoveOver = panelMove.onOver; - $scope.panelMoveOut = panelMove.onOut; - - window.document.title = config.window_title_prefix + $scope.dashboard.title; - + $scope.checkFeatureToggles(); dashboardKeybindings.shortcuts($scope); $scope.emitAppEvent("dashboard-loaded", $scope.dashboard); }; + $scope.setWindowTitleAndTheme = function() { + window.document.title = config.window_title_prefix + $scope.dashboard.title; + $scope.grafana.style = $scope.dashboard.style; + }; + $scope.isPanel = function(obj) { if(!_.isNull(obj) && !_.isUndefined(obj) && !_.isUndefined(obj.type)) { return true; @@ -113,6 +107,10 @@ function (angular, $, config, _) { } }; + $scope.checkFeatureToggles = function() { + $scope.submenuEnabled = $scope.dashboard.templating.enable || $scope.dashboard.annotations.enable; + }; + $scope.setEditorTabs = function(panelMeta) { $scope.editorTabs = ['General','Panel']; if(!_.isUndefined(panelMeta.editorTabs)) { diff --git a/src/app/partials/annotations_editor.html b/src/app/partials/annotations_editor.html index f6aca707f46..f23a425e9c6 100644 --- a/src/app/partials/annotations_editor.html +++ b/src/app/partials/annotations_editor.html @@ -14,20 +14,30 @@
-
diff --git a/src/app/partials/dasheditor.html b/src/app/partials/dasheditor.html index 8bee04121b4..30c43704f8b 100644 --- a/src/app/partials/dasheditor.html +++ b/src/app/partials/dasheditor.html @@ -49,14 +49,19 @@
-
-
Rows
- +
+
+ - - +
+ {{row.title}} + {{row.title}} + + + +
@@ -66,9 +71,13 @@
-
Feature toggles
-
- +
+ + +
+
+ +
diff --git a/src/app/partials/submenu.html b/src/app/partials/submenu.html index b4ab6e6f226..b1fb5f85267 100644 --- a/src/app/partials/submenu.html +++ b/src/app/partials/submenu.html @@ -17,7 +17,7 @@ -