make suggested filter macro depend on type

This commit is contained in:
Sven Klemm
2018-08-18 12:11:10 +02:00
parent 18ce6fc280
commit 9699d7a166
2 changed files with 10 additions and 3 deletions

View File

@ -523,8 +523,11 @@ export class PostgresQueryCtrl extends QueryCtrl {
getWhereOptions() {
var options = [];
options.push(this.uiSegmentSrv.newSegment({ type: 'macro', value: '$__timeFilter' }));
// options.push(this.uiSegmentSrv.newSegment({ type: 'macro', value: '$__unixEpochFilter' }));
if (this.queryModel.hasUnixEpochTimecolumn()) {
options.push(this.uiSegmentSrv.newSegment({ type: 'macro', value: '$__unixEpochFilter' }));
} else {
options.push(this.uiSegmentSrv.newSegment({ type: 'macro', value: '$__timeFilter' }));
}
options.push(this.uiSegmentSrv.newSegment({ type: 'expression', value: 'Expression' }));
return this.$q.when(options);
}