View | Details | Raw Unified | Return to bug 37888
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt (-24 / +3 lines)
Lines 119-133 Link Here
119
    <h1>Jobs</h1>
119
    <h1>Jobs</h1>
120
    <div>
120
    <div>
121
        <input type="checkbox" id="only_current" checked />
121
        <input type="checkbox" id="only_current" />
122
        <label for="only_current">Current jobs only</label>
122
        <label for="only_current">Current jobs only</label>
123
    </div>
123
    </div>
124
    <div>
125
        <input type="checkbox" id="include_last_hour" checked />
126
        <label for="include_last_hour">Only include jobs enqueued in the last hour</label>
127
    </div>
128
129
    <div class="page-section">
124
    <div class="page-section">
130
        <table id="table_jobs">
125
        <table id="table_jobs">
131
            <thead>
126
            <thead>
Lines 259-274 Link Here
259
                $("#job_details").show();
254
                $("#job_details").show();
260
            [% END %]
255
            [% END %]
261
            let additional_filters = {
262
                enqueued_date: function(){
263
                    if ( $("#include_last_hour").is(":checked") ) {
264
                        return { ">": dayjs().subtract(1, 'hour').format() };
265
                    } else {
266
                        return { "<": dayjs().format()};
267
                    }
268
                }
269
            };
270
271
            let only_current_filter = function(){
256
            let only_current_filter = function(){
272
                if ( $("#only_current").is(":checked") ) {
257
                if ( $("#only_current").is(":checked") ) {
273
                    return 'only_current=1';
258
                    return 'only_current=1';
Lines 281-287 Link Here
281
                "ajax": {
266
                "ajax": {
282
                    "url": "/api/v1/jobs?" + only_current_filter()
267
                    "url": "/api/v1/jobs?" + only_current_filter()
283
                },
268
                },
284
                "order": [[ 1, "desc" ]],
269
                "order": [[ 4, "desc" ]],
285
                "columns": [
270
                "columns": [
286
                    {
271
                    {
287
                        "data": "job_id",
272
                        "data": "job_id",
Lines 348-359 Link Here
348
                        "orderable": false
333
                        "orderable": false
349
                    }
334
                    }
350
                ]
335
                ]
351
            }, null, 1, additional_filters);
336
            }, null, 1);
352
353
            $("#include_last_hour").on("change", function(){
354
                jobs_table.DataTable().draw();
355
                return false;
356
            });
357
            $("#only_current").on("change", function(){
337
            $("#only_current").on("change", function(){
358
                jobs_table.DataTable().ajax.url("/api/v1/jobs?" + only_current_filter()).load();
338
                jobs_table.DataTable().ajax.url("/api/v1/jobs?" + only_current_filter()).load();
359
-

Return to bug 37888