query_ctrl.js 644 B

12345678910111213141516171819202122232425262728
  1. define([
  2. 'angular',
  3. 'lodash',
  4. ],
  5. function (angular, _) {
  6. 'use strict';
  7. var module = angular.module('grafana.controllers');
  8. module.controller('CloudWatchQueryCtrl', function($scope) {
  9. $scope.init = function() {
  10. $scope.target.divideSumByPeriod = $scope.target.divideSumByPeriod || false;
  11. $scope.aliasSyntax = '{{metric}} {{stat}} {{namespace}} {{region}} {{<dimension name>}}';
  12. };
  13. $scope.refreshMetricData = function() {
  14. if (!_.isEqual($scope.oldTarget, $scope.target)) {
  15. $scope.oldTarget = angular.copy($scope.target);
  16. $scope.get_data();
  17. }
  18. };
  19. $scope.init();
  20. });
  21. });