Commit 87a8b1b3 by Torkel Ödegaard

small fix to config.sample.js

parent c5d25902
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
"notice": false "notice": false
} }
], ],
"editable": true, "editable": false,
"failover": false, "failover": false,
"panel_hints": true, "panel_hints": true,
"style": "dark", "style": "dark",
......
...@@ -114,10 +114,10 @@ function (angular, _, $) { ...@@ -114,10 +114,10 @@ function (angular, _, $) {
$paramLink.appendTo(elem); $paramLink.appendTo(elem);
$input.appendTo(elem); $input.appendTo(elem);
$input.blur(_.partial(inputBlur)); $input.blur(inputBlur);
$input.keyup(inputKeyDown); $input.keyup(inputKeyDown);
$input.keypress(_.partial(inputKeyPress)); $input.keypress(inputKeyPress);
$paramLink.click(_.partial(clickFuncParam)); $paramLink.click(clickFuncParam);
addTypeahead($input); addTypeahead($input);
......
...@@ -89,7 +89,9 @@ function (angular, _, kbn) { ...@@ -89,7 +89,9 @@ function (angular, _, kbn) {
target.query = query; target.query = query;
} }
return this.doInfluxRequest(query, alias).then(handleInfluxQueryResponse); var handleResponse = _.partial(handleInfluxQueryResponse, alias);
return this.doInfluxRequest(query, alias).then(handleResponse);
}, this); }, this);
...@@ -126,7 +128,7 @@ function (angular, _, kbn) { ...@@ -126,7 +128,7 @@ function (angular, _, kbn) {
return $q.reject(err); return $q.reject(err);
} }
return this.doInfluxRequest(query, 'filters') return this.doInfluxRequest(query)
.then(function (results) { .then(function (results) {
return _.map(results[0].points, function (metric) { return _.map(results[0].points, function (metric) {
return { return {
...@@ -148,7 +150,7 @@ function (angular, _, kbn) { ...@@ -148,7 +150,7 @@ function (angular, _, kbn) {
}); });
} }
InfluxDatasource.prototype.doInfluxRequest = function(query, alias) { InfluxDatasource.prototype.doInfluxRequest = function(query) {
var _this = this; var _this = this;
var deferred = $q.defer(); var deferred = $q.defer();
...@@ -170,7 +172,6 @@ function (angular, _, kbn) { ...@@ -170,7 +172,6 @@ function (angular, _, kbn) {
}; };
return $http(options).success(function (data) { return $http(options).success(function (data) {
data.alias = alias;
deferred.resolve(data); deferred.resolve(data);
}); });
}, 10); }, 10);
...@@ -178,7 +179,7 @@ function (angular, _, kbn) { ...@@ -178,7 +179,7 @@ function (angular, _, kbn) {
return deferred.promise; return deferred.promise;
}; };
function handleInfluxQueryResponse(data) { function handleInfluxQueryResponse(alias, data) {
var output = []; var output = [];
_.each(data, function(series) { _.each(data, function(series) {
...@@ -189,7 +190,7 @@ function (angular, _, kbn) { ...@@ -189,7 +190,7 @@ function (angular, _, kbn) {
return; return;
} }
var target = data.alias || series.name + "." + column; var target = alias || series.name + "." + column;
var datapoints = []; var datapoints = [];
var value; var value;
......
...@@ -18,8 +18,8 @@ function (Settings) { ...@@ -18,8 +18,8 @@ function (Settings) {
}, },
influxdb: { influxdb: {
type: 'influxdb', type: 'influxdb',
url: "http://my_influxdb_server:8080/db/database_name", url: "http://my_influxdb_server:8086/db/database_name",
user: 'admin', username: 'admin',
password: 'admin' password: 'admin'
}, },
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment