diff --git a/public/app/plugins/datasource/elasticsearch/partials/query.editor.html b/public/app/plugins/datasource/elasticsearch/partials/query.editor.html
index 99c6aed9aa7..bbf5964b220 100644
--- a/public/app/plugins/datasource/elasticsearch/partials/query.editor.html
+++ b/public/app/plugins/datasource/elasticsearch/partials/query.editor.html
@@ -14,15 +14,15 @@
-
+
@@ -33,7 +33,7 @@
{{target.refId}}
-
+
@@ -44,13 +44,13 @@
Query
-
+
Alias
-
+
diff --git a/public/app/plugins/datasource/elasticsearch/partials/query.options.html b/public/app/plugins/datasource/elasticsearch/partials/query.options.html
index eb6c6ff55fb..628a0a0bf3d 100644
--- a/public/app/plugins/datasource/elasticsearch/partials/query.options.html
+++ b/public/app/plugins/datasource/elasticsearch/partials/query.options.html
@@ -8,7 +8,7 @@
Group by time interval
-
@@ -23,7 +23,7 @@
-
+
alias patterns
@@ -34,7 +34,7 @@
-
+
Alias patterns
{{term fieldname}} = replaced with value of term group by
diff --git a/public/app/plugins/datasource/elasticsearch/query_ctrl.js b/public/app/plugins/datasource/elasticsearch/query_ctrl.js
index b222733e29d..90214dff17c 100644
--- a/public/app/plugins/datasource/elasticsearch/query_ctrl.js
+++ b/public/app/plugins/datasource/elasticsearch/query_ctrl.js
@@ -6,8 +6,9 @@ function (angular) {
var module = angular.module('grafana.controllers');
- module.controller('ElasticQueryCtrl', function($scope, $timeout, uiSegmentSrv) {
+ module.controller('ElasticQueryCtrl', function($scope, $rootScope, $timeout, uiSegmentSrv) {
$scope.esVersion = $scope.datasource.esVersion;
+ $scope.panelCtrl = $scope.ctrl;
$scope.init = function() {
var target = $scope.target;
@@ -27,10 +28,10 @@ function (angular) {
var newJson = angular.toJson($scope.datasource.queryBuilder.build($scope.target), true);
if (newJson !== $scope.oldQueryRaw) {
$scope.rawQueryOld = newJson;
- $scope.get_data();
+ $scope.panelCtrl.refresh();
}
- $scope.appEvent('elastic-query-updated');
+ $rootScope.appEvent('elastic-query-updated');
};
$scope.handleQueryError = function(err) {
diff --git a/public/app/plugins/datasource/opentsdb/partials/query.editor.html b/public/app/plugins/datasource/opentsdb/partials/query.editor.html
index fffa7194228..e27f068032f 100644
--- a/public/app/plugins/datasource/opentsdb/partials/query.editor.html
+++ b/public/app/plugins/datasource/opentsdb/partials/query.editor.html
@@ -9,15 +9,14 @@
-
+
@@ -29,7 +28,7 @@
diff --git a/public/app/plugins/datasource/opentsdb/queryCtrl.js b/public/app/plugins/datasource/opentsdb/queryCtrl.js
index 14d28c310c2..04259382390 100644
--- a/public/app/plugins/datasource/opentsdb/queryCtrl.js
+++ b/public/app/plugins/datasource/opentsdb/queryCtrl.js
@@ -9,6 +9,7 @@ function (angular, _, kbn) {
var module = angular.module('grafana.controllers');
module.controller('OpenTSDBQueryCtrl', function($scope) {
+ $scope.panelCtrl = $scope.ctrl;
$scope.init = function() {
$scope.target.errors = validateTarget($scope.target);
diff --git a/public/app/plugins/datasource/prometheus/partials/query.editor.html b/public/app/plugins/datasource/prometheus/partials/query.editor.html
index 75c432862ad..4ad94d022eb 100644
--- a/public/app/plugins/datasource/prometheus/partials/query.editor.html
+++ b/public/app/plugins/datasource/prometheus/partials/query.editor.html
@@ -9,15 +9,14 @@
-
+
@@ -29,7 +28,7 @@
diff --git a/public/app/plugins/datasource/prometheus/query_ctrl.js b/public/app/plugins/datasource/prometheus/query_ctrl.js
index 83d92ae74a2..b78152c62d0 100644
--- a/public/app/plugins/datasource/prometheus/query_ctrl.js
+++ b/public/app/plugins/datasource/prometheus/query_ctrl.js
@@ -8,6 +8,8 @@ function (angular, _) {
var module = angular.module('grafana.controllers');
module.controller('PrometheusQueryCtrl', function($scope, templateSrv) {
+ $scope.panelCtrl = $scope.ctrl;
+ $scope.panel = $scope.panelCtrl.panel;
$scope.init = function() {
var target = $scope.target;
@@ -29,7 +31,7 @@ function (angular, _) {
$scope.refreshMetricData = function() {
if (!_.isEqual($scope.oldTarget, $scope.target)) {
$scope.oldTarget = angular.copy($scope.target);
- $scope.get_data();
+ $scope.paneCtrl.refresh();
}
};