diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7c0392e55a6..960e8a2db8f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,27 @@
+# 1.5.2 (2013-03-24)
+### New Features and improvements
+- Support for second optional params for functions like aliasByNode (Issue #167). Read the wiki on the [Function Editor](https://github.com/torkelo/grafana/wiki/Graphite-Function-Editor) for more info.
+- More functions added to InfluxDB query editor (Issue #218)
+- Filters can now be used inside other filters (templated segments) (Issue #128)
+- More graphite functions added
+
+### Fixes
+- Float arguments now work for functions like scale (Issue #223)
+- Fix for graphite function editor, the graph & target was not updated after adding a function and leaving default params as is #191
+
+The zip files now contains a sub folder with project name and version prefix. (Issue #209)
+
+# 1.5.1 (2013-03-10)
+### Fixes
+- maxDataPoints must be an integer #184 (thanks @frejsoya for fixing this)
+
+For people who are find Grafana slow for large time spans or high resolution metrics. This is most likely due to graphite returning a large number of datapoints. The maxDataPoints parameter solves this issue. For maxDataPoints to work you need to run the latest graphite-web (some builds of 0.9.12 does not include this feature).
+
+Read this for more info:
+[Performance for large time spans](https://github.com/torkelo/grafana/wiki/Performance-for-large-time-spans)
+
# 1.5.0 (2013-03-09)
-###New Features and improvements
+### New Features and improvements
- New function editor [video demo](http://youtu.be/I90WHRwE1ZM) (Issue #178)
- Links to function documentation from function editor (Issue #3)
- Reorder functions (Issue #130)
@@ -18,7 +40,7 @@
- Fix to annotations with graphite source & null values (Issue #138)
# 1.4.0 (2013-02-21)
-###New Features
+### New Features
- #44 Annotations! Required a lot of work to get right. Read wiki article for more info. Supported annotations data sources are graphite metrics and graphite events. Support for more will be added in the future!
- #35 Support for multiple graphite servers! (Read wiki article for more)
- #116 Back to dashboard link in top menu to easily exist full screen / edit mode.
diff --git a/package.json b/package.json
index 4bcf2142694..5892cf1b662 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
"company": "Coding Instinct AB"
},
"name": "grafana",
- "version": "1.5.1",
+ "version": "1.5.2",
"repository": {
"type": "git",
"url": "http://github.com/torkelo/grafana.git"
diff --git a/src/app/controllers/influxTargetCtrl.js b/src/app/controllers/influxTargetCtrl.js
index 66439c5e757..5d96a280470 100644
--- a/src/app/controllers/influxTargetCtrl.js
+++ b/src/app/controllers/influxTargetCtrl.js
@@ -15,6 +15,7 @@ function (angular) {
$scope.target.function = 'mean';
}
+ $scope.functions = ['count', 'mean', 'sum', 'min', 'max', 'mode', 'distinct', 'median', 'derivative', 'stddev', 'first', 'last'];
$scope.oldSeries = $scope.target.series;
$scope.$on('typeahead-updated', function(){
$timeout($scope.get_data);
diff --git a/src/app/directives/grafanaGraph.js b/src/app/directives/grafanaGraph.js
index 3eecd64727d..1e5d20c8f7c 100644
--- a/src/app/directives/grafanaGraph.js
+++ b/src/app/directives/grafanaGraph.js
@@ -318,7 +318,7 @@ function (angular, $, kbn, moment, _) {
}
});
- function render_panel_as_graphite_png(url) {
+ function render_panel_as_graphite_png(url) {
url += '&width=' + elem.width();
url += '&height=' + elem.css('height').replace('px', '');
url += '&bgcolor=1f1f1f'; // @grayDarker & @kibanaPanelBackground
@@ -327,8 +327,8 @@ function (angular, $, kbn, moment, _) {
url += scope.panel.fill !== 0 ? ('&areaAlpha=' + (scope.panel.fill/10).toFixed(1)) : '';
url += scope.panel.linewidth !== 0 ? '&lineWidth=' + scope.panel.linewidth : '';
url += scope.panel.legend ? '' : '&hideLegend=true';
- url += scope.panel.grid.min ? '&yMin=' + scope.panel.grid.min : '';
- url += scope.panel.grid.max ? '&yMax=' + scope.panel.grid.max : '';
+ url += scope.panel.grid.min !== null ? '&yMin=' + scope.panel.grid.min : '';
+ url += scope.panel.grid.max !== null ? '&yMax=' + scope.panel.grid.max : '';
url += scope.panel['x-axis'] ? '' : '&hideAxes=true';
url += scope.panel['y-axis'] ? '' : '&hideYAxis=true';
diff --git a/src/app/directives/graphiteFuncEditor.js b/src/app/directives/graphiteFuncEditor.js
index 10516f1ca7c..7767d097c04 100644
--- a/src/app/directives/graphiteFuncEditor.js
+++ b/src/app/directives/graphiteFuncEditor.js
@@ -29,6 +29,8 @@ function (angular, _, $) {
var $funcControls = $(funcControlsTemplate);
var func = $scope.func;
var funcDef = func.def;
+ var scheduledRelink = false;
+ var paramCountAtLink = 0;
function clickFuncParam(paramIndex) {
/*jshint validthis:true */
@@ -51,17 +53,33 @@ function (angular, _, $) {
}
}
+ function scheduledRelinkIfNeeded() {
+ if (paramCountAtLink === func.params.length) {
+ return;
+ }
+
+ if (!scheduledRelink) {
+ scheduledRelink = true;
+ setTimeout(function() {
+ relink();
+ scheduledRelink = false;
+ }, 200);
+ }
+ }
+
function inputBlur(paramIndex) {
/*jshint validthis:true */
var $input = $(this);
var $link = $input.prev();
- if ($input.val() !== '') {
+ if ($input.val() !== '' || func.def.params[paramIndex].optional) {
$link.text($input.val());
-
+
func.updateParam($input.val(), paramIndex);
- $scope.$apply($scope.targetChanged);
+ scheduledRelinkIfNeeded();
+
+ $scope.$apply($scope.targetChanged);
}
$input.hide();
@@ -129,9 +147,19 @@ function (angular, _, $) {
$funcLink.appendTo(elem);
_.each(funcDef.params, function(param, index) {
+ if (param.optional && !func.params[index]) {
+ return;
+ }
+
+ if (index > 0) {
+ $(', ').appendTo(elem);
+ }
+
var $paramLink = $('' + func.params[index] + '');
var $input = $(paramTemplate);
+ paramCountAtLink++;
+
$paramLink.appendTo(elem);
$input.appendTo(elem);
@@ -140,10 +168,6 @@ function (angular, _, $) {
$input.keypress(_.partial(inputKeyPress, index));
$paramLink.click(_.partial(clickFuncParam, index));
- if (index !== funcDef.params.length - 1) {
- $(', ').appendTo(elem);
- }
-
if (funcDef.params[index].options) {
addTypeahead($input, index);
}
@@ -200,10 +224,16 @@ function (angular, _, $) {
});
}
- addElementsAndCompile();
- ifJustAddedFocusFistParam();
- registerFuncControlsToggle();
- registerFuncControlsActions();
+ function relink() {
+ elem.children().remove();
+
+ addElementsAndCompile();
+ ifJustAddedFocusFistParam();
+ registerFuncControlsToggle();
+ registerFuncControlsActions();
+ }
+
+ relink();
}
};
diff --git a/src/app/partials/influxdb/editor.html b/src/app/partials/influxdb/editor.html
index 4a6927e5984..d34d6ab5f9b 100644
--- a/src/app/partials/influxdb/editor.html
+++ b/src/app/partials/influxdb/editor.html
@@ -74,7 +74,11 @@
function