diff --git a/src/datasource-zabbix/css/query-editor.css b/src/datasource-zabbix/css/query-editor.css new file mode 100644 index 0000000..5bf1cdb --- /dev/null +++ b/src/datasource-zabbix/css/query-editor.css @@ -0,0 +1,3 @@ +.zbx-regex { + color: #CCA300; +} diff --git a/src/datasource-zabbix/datasource.js b/src/datasource-zabbix/datasource.js index bb5cb0e..faeda51 100644 --- a/src/datasource-zabbix/datasource.js +++ b/src/datasource-zabbix/datasource.js @@ -134,7 +134,7 @@ export class ZabbixAPIDatasource { return self.queryProcessor.build(groupFilter, hostFilter, appFilter, itemFilter) .then(function(items) { // Add hostname for items from multiple hosts - var addHostName = target.host.isRegex; + var addHostName = utils.isRegex(target.host.filter); var getHistory; // Use trends diff --git a/src/datasource-zabbix/migrations.js b/src/datasource-zabbix/migrations.js index b917f11..0bbd737 100644 --- a/src/datasource-zabbix/migrations.js +++ b/src/datasource-zabbix/migrations.js @@ -19,13 +19,9 @@ export function isGrafana2target(target) { export function migrateFrom2To3version(target) { target.group.filter = target.group.name === "*" ? "/.*/" : target.group.name; - target.group.isRegex = target.group.name === "*"; target.host.filter = target.host.name === "*" ? convertToRegex(target.hostFilter) : target.host.name; - target.host.isRegex = target.host.name === "*"; target.application.filter = target.application.name === "*" ? "" : target.application.name; - target.application.isRegex = target.application.name === "*"; target.item.filter = target.item.name === "All" ? convertToRegex(target.itemFilter) : target.item.name; - target.item.isRegex = target.item.name === "All"; return target; } diff --git a/src/datasource-zabbix/partials/query.editor.html b/src/datasource-zabbix/partials/query.editor.html index 48504eb..5c89d6e 100644 --- a/src/datasource-zabbix/partials/query.editor.html +++ b/src/datasource-zabbix/partials/query.editor.html @@ -94,7 +94,7 @@ data-min-length=0 data-items=100 class="input-medium tight-form-input" - ng-style="ctrl.target.group.style"> + ng-class="{'zbx-regex': ctrl.isRegex(ctrl.target.group.filter)}"> @@ -108,7 +108,7 @@ data-min-length=0 data-items=100 class="input-large tight-form-input" - ng-style="ctrl.target.host.style"> + ng-class="{'zbx-regex': ctrl.isRegex(ctrl.target.host.filter)}">