Skip to content

Commit

Permalink
remove time filter restriction
Browse files Browse the repository at this point in the history
the time filter is checked by thruks rest api.
  • Loading branch information
sni committed Dec 4, 2023
1 parent 2d81377 commit fc8f6fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
### Changelog

next:
- remove time filter restriction

2.0.3 2023-07-14
- make drag/drop more obvious
- set correct field type for numeric columns
Expand Down
11 changes: 0 additions & 11 deletions src/datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,6 @@ export class DataSource extends DataSourceApi<ThrukQuery, ThrukDataSourceOptions
options.targets.map((target) => {
let col = this._buildColumns(target.columns);

if (this.isLogs(target.table) && !target.condition.match(/\$time/)) {
throw new Error('logs query must contain time filter, ex.: time = $time');
}

let path = target.table;
path = path.replace(/^\//, '');
path = this.replaceVariables(path, options.range, options.scopedVars);
Expand Down Expand Up @@ -501,11 +497,4 @@ export class DataSource extends DataSourceApi<ThrukQuery, ThrukDataSourceOptions
response.push(frame);
});
}

isLogs(table: string): boolean {
if (table.match(/(logs|notifications|alerts)/)) {
return true;
}
return false;
}
}

0 comments on commit fc8f6fc

Please sign in to comment.