diff --git a/public/app/directives/dashEditLink.js b/public/app/directives/dashEditLink.js index 67e2856e1fe..6145fb46b57 100644 --- a/public/app/directives/dashEditLink.js +++ b/public/app/directives/dashEditLink.js @@ -6,9 +6,9 @@ function (angular, $) { 'use strict'; var editViewMap = { - 'settings': { src: 'app/partials/dasheditor.html', title: "Settings" }, + 'settings': { src: 'app/features/dashboard/partials/settings.html', title: "Settings" }, 'annotations': { src: 'app/features/annotations/partials/editor.html', title: "Annotations" }, - 'templating': { src: 'app/partials/templating_editor.html', title: "Templating" } + 'templating': { src: 'app/features/templating/partials/editor.html', title: "Templating" } }; angular diff --git a/public/app/features/all.js b/public/app/features/all.js index c8ba6214dc9..92db77a9a5d 100644 --- a/public/app/features/all.js +++ b/public/app/features/all.js @@ -1,5 +1,6 @@ define([ - './panellinkeditor/module', + './panellinks/module', + './dashlinks/module', './annotations/annotationsSrv', './templating/templateSrv', './dashboard/all', diff --git a/public/app/features/dashboard/dashboardSrv.js b/public/app/features/dashboard/dashboardSrv.js index afe5e7964c6..2cc73aaeb9f 100644 --- a/public/app/features/dashboard/dashboardSrv.js +++ b/public/app/features/dashboard/dashboardSrv.js @@ -39,6 +39,7 @@ function (angular, $, kbn, _, moment) { this.snapshot = data.snapshot; this.schemaVersion = data.schemaVersion || 0; this.version = data.version || 0; + this.links = data.links || []; if (this.nav.length === 0) { this.nav.push({ type: 'timepicker' }); diff --git a/public/app/features/dashboard/partials/linksEditor.html b/public/app/features/dashboard/partials/linksEditor.html new file mode 100644 index 00000000000..41c331312b0 --- /dev/null +++ b/public/app/features/dashboard/partials/linksEditor.html @@ -0,0 +1,62 @@ +
+
+
+
Links and Dash Navigation
+ +
+
+
    +
  • + +
  • + +
  • Link title
  • +
  • + +
  • + +
  • Type
  • +
  • + +
  • + +
  • Dashboard
  • +
  • + +
  • + +
  • Url
  • +
  • + +
  • +
+
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
diff --git a/public/app/partials/dasheditor.html b/public/app/features/dashboard/partials/settings.html similarity index 92% rename from public/app/partials/dasheditor.html rename to public/app/features/dashboard/partials/settings.html index c0a1f8930e6..79c1e44981f 100644 --- a/public/app/partials/dasheditor.html +++ b/public/app/features/dashboard/partials/settings.html @@ -105,18 +105,7 @@
-
-
-
Links and Navigation Options
-
-
    -
  • -
  • -
-
-
-
-
+
diff --git a/public/app/features/dashlinks/editor.html b/public/app/features/dashlinks/editor.html new file mode 100644 index 00000000000..c96fb16878d --- /dev/null +++ b/public/app/features/dashlinks/editor.html @@ -0,0 +1,59 @@ +
+
+
Links and Dash Navigation
+ +
+
    +
  • + +
  • + +
  • Type
  • +
  • + +
  • + +
  • Dashboard
  • +
  • + +
  • + +
  • Url
  • +
  • + +
  • + +
  • Title
  • +
  • + +
  • +
+
+
+ + + + + + + + + + + + + + + +
+
+
+ +
+
+ +
+ diff --git a/public/app/features/dashlinks/module.html b/public/app/features/dashlinks/module.html new file mode 100644 index 00000000000..a1f2b719bf3 --- /dev/null +++ b/public/app/features/dashlinks/module.html @@ -0,0 +1 @@ +
dash links
diff --git a/public/app/features/dashlinks/module.js b/public/app/features/dashlinks/module.js new file mode 100644 index 00000000000..a15bcacc670 --- /dev/null +++ b/public/app/features/dashlinks/module.js @@ -0,0 +1,60 @@ +define([ + 'angular', + 'lodash', +], +function (angular, _) { + 'use strict'; + + angular + .module('grafana.directives') + .directive('dashLinksEditor', function() { + return { + scope: { + dashboard: "=" + }, + restrict: 'E', + controller: 'DashLinkCtrl', + templateUrl: 'app/features/dashlinks/editor.html', + link: function() { + } + }; + }).directive('dashLinks', function() { + return { + scope: { + dashboard: "=" + }, + restrict: 'E', + controller: 'DashLinkCtrl', + templateUrl: 'app/features/dashlinks/module.html', + link: function() { + } + }; + }).controller('DashLinkCtrl', function($scope, backendSrv) { + + $scope.dashboard.links = $scope.dashboard.links || []; + + $scope.addLink = function() { + $scope.dashboard.links.push({ + type: 'dashboard', + name: 'Related dashboard' + }); + }; + + $scope.searchDashboards = function(queryStr, callback) { + var query = {query: queryStr}; + + backendSrv.search(query).then(function(result) { + var dashboards = _.map(result.dashboards, function(dash) { + return dash.title; + }); + + callback(dashboards); + }); + }; + + $scope.deleteLink = function(link) { + $scope.dashboard.links = _.without($scope.dashboard.links, link); + }; + + }); +}); diff --git a/public/app/features/panellinkeditor/linkSrv.js b/public/app/features/panellinks/linkSrv.js similarity index 100% rename from public/app/features/panellinkeditor/linkSrv.js rename to public/app/features/panellinks/linkSrv.js diff --git a/public/app/features/panellinkeditor/module.html b/public/app/features/panellinks/module.html similarity index 100% rename from public/app/features/panellinkeditor/module.html rename to public/app/features/panellinks/module.html diff --git a/public/app/features/panellinkeditor/module.js b/public/app/features/panellinks/module.js similarity index 85% rename from public/app/features/panellinkeditor/module.js rename to public/app/features/panellinks/module.js index b5853d01b9b..7b2a9adf25e 100644 --- a/public/app/features/panellinkeditor/module.js +++ b/public/app/features/panellinks/module.js @@ -8,18 +8,18 @@ function (angular, _) { angular .module('grafana.directives') - .directive('panelLinkEditor', function() { + .directive('panelLinksEditor', function() { return { scope: { panel: "=" }, restrict: 'E', - controller: 'PanelLinkEditorCtrl', + controller: 'PanelLinksEditorCtrl', templateUrl: 'app/features/panellinkeditor/module.html', link: function() { } }; - }).controller('PanelLinkEditorCtrl', function($scope, backendSrv) { + }).controller('PanelLinksEditorCtrl', function($scope, backendSrv) { $scope.panel.links = $scope.panel.links || []; diff --git a/public/app/partials/templating_editor.html b/public/app/features/templating/partials/editor.html similarity index 100% rename from public/app/partials/templating_editor.html rename to public/app/features/templating/partials/editor.html diff --git a/public/app/partials/panelgeneral.html b/public/app/partials/panelgeneral.html index 7a4b57b0db8..02db54cd6c6 100644 --- a/public/app/partials/panelgeneral.html +++ b/public/app/partials/panelgeneral.html @@ -48,6 +48,6 @@ - + diff --git a/public/app/partials/submenu.html b/public/app/partials/submenu.html index 66e1b41c8d8..7fa9ce5c7eb 100644 --- a/public/app/partials/submenu.html +++ b/public/app/partials/submenu.html @@ -5,24 +5,6 @@ - - - - - - - - - - - - - - - + +
diff --git a/public/css/less/submenu.less b/public/css/less/submenu.less index f69ac9c5791..592f6244ab6 100644 --- a/public/css/less/submenu.less +++ b/public/css/less/submenu.less @@ -5,7 +5,7 @@ } .submenu-controls { - margin: 10px 10px 0 5px; + margin: 10px 29px 1px 0px; font-size: 16px; } diff --git a/public/css/less/variables.dark.less b/public/css/less/variables.dark.less index 2b62048db3c..7682c1e940c 100644 --- a/public/css/less/variables.dark.less +++ b/public/css/less/variables.dark.less @@ -213,8 +213,8 @@ @navbarCollapseDesktopWidth: @navbarCollapseWidth + 1; @navbarHeight: 52px; -@navbarBackgroundHighlight: @grayDarker; -@navbarBackground: @grayDarker; +@navbarBackgroundHighlight: @bodyBackground; +@navbarBackground: @bodyBackground; @navbarBorder: none; @navbarText: @grayLight;