Added labels per series management
This commit is contained in:
@@ -51,6 +51,18 @@
|
||||
data-min-length=0 data-items=100
|
||||
ng-blur="get_data()">
|
||||
</li>
|
||||
<li class="grafana-target-segment" ng-hide="target.rawQuery">
|
||||
label
|
||||
</li>
|
||||
|
||||
<li ng-hide="target.rawQuery">
|
||||
<input type="text"
|
||||
class="input-small grafana-target-segment-input"
|
||||
ng-model="target.label"
|
||||
spellcheck='false'
|
||||
placeholder="label"
|
||||
ng-blur="seriesBlur()">
|
||||
</li>
|
||||
<li class="grafana-target-segment" ng-hide="target.rawQuery">
|
||||
from series
|
||||
</li>
|
||||
|
||||
@@ -91,7 +91,7 @@ function (angular, _, kbn) {
|
||||
target.query = query;
|
||||
}
|
||||
|
||||
return this.doInfluxRequest(query).then(handleInfluxQueryResponse);
|
||||
return this.doInfluxRequest(query, target.label).then(handleInfluxQueryResponse);
|
||||
|
||||
}, this);
|
||||
|
||||
@@ -130,7 +130,7 @@ function (angular, _, kbn) {
|
||||
});
|
||||
}
|
||||
|
||||
InfluxDatasource.prototype.doInfluxRequest = function(query) {
|
||||
InfluxDatasource.prototype.doInfluxRequest = function(query, name) {
|
||||
var _this = this;
|
||||
var deferred = $q.defer();
|
||||
|
||||
@@ -151,6 +151,7 @@ function (angular, _, kbn) {
|
||||
};
|
||||
|
||||
return $http(options).success(function (data) {
|
||||
data.label = name;
|
||||
deferred.resolve(data);
|
||||
});
|
||||
}, 10);
|
||||
@@ -169,9 +170,7 @@ function (angular, _, kbn) {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("series:"+series.name + ": "+series.points.length + " points");
|
||||
|
||||
var target = series.name + "." + column + getKey(results.config.params.q);
|
||||
var target = data.label || series.name + "." + column;
|
||||
var datapoints = [];
|
||||
|
||||
for(var i = 0; i < series.points.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user