Skip to content

Commit

Permalink
Fix variable query editor, #1590
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderzobnin committed Mar 22, 2023
1 parent 3f7f0f4 commit 2470803
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/datasource/components/VariableQueryEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ export class ZabbixVariableQueryEditor extends PureComponent<VariableQueryProps,
this.props.onChange(queryModel, `Zabbix - ${queryType}`);
};

async render() {
render() {
const { selectedQueryType, legacyQuery, group, host, application, itemTag, item } = this.state;
const { datasource } = this.props;
const supportsItemTags = (await datasource?.zabbix?.isZabbix54OrHigher()) || false;
const supportsItemTags = datasource?.zabbix?.isZabbix54OrHigherSync() || false;

return (
<>
Expand Down
4 changes: 4 additions & 0 deletions src/datasource/zabbix/zabbix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ export class Zabbix implements ZabbixConnector {
return version ? semver.gte(version, '5.4.0') : false;
}

isZabbix54OrHigherSync() {
return this.version ? semver.gte(this.version, '5.4.0') : false;
}

getItemsFromTarget(target, options) {
const parts = ['group', 'host', 'application', 'itemTag', 'item'];
const filters = _.map(parts, (p) => target[p].filter);
Expand Down

0 comments on commit 2470803

Please sign in to comment.