Repository: ambari Updated Branches: refs/heads/branch-2.2 486e96991 -> c20d7fe08
AMBARI-15272. Grafana - clear query editor on component update. (Prajwal Rao via yusaku) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c20d7fe0 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c20d7fe0 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c20d7fe0 Branch: refs/heads/branch-2.2 Commit: c20d7fe080e95d71b3b346a5d7b466a6932d4322 Parents: 486e969 Author: Yusaku Sako <yus...@hortonworks.com> Authored: Wed Mar 2 14:13:07 2016 -0800 Committer: Yusaku Sako <yus...@hortonworks.com> Committed: Wed Mar 2 14:13:42 2016 -0800 ---------------------------------------------------------------------- .../ambari-metrics-grafana/ambari-metrics/queryCtrl.js | 6 ++++++ 1 file changed, 6 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/c20d7fe0/ambari-metrics/ambari-metrics-grafana/ambari-metrics/queryCtrl.js ---------------------------------------------------------------------- diff --git a/ambari-metrics/ambari-metrics-grafana/ambari-metrics/queryCtrl.js b/ambari-metrics/ambari-metrics-grafana/ambari-metrics/queryCtrl.js index e59459f..6c231dd 100644 --- a/ambari-metrics/ambari-metrics-grafana/ambari-metrics/queryCtrl.js +++ b/ambari-metrics/ambari-metrics-grafana/ambari-metrics/queryCtrl.js @@ -45,6 +45,12 @@ define([ $scope.target.aggregator = 'avg'; } }); + $scope.$watch('target.app', function (newValue) { + if (newValue === '') { + $scope.target.metric = ''; + $scope.target.hosts = ''; + } + }); if (!$scope.target.downsampleAggregator) { $scope.target.downsampleAggregator = 'avg';