Commit 87a8b1b3 by Torkel Ödegaard

small fix to config.sample.js

parent c5d25902
......@@ -90,7 +90,7 @@
"notice": false
}
],
"editable": true,
"editable": false,
"failover": false,
"panel_hints": true,
"style": "dark",
......
......@@ -114,10 +114,10 @@ function (angular, _, $) {
$paramLink.appendTo(elem);
$input.appendTo(elem);
$input.blur(_.partial(inputBlur));
$input.blur(inputBlur);
$input.keyup(inputKeyDown);
$input.keypress(_.partial(inputKeyPress));
$paramLink.click(_.partial(clickFuncParam));
$input.keypress(inputKeyPress);
$paramLink.click(clickFuncParam);
addTypeahead($input);
......
......@@ -89,7 +89,9 @@ function (angular, _, kbn) {
target.query = query;
}
return this.doInfluxRequest(query, alias).then(handleInfluxQueryResponse);
var handleResponse = _.partial(handleInfluxQueryResponse, alias);
return this.doInfluxRequest(query, alias).then(handleResponse);
}, this);
......@@ -126,7 +128,7 @@ function (angular, _, kbn) {
return $q.reject(err);
}
return this.doInfluxRequest(query, 'filters')
return this.doInfluxRequest(query)
.then(function (results) {
return _.map(results[0].points, function (metric) {
return {
......@@ -148,7 +150,7 @@ function (angular, _, kbn) {
});
}
InfluxDatasource.prototype.doInfluxRequest = function(query, alias) {
InfluxDatasource.prototype.doInfluxRequest = function(query) {
var _this = this;
var deferred = $q.defer();
......@@ -170,7 +172,6 @@ function (angular, _, kbn) {
};
return $http(options).success(function (data) {
data.alias = alias;
deferred.resolve(data);
});
}, 10);
......@@ -178,7 +179,7 @@ function (angular, _, kbn) {
return deferred.promise;
};
function handleInfluxQueryResponse(data) {
function handleInfluxQueryResponse(alias, data) {
var output = [];
_.each(data, function(series) {
......@@ -189,7 +190,7 @@ function (angular, _, kbn) {
return;
}
var target = data.alias || series.name + "." + column;
var target = alias || series.name + "." + column;
var datapoints = [];
var value;
......
......@@ -18,8 +18,8 @@ function (Settings) {
},
influxdb: {
type: 'influxdb',
url: "http://my_influxdb_server:8080/db/database_name",
user: 'admin',
url: "http://my_influxdb_server:8086/db/database_name",
username: '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