mirror of https://github.com/grafana/grafana.git
Review and small refactoring of PR #331
This commit is contained in:
parent
66db99faf8
commit
2f58aa280c
|
@ -3,7 +3,7 @@
|
||||||
- Added rounding for graphites from and to time range filters
|
- Added rounding for graphites from and to time range filters
|
||||||
for very short absolute ranges (Issue #320)
|
for very short absolute ranges (Issue #320)
|
||||||
- Increased resolution for graphite datapoints (maxDataPoints), now equal to panel pixel width. (Closes #5)
|
- Increased resolution for graphite datapoints (maxDataPoints), now equal to panel pixel width. (Closes #5)
|
||||||
|
- Improvement to influxdb query editor, can now add where clause and alias (Issue #331, thanks @mavimo)
|
||||||
|
|
||||||
# 1.5.3 (2014-04-17)
|
# 1.5.3 (2014-04-17)
|
||||||
- Add support for async scripted dashboards (Issue #274)
|
- Add support for async scripted dashboards (Issue #274)
|
||||||
|
|
|
@ -41,33 +41,23 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
<ul class="grafana-segment-list" role="menu">
|
|
||||||
<li ng-show="target.rawQuery">
|
|
||||||
<input type="text"
|
<input type="text"
|
||||||
class="input-large grafana-target-segment-input span10"
|
class="grafana-target-text-input span10"
|
||||||
ng-model="target.query"
|
ng-model="target.query"
|
||||||
placeholder="select ..."
|
placeholder="select ..."
|
||||||
data-min-length=0 data-items=100
|
focus-me="target.rawQuery"
|
||||||
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'
|
spellcheck='false'
|
||||||
placeholder="label"
|
data-min-length=0 data-items=100
|
||||||
ng-blur="seriesBlur()">
|
ng-model-onblur
|
||||||
</li>
|
ng-blur="get_data()"
|
||||||
<li class="grafana-target-segment" ng-hide="target.rawQuery">
|
ng-show="target.rawQuery">
|
||||||
|
|
||||||
|
<ul class="grafana-segment-list" role="menu" ng-hide="target.rawQuery">
|
||||||
|
<li class="grafana-target-segment">
|
||||||
from series
|
from series
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li ng-hide="target.rawQuery">
|
<li>
|
||||||
<input type="text"
|
<input type="text"
|
||||||
class="input-small grafana-target-segment-input"
|
class="input-small grafana-target-segment-input"
|
||||||
ng-model="target.series"
|
ng-model="target.series"
|
||||||
|
@ -78,11 +68,11 @@
|
||||||
ng-blur="seriesBlur()">
|
ng-blur="seriesBlur()">
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="grafana-target-segment" ng-hide="target.rawQuery">
|
<li class="grafana-target-segment">
|
||||||
select
|
select
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li ng-hide="target.rawQuery">
|
<li>
|
||||||
<input type="text"
|
<input type="text"
|
||||||
class="input-small grafana-target-segment-input"
|
class="input-small grafana-target-segment-input"
|
||||||
ng-model="target.column"
|
ng-model="target.column"
|
||||||
|
@ -93,23 +83,23 @@
|
||||||
ng-blur="get_data()">
|
ng-blur="get_data()">
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="grafana-target-segment" ng-hide="target.rawQuery">
|
<li class="grafana-target-segment">
|
||||||
function
|
function
|
||||||
</li>
|
</li>
|
||||||
<li ng-hide="target.rawQuery">
|
<li>
|
||||||
<select class="input-small grafana-target-segment-input"
|
<select class="input-small grafana-target-segment-input"
|
||||||
ng-change="get_data()"
|
ng-change="get_data()"
|
||||||
ng-model="target.function"
|
ng-model="target.function"
|
||||||
ng-options="f for f in functions" ></select>
|
ng-options="f for f in functions" ></select>
|
||||||
</li>
|
</li>
|
||||||
<li ng-hide="target.rawQuery">
|
<li>
|
||||||
<a class="grafana-target-segment"
|
<a class="grafana-target-segment"
|
||||||
ng-click="target.condiction_filter = !target.condiction_filter; get_data();"
|
ng-click="target.condiction_filter = !target.condiction_filter; get_data();"
|
||||||
role="menuitem">
|
role="menuitem">
|
||||||
<i class="icon-filter"></i>
|
<i class="icon-filter"></i>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li ng-hide="target.rawQuery" ng-show="target.condiction_filter">
|
<li ng-show="target.condiction_filter">
|
||||||
<select class="input-small grafana-target-segment-input"
|
<select class="input-small grafana-target-segment-input"
|
||||||
ng-change="get_data()"
|
ng-change="get_data()"
|
||||||
ng-model="target.condition_add"
|
ng-model="target.condition_add"
|
||||||
|
@ -122,7 +112,7 @@
|
||||||
bs-typeahead="listColumns"
|
bs-typeahead="listColumns"
|
||||||
data-min-length=0
|
data-min-length=0
|
||||||
ng-blur="get_data()">
|
ng-blur="get_data()">
|
||||||
<select class="input-small grafana-target-segment-input"
|
<select class="input-mini grafana-target-segment-input"
|
||||||
ng-change="get_data()"
|
ng-change="get_data()"
|
||||||
ng-model="target.condition_op"
|
ng-model="target.condition_op"
|
||||||
ng-options="f for f in operators" ></select>
|
ng-options="f for f in operators" ></select>
|
||||||
|
@ -134,11 +124,11 @@
|
||||||
data-min-length=0
|
data-min-length=0
|
||||||
ng-blur="get_data()">
|
ng-blur="get_data()">
|
||||||
</li>
|
</li>
|
||||||
<li class="grafana-target-segment" ng-hide="target.rawQuery">
|
<li class="grafana-target-segment">
|
||||||
group by time
|
group by time
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li ng-hide="target.rawQuery">
|
<li>
|
||||||
<input type="text"
|
<input type="text"
|
||||||
class="input-mini grafana-target-segment-input"
|
class="input-mini grafana-target-segment-input"
|
||||||
ng-model="target.interval"
|
ng-model="target.interval"
|
||||||
|
@ -147,6 +137,19 @@
|
||||||
spellcheck='false'
|
spellcheck='false'
|
||||||
ng-model-onblur ng-change="get_data()" >
|
ng-model-onblur ng-change="get_data()" >
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="grafana-target-segment">
|
||||||
|
alias as
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<input type="text"
|
||||||
|
class="input-small grafana-target-segment-input"
|
||||||
|
ng-model="target.alias"
|
||||||
|
spellcheck='false'
|
||||||
|
placeholder="alias"
|
||||||
|
ng-blur="seriesBlur()">
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
|
|
@ -82,7 +82,7 @@ function (angular, _, kbn) {
|
||||||
target.query = query;
|
target.query = query;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.doInfluxRequest(query, target.label).then(handleInfluxQueryResponse);
|
return this.doInfluxRequest(query, target.alias).then(handleInfluxQueryResponse);
|
||||||
|
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ function (angular, _, kbn) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
InfluxDatasource.prototype.doInfluxRequest = function(query, label) {
|
InfluxDatasource.prototype.doInfluxRequest = function(query, alias) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
var deferred = $q.defer();
|
var deferred = $q.defer();
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ function (angular, _, kbn) {
|
||||||
};
|
};
|
||||||
|
|
||||||
return $http(options).success(function (data) {
|
return $http(options).success(function (data) {
|
||||||
data.label = label;
|
data.alias = alias;
|
||||||
deferred.resolve(data);
|
deferred.resolve(data);
|
||||||
});
|
});
|
||||||
}, 10);
|
}, 10);
|
||||||
|
@ -161,7 +161,7 @@ function (angular, _, kbn) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var target = data.label || series.name + "." + column;
|
var target = data.alias || series.name + "." + column;
|
||||||
var datapoints = [];
|
var datapoints = [];
|
||||||
|
|
||||||
for(var i = 0; i < series.points.length; i++) {
|
for(var i = 0; i < series.points.length; i++) {
|
||||||
|
|
Loading…
Reference in New Issue