From 53b1eae85f51dfa85307f59bc8375695f36ad2c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 28 Apr 2016 12:06:36 +0200 Subject: [PATCH 1/2] feat(query editor): updated query editor to use new forms stle and outer query row component --- .../add-metric-function.directive.js | 4 +- .../partials/query.editor.html | 231 +++++++----------- src/datasource-zabbix/query.controller.js | 8 +- 3 files changed, 91 insertions(+), 152 deletions(-) diff --git a/src/datasource-zabbix/add-metric-function.directive.js b/src/datasource-zabbix/add-metric-function.directive.js index a3676ee..88448e5 100644 --- a/src/datasource-zabbix/add-metric-function.directive.js +++ b/src/datasource-zabbix/add-metric-function.directive.js @@ -8,10 +8,10 @@ angular .module('grafana.directives') .directive('addMetricFunction', function($compile) { var inputTemplate = ''; - var buttonTemplate = '' + ''; diff --git a/src/datasource-zabbix/partials/query.editor.html b/src/datasource-zabbix/partials/query.editor.html index 50342cd..eb858c5 100644 --- a/src/datasource-zabbix/partials/query.editor.html +++ b/src/datasource-zabbix/partials/query.editor.html @@ -1,210 +1,149 @@ -
- - - +
+
+
+
+ - + + + + +
+
+
+ - -
- + }"> + -
-
+ +
-
  • Application
  • -
  • +
    + -
  • +
    -
  • Item
  • -
  • +
    + -
  • -
  • Options
  • -
  • - - -
  • - - - -
    - -
    - -
    -
    - -
    -
    +
    + +
    +
    + +
    +
    +
    + +
    -
  • - Text filter -
  • -
  • +
    + -
  • -
  • - Use capture groups  - - -
  • - + ng-blur="ctrl.onTargetBlur()"> +
    -
    - + + + + diff --git a/src/datasource-zabbix/query.controller.js b/src/datasource-zabbix/query.controller.js index 3556209..bd35da3 100644 --- a/src/datasource-zabbix/query.controller.js +++ b/src/datasource-zabbix/query.controller.js @@ -26,9 +26,9 @@ export class ZabbixQueryController extends QueryCtrl { this.templateSrv = templateSrv; this.editorModes = { - 0: 'num', - 1: 'itservice', - 2: 'text' + 0: {value: 'num', text: 'Numeric metrics', mode: 0}, + 1: {value: 'itservice', text: 'IT Services', mode: 1}, + 2: {value: 'text', text: 'Text metrics', mode: 2} }; // Map functions for bs-typeahead @@ -98,7 +98,7 @@ export class ZabbixQueryController extends QueryCtrl { initFilters() { var self = this; - var itemtype = self.editorModes[self.target.mode]; + var itemtype = self.editorModes[self.target.mode].value; return this.$q.when(this.suggestGroups()) .then(() => {return self.suggestHosts();}) .then(() => {return self.suggestApps();}) From ed3abe825014189fccabcd19508453e2210b4309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 28 Apr 2016 12:13:21 +0200 Subject: [PATCH 2/2] fix(): removed setting refId, handled by parent component --- src/datasource-zabbix/query.controller.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/datasource-zabbix/query.controller.js b/src/datasource-zabbix/query.controller.js index bd35da3..5b609dc 100644 --- a/src/datasource-zabbix/query.controller.js +++ b/src/datasource-zabbix/query.controller.js @@ -60,7 +60,6 @@ export class ZabbixQueryController extends QueryCtrl { application: { filter: "" }, item: { filter: "" }, functions: [], - refId: "A" }; _.defaults(target, targetDefaults);