diff --git a/package.json b/package.json index eecf826776e..8de8f05cf8a 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "company": "Coding Instinct AB" }, "name": "grafana", - "version": "1.7.0", + "version": "1.8.0", "repository": { "type": "git", "url": "http://github.com/torkelo/grafana.git" diff --git a/src/app/controllers/all.js b/src/app/controllers/all.js index 8d7035bbb65..cf63f0940e0 100644 --- a/src/app/controllers/all.js +++ b/src/app/controllers/all.js @@ -14,4 +14,5 @@ define([ './inspectCtrl', './opentsdbTargetCtrl', './annotationsEditorCtrl', + './templateEditorCtrl', ], function () {}); diff --git a/src/app/controllers/annotationsEditorCtrl.js b/src/app/controllers/annotationsEditorCtrl.js index 60f40eee7cd..371bbad5838 100644 --- a/src/app/controllers/annotationsEditorCtrl.js +++ b/src/app/controllers/annotationsEditorCtrl.js @@ -1,10 +1,9 @@ define([ 'angular', - 'app', 'lodash', 'jquery' ], -function (angular, app, _, $) { +function (angular, _, $) { 'use strict'; var module = angular.module('grafana.controllers'); @@ -63,7 +62,8 @@ function (angular, app, _, $) { $scope.add = function() { $scope.currentAnnotation.datasource = $scope.currentDatasource.name; $scope.annotations.push($scope.currentAnnotation); - $scope.currentAnnotation = angular.copy(annotationDefaults); + $scope.reset(); + $scope.editor.index = 0; }; $scope.removeAnnotation = function(annotation) { diff --git a/src/app/controllers/templateEditorCtrl.js b/src/app/controllers/templateEditorCtrl.js new file mode 100644 index 00000000000..8b9db552625 --- /dev/null +++ b/src/app/controllers/templateEditorCtrl.js @@ -0,0 +1,50 @@ +define([ + 'angular', + 'lodash', +], +function (angular, _) { + 'use strict'; + + var module = angular.module('grafana.controllers'); + + module.controller('TemplateEditorCtrl', function($scope, datasourceSrv) { + + var replacementDefaults = { + type: 'metric query', + datasource: null, + refresh_on_load: false, + name: '', + options: [], + }; + + $scope.init = function() { + $scope.editor = { index: 0 }; + $scope.datasources = datasourceSrv.getMetricSources(); + $scope.currentDatasource = _.findWhere($scope.datasources, { default: true }); + $scope.templateParameters = $scope.filter.templateParameters; + $scope.reset(); + }; + + $scope.add = function() { + $scope.current.datasource = $scope.currentDatasource.name; + $scope.templateParameters.push($scope.current); + $scope.reset(); + }; + + $scope.reset = function() { + $scope.currentIsNew = true; + $scope.current = angular.copy(replacementDefaults); + $scope.editor.index = 0; + }; + + $scope.removeTemplateParam = function(templateParam) { + var index = _.indexOf($scope.templateParameters, templateParam); + $scope.templateParameters.splice(index, 1); + }; + + $scope.setDatasource = function() { + }; + + }); + +}); diff --git a/src/app/panels/graph/styleEditor.html b/src/app/panels/graph/styleEditor.html index de7318d4500..a699ae4e1a4 100644 --- a/src/app/panels/graph/styleEditor.html +++ b/src/app/panels/graph/styleEditor.html @@ -67,8 +67,7 @@
Series specific overrides Regex match example: /server[0-3]/i
-
-
+
    @@ -83,11 +82,11 @@
  • + ng-model="override.alias" + bs-typeahead="getSeriesNames" + ng-blur="render()" + data-min-length=0 data-items=100 + class="input-medium grafana-target-segment-input" >
  • @@ -103,7 +102,6 @@
-
diff --git a/src/app/partials/playlist.html b/src/app/partials/playlist.html index 8057099d4ce..3b3ba7600c4 100644 --- a/src/app/partials/playlist.html +++ b/src/app/partials/playlist.html @@ -38,8 +38,8 @@
- Dashboards available in the playlist are only the once marked as favorites (stored in local browser storage). - To mark a dashboard as favorite, use save icon in the menu and in the dropdown select Mark as favorite + dashboards available in the playlist are only the once marked as favorites (stored in local browser storage). + to mark a dashboard as favorite, use save icon in the menu and in the dropdown select mark as favorite

diff --git a/src/app/partials/templating_editor.html b/src/app/partials/templating_editor.html index e323b9918fb..40864ab5df8 100644 --- a/src/app/partials/templating_editor.html +++ b/src/app/partials/templating_editor.html @@ -1,23 +1,86 @@ -
-
- - Templating -
- -
-
+
+
+ + Templating
+ +
+
+
+
+
-
- -
+
+ +
+
+
+ No replacements defined +
+ + + + + + + +
{{templateParam.name}}{{templateParam.query}} + + Edit + + + + Remove + +
+
+
+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+ +
+ +
- + + + + + + + + + + diff --git a/src/app/services/datasourceSrv.js b/src/app/services/datasourceSrv.js index 9c25b249d1b..a0a123d4509 100644 --- a/src/app/services/datasourceSrv.js +++ b/src/app/services/datasourceSrv.js @@ -20,10 +20,12 @@ function (angular, _, config) { this.init = function() { _.each(config.datasources, function(value, key) { - datasources[key] = this.datasourceFactory(value); + var ds = this.datasourceFactory(value); if (value.default) { - this.default = datasources[key]; + this.default = ds; + ds.default = true; } + datasources[key] = ds; }, this); if (!this.default) { @@ -37,6 +39,7 @@ function (angular, _, config) { metricSources.push({ name: value.name, value: value.default ? null : key, + default: value.default, }); } if (value.supportAnnotations) { diff --git a/src/css/less/grafana.less b/src/css/less/grafana.less index 4d44dc1d33e..396db243b76 100644 --- a/src/css/less/grafana.less +++ b/src/css/less/grafana.less @@ -572,6 +572,15 @@ select.grafana-target-segment-input { } } +// .panel-fullscreen { +// .dashboard-editor-header { +// margin-left: -20px; +// margin-right: -20px; +// background: @grayDark; +// padding-left: 20px; +// } +// } + .dashboard-editor-title { border-bottom: 1px solid @grayDark; padding-right: 20px;