2014-02-09 19:31:06 +01:00
|
|
|
define([
|
|
|
|
|
'angular',
|
2014-08-07 14:35:19 +02:00
|
|
|
'lodash'
|
2014-02-09 19:31:06 +01:00
|
|
|
],
|
2014-09-24 17:15:58 +02:00
|
|
|
function (angular, _) {
|
2014-02-09 19:31:06 +01:00
|
|
|
'use strict';
|
|
|
|
|
|
2014-07-28 18:11:52 +02:00
|
|
|
var module = angular.module('grafana.controllers');
|
2014-02-09 19:31:06 +01:00
|
|
|
|
2014-08-27 17:58:49 +02:00
|
|
|
module.controller('SubmenuCtrl', function($scope, $q, $rootScope, templateValuesSrv) {
|
2014-06-07 06:38:33 +02:00
|
|
|
var _d = {
|
|
|
|
|
enable: true
|
|
|
|
|
};
|
2014-02-09 19:31:06 +01:00
|
|
|
|
2014-06-07 06:38:33 +02:00
|
|
|
_.defaults($scope.pulldown,_d);
|
2014-02-09 19:31:06 +01:00
|
|
|
|
2014-06-07 06:38:33 +02:00
|
|
|
$scope.init = function() {
|
|
|
|
|
$scope.panel = $scope.pulldown;
|
|
|
|
|
$scope.row = $scope.pulldown;
|
2014-08-28 12:44:01 +02:00
|
|
|
$scope.variables = $scope.dashboard.templating.list;
|
2015-02-20 12:20:10 +01:00
|
|
|
$scope.annotations = $scope.dashboard.templating.list;
|
2014-08-25 15:36:44 +02:00
|
|
|
};
|
|
|
|
|
|
2014-08-26 10:16:21 +02:00
|
|
|
$scope.disableAnnotation = function (annotation) {
|
|
|
|
|
annotation.enable = !annotation.enable;
|
|
|
|
|
$rootScope.$broadcast('refresh');
|
|
|
|
|
};
|
|
|
|
|
|
2015-03-19 23:09:50 -04:00
|
|
|
$scope.variableUpdated = function(variable) {
|
|
|
|
|
templateValuesSrv.variableUpdated(variable).then(function() {
|
|
|
|
|
$rootScope.$broadcast('refresh');
|
|
|
|
|
});
|
2014-08-27 17:58:49 +02:00
|
|
|
};
|
|
|
|
|
|
2014-06-07 06:38:33 +02:00
|
|
|
$scope.init();
|
2014-02-09 19:31:06 +01:00
|
|
|
|
2014-06-07 06:38:33 +02:00
|
|
|
});
|
2014-02-09 19:31:06 +01:00
|
|
|
|
2014-08-25 13:31:31 +02:00
|
|
|
});
|