Commit 920689b8 by Torkel Ödegaard

InfluxDB: series lookup & typeahead is now handled by influxdb list series regex…

InfluxDB: series lookup & typeahead is now handled by influxdb list series regex queries, Closes #888
parent e9c75236
...@@ -83,10 +83,11 @@ function (angular) { ...@@ -83,10 +83,11 @@ function (angular) {
}; };
$scope.listSeries = function(query, callback) { $scope.listSeries = function(query, callback) {
if (!seriesList || query === '') { if (query !== '') {
seriesList = []; seriesList = [];
$scope.datasource.listSeries().then(function(series) { $scope.datasource.listSeries(query).then(function(series) {
seriesList = series; seriesList = series;
console.log(series);
callback(seriesList); callback(seriesList);
}); });
} }
......
...@@ -64,6 +64,8 @@ ...@@ -64,6 +64,8 @@
ng-model="target.series" ng-model="target.series"
spellcheck='false' spellcheck='false'
bs-typeahead="listSeries" bs-typeahead="listSeries"
match-all="true"
min-length="3"
placeholder="series name" placeholder="series name"
data-min-length=0 data-items=100 data-min-length=0 data-items=100
ng-blur="seriesBlur()"> ng-blur="seriesBlur()">
......
...@@ -85,8 +85,13 @@ function (angular, _, kbn, InfluxSeries, InfluxQueryBuilder) { ...@@ -85,8 +85,13 @@ function (angular, _, kbn, InfluxSeries, InfluxQueryBuilder) {
}); });
}; };
InfluxDatasource.prototype.listSeries = function() { InfluxDatasource.prototype.listSeries = function(query) {
return this._seriesQuery('list series').then(function(data) { // wrap in regex
if (query && query.length > 0 && query[0] !== '/') {
query = '/' + query + '/';
}
return this._seriesQuery('list series ' + query).then(function(data) {
if (!data || data.length === 0) { if (!data || data.length === 0) {
return []; return [];
} }
......
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