<commit_before>var mqWebApp = angular.module('mqWebApp');

mqWebApp.run(function ($rootScope) {
	$rootScope.qmgr = '';
	$rootScope.queues = null; // All queues
	
	// Call this when a queue has been reloaded on the detail page. 
	// So we see new values also on the overview page.
	$rootScope.updateQueue = function(queue)
	{
		if ( $rootScope.queues != null )
		{
			for(q in $rootScope.queues)
			{
				if ( $rootScope.queues[q].data.QName.value == queue.data.QName.value )
				{
					$rootScope.queues[q].data = queue.data;
					break;
				}
			}
		}
	}
});

mqWebApp.controller('QueuesController', ['$scope', '$rootScope', 'mqWebQueue', function($scope, $rootScope, mqWebQueue) {
	$rootScope.qmgr = mqWebQueue.getQueueManager();

	$scope.loading = false;
	$scope.mqweb = null;
	$scope.error = null;
	$scope.queue = null; // Queue used for repeat
	
	$scope.formData = {
		queueName : "*",
		queueType : "All",
		queueExcludeSystem : true,
		queueExcludeTemp : true
	};

	$scope.load = function() {
		$scope.loading = true;
		mqWebQueue.inquire($scope.formData)
			.success(function(data, status) {
				$scope.loading = false;
				$scope.mqweb = data.mqweb;

				$rootScope.queues = [];
				data.queues.forEach(function(q) {
					$rootScope.queues.push({
						loading: false,
						toggle: false,
						data: q
					});
				});
				
				$scope.error = data.error;
			}).error(function(data, status) {
				$scope.loading = false;
		});
	};

	$scope.toggle = function(q)
	{
		q.toggle = ! q.toggle;
		//$scope.queue = q;
	}
	
	$scope.reload = function(queue)
	{
		mqWebQueue.inquire(queue.data.QName.value)
			.success(function(data, status) {
				queue.loading = false;
				if ( data.queues.length > 0 )
				{
					queue.data = data.queues[0];
				}
			}).error(function(data, status) {
				queue.loading = false;
			});
	}
}]);

mqWebApp.controller('QueueController', ['$scope', '$rootScope', '$routeParams', 'mqWebQueue', function($scope, $rootScope, $routeParams, mqWebQueue) {
	$rootScope.qmgr = mqWebQueue.getQueueManager();

	$scope.loading = true;
	$scope.mqweb = null;
	$scope.error = null;
	$scope.queue = null;
	
	mqWebQueue.inquire($routeParams.queueName)
		.success(function(data, status) {
			$scope.loading = false;
			$scope.mqweb = data.mqweb;
			if ( data.queues.length > 0 )
			{
				if ( $scope.queue == null )
				{
					$scope.queue = { 'data' : data.queues[0] };
				}
				else
				{
					$scope.queue.data = data.queues[0];
				}
			}
			$scope.error = data.error;
		}).error(function(data, status) {
			$scope.loading = false;
	});
		
	$scope.reload = function(queue)
	{
		$scope.loading = true;
		mqWebQueue.inquire(queue.data.QName.value)
			.success(function(data, status) {
				$scope.loading = false;
				if ( data.queues.length > 0 )
				{
					queue.data = data.queues[0];
				}
				$rootScope.updateQueue(queue);
			}).error(function(data, status) {
				$scope.loading = false;
			});
	}
}]);<commit_msg>remove qmgr from $rootScope / remove unneeded code in QueueController<commit_after>var mqWebApp = angular.module('mqWebApp');

mqWebApp.run(function ($rootScope) {
	$rootScope.queues = null; // All queues
	
	// Call this when a queue has been reloaded on the detail page. 
	// So we see new values also on the overview page.
	$rootScope.updateQueue = function(queue)
	{
		if ( $rootScope.queues != null )
		{
			for(q in $rootScope.queues)
			{
				if ( $rootScope.queues[q].data.QName.value == queue.data.QName.value )
				{
					$rootScope.queues[q].data = queue.data;
					break;
				}
			}
		}
	}
});

mqWebApp.controller('QueuesController', ['$scope', '$rootScope', 'mqWebQueue', function($scope, $rootScope, mqWebQueue) {
	$scope.qmgr = mqWebQueue.getQueueManager();

	$scope.loading = false;
	$scope.mqweb = null;
	$scope.error = null;
	$scope.queue = null; // Queue used for repeat
	
	$scope.formData = {
		queueName : "*",
		queueType : "All",
		queueExcludeSystem : true,
		queueExcludeTemp : true
	};

	$scope.load = function() {
		$scope.loading = true;
		mqWebQueue.inquire($scope.formData)
			.success(function(data, status) {
				$scope.loading = false;
				$scope.mqweb = data.mqweb;

				$rootScope.queues = [];
				data.queues.forEach(function(q) {
					$rootScope.queues.push({
						loading: false,
						toggle: false,
						data: q
					});
				});
				
				$scope.error = data.error;
			}).error(function(data, status) {
				$scope.loading = false;
		});
	};

	$scope.toggle = function(q)
	{
		q.toggle = ! q.toggle;
		//$scope.queue = q;
	}
	
	$scope.reload = function(queue)
	{
		mqWebQueue.inquire(queue.data.QName.value)
			.success(function(data, status) {
				queue.loading = false;
				if ( data.queues.length > 0 )
				{
					queue.data = data.queues[0];
				}
			}).error(function(data, status) {
				queue.loading = false;
			});
	}
}]);

mqWebApp.controller('QueueController', ['$scope', '$rootScope', '$routeParams', 'mqWebQueue', function($scope, $rootScope, $routeParams, mqWebQueue) {

	$scope.loading = true;
	$scope.mqweb = null;
	$scope.error = null;
	$scope.queue = null;
	
	mqWebQueue.inquire($routeParams.queueName)
		.success(function(data, status) {
			$scope.loading = false;
			$scope.mqweb = data.mqweb;
			if ( data.queues.length > 0 )
			{
				$scope.queue = { 'data' : data.queues[0] };
				$rootScope.updateQueue($scope.queue);
			}
			$scope.error = data.error;
		}).error(function(data, status) {
			$scope.loading = false;
	});
		
	$scope.reload = function()
	{
		$scope.loading = true;
		mqWebQueue.inquire($scope.queue.data.QName.value)
			.success(function(data, status) {
				$scope.loading = false;
				if ( data.queues.length > 0 )
				{
					$scope.queue.data = data.queues[0];
				}
				$rootScope.updateQueue($scope.queue);
			}).error(function(data, status) {
				$scope.loading = false;
			});
	}
}]);
{'fraction_non_alphanumeric': 0.167786391042205, 'fraction_numerical': 0.002239448751076658, 'mean_word_length': 3.082981715893108, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1335316', 'n_tokens_mistral': 2488, 'n_tokens_neox': 2103, 'n_words': 372}