submenuCtrl.js 834 B

12345678910111213141516171819202122232425262728293031323334353637
  1. define([
  2. 'angular',
  3. 'lodash'
  4. ],
  5. function (angular, _) {
  6. 'use strict';
  7. var module = angular.module('grafana.controllers');
  8. module.controller('SubmenuCtrl', function($scope, $q, $rootScope, templateValuesSrv) {
  9. var _d = {
  10. enable: true
  11. };
  12. _.defaults($scope.pulldown,_d);
  13. $scope.init = function() {
  14. $scope.panel = $scope.pulldown;
  15. $scope.row = $scope.pulldown;
  16. $scope.variables = $scope.dashboard.templating.list;
  17. $scope.annotations = $scope.dashboard.templating.list;
  18. };
  19. $scope.disableAnnotation = function (annotation) {
  20. annotation.enable = !annotation.enable;
  21. $rootScope.$broadcast('refresh');
  22. };
  23. $scope.setVariableValue = function(param, option) {
  24. templateValuesSrv.setVariableValue(param, option);
  25. };
  26. $scope.init();
  27. });
  28. });