submenuCtrl.js 787 B

12345678910111213141516171819202122232425262728293031323334353637
  1. define([
  2. 'angular',
  3. 'app',
  4. 'lodash'
  5. ],
  6. function (angular, app, _) {
  7. 'use strict';
  8. var module = angular.module('grafana.controllers');
  9. module.controller('SubmenuCtrl', function($scope, $q, $rootScope, templateValuesSrv) {
  10. var _d = {
  11. enable: true
  12. };
  13. _.defaults($scope.pulldown,_d);
  14. $scope.init = function() {
  15. $scope.panel = $scope.pulldown;
  16. $scope.row = $scope.pulldown;
  17. $scope.variables = $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. });