<commit_before>angular.module('ot.view.admin.jobs', [
    'ui.router',
    'ot.service.core',
    'ot.service.task'
])
    .config(function ($stateProvider) {
        $stateProvider.state('admin-jobs', {
            url: '/admin-jobs',
            templateUrl: 'app/view/view.admin.jobs.tpl.html',
            controller: 'AdminJobsCtrl'
        });
    })
    .controller('AdminJobsCtrl', function ($scope, $http, ot, otAlertService, otTaskService, otNotificationService) {
        const view = ot.view();
        view.title = "System jobs";
        view.description = "Tools for the management of system background jobs";

        // Current filter
        $scope.jobFilter = {
            state: undefined,
            category: undefined,
            type: undefined,
            description: '',
            errorOnly: false
        };

        // Current page
        $scope.page = {
            offset: 0,
            count: 30
        };

        // Category filter selection
        $scope.setJobFilterCategory = (category) => {
            if ($scope.jobFilter.category !== category) {
                $scope.jobFilter.category = category;
                $scope.jobFilter.type = undefined;
            }
        };

        // Loads the jobs
        $scope.loadJobs = loadJobs;
        function loadJobs() {
            $scope.loadingJobs = true;
            ot.pageCall($http.get('admin/jobs/filter'))
                .then(jobFilterResources => {
                    $scope.jobFilterResources = jobFilterResources;
                    // TODO Current job filter and pagination
                    return ot.pageCall($http.get('admin/jobs'));
                })
                .then(jobs => {
                    $scope.jobs = jobs;
                    view.commands = [
                        ot.viewApiCommand(jobs._self),
                        ot.viewCloseCommand('/home')
                    ];
                })
                .finally(() => {
                    $scope.loadingJobs = false;
                });
        }

        // Initialisation
        loadJobs();

        const interval = 10 * 1000; // 10 seconds
        otTaskService.register('Admin Console Load Jobs', loadJobs, interval);
<commit_msg>#547 Job filter - ui - parameters<commit_after>angular.module('ot.view.admin.jobs', [
    'ui.router',
    'ot.service.core',
    'ot.service.task'
])
    .config(function ($stateProvider) {
        $stateProvider.state('admin-jobs', {
            url: '/admin-jobs',
            templateUrl: 'app/view/view.admin.jobs.tpl.html',
            controller: 'AdminJobsCtrl'
        });
    })
    .controller('AdminJobsCtrl', function ($scope, $http, ot, otAlertService, otTaskService, otNotificationService) {
        const view = ot.view();
        view.title = "System jobs";
        view.description = "Tools for the management of system background jobs";

        // Current filter
        $scope.jobFilter = {
            state: undefined,
            category: undefined,
            type: undefined,
            description: '',
            errorOnly: false
        };

        // Current page
        $scope.page = {
            offset: 0,
            count: 30
        };

        // Category filter selection
        $scope.setJobFilterCategory = (category) => {
            if ($scope.jobFilter.category !== category) {
                $scope.jobFilter.category = category;
                $scope.jobFilter.type = undefined;
            }
        };

        // Loads the jobs
        $scope.loadJobs = loadJobs;
        function loadJobs() {
            $scope.loadingJobs = true;
            ot.pageCall($http.get('admin/jobs/filter'))
                .then(jobFilterResources => {
                    $scope.jobFilterResources = jobFilterResources;
                    // Parameters
                    const params = {};
                    params.state = $scope.jobFilter.state ? $scope.jobFilter.state.name : undefined;
                    params.category = $scope.jobFilter.category ? $scope.jobFilter.category.name : undefined;
                    params.type = $scope.jobFilter.type ? $scope.jobFilter.type.name : undefined;
                    params.description = $scope.jobFilter.description ? $scope.jobFilter.description : undefined;
                    params.errorOnly = $scope.jobFilter.errorOnly ? $scope.jobFilter.errorOnly : undefined;
                    console.log("Job params = ", params);
                    // Call
                    return ot.pageCall($http.get('admin/jobs', {
                        params: params
                    }));
                })
                .then(jobs => {
                    $scope.jobs = jobs;
                    view.commands = [
                        ot.viewApiCommand(jobs._self),
                        ot.viewCloseCommand('/home')
                    ];
                })
                .finally(() => {
                    $scope.loadingJobs = false;
                });
        }

        // Initialisation
        loadJobs();

        const interval = 10 * 1000; // 10 seconds
        otTaskService.register('Admin Console Load Jobs', loadJobs, interval);

{'fraction_non_alphanumeric': 0.11756756756756757, 'fraction_numerical': 0.004826254826254826, 'mean_word_length': 1.4266978922716627, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '2356446', 'n_tokens_mistral': 1362, 'n_tokens_neox': 1264, 'n_words': 249}