Bugzilla – Attachment 154216 Details for
Bug 34468
Add a progress callback to job_progress.js
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34468: Add progress callback to job_progress.js
Bug-34468-Add-progress-callback-to-jobprogressjs.patch (text/plain), 2.07 KB, created by
Pedro Amorim
on 2023-08-03 10:12:34 UTC
(
hide
)
Description:
Bug 34468: Add progress callback to job_progress.js
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-08-03 10:12:34 UTC
Size:
2.07 KB
patch
obsolete
>From d5f1ddba82118454340bb737052dd852f85d0213 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Thu, 3 Aug 2023 10:11:39 +0000 >Subject: [PATCH] Bug 34468: Add progress callback to job_progress.js > >--- > koha-tmpl/intranet-tmpl/prog/js/job_progress.js | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/job_progress.js b/koha-tmpl/intranet-tmpl/prog/js/job_progress.js >index dfe03e60e0..acd75e3d2a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/job_progress.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/job_progress.js >@@ -1,4 +1,4 @@ >-function updateProgress(job_id, callback) { >+function updateProgress(job_id, callbacks) { > $.getJSON('/api/v1/jobs/' + job_id, function(job){ > let recheck = true; > >@@ -14,13 +14,14 @@ function updateProgress(job_id, callback) { > $('#job-status-' + job_id).text(JOB_PROGRESS_STARTED); > $('#progress-bar-' + job_id).attr('aria-valuenow', percent); > $('#progress-bar-' + job_id).width(Math.floor(percent) +"%"); >+ typeof callbacks.progress_callback === 'function' && callbacks.progress_callback(); > } else if ( job.status == "finished" ) { > $('#job-percent-' + job_id).text(100); > $('#job-status-' + job_id).text(JOB_PROGRESS_FINISHED); > $('#progress-bar-' + job_id).addClass("progress-bar-success"); > $('#progress-bar-' + job_id).attr('aria-valuenow', 100).css("width", "100%"); > recheck = false; >- callback(); >+ typeof callbacks.finish_callback === 'function' && callbacks.finish_callback(); > } else if ( job.status == "failed" ) { > $('#job-percent-' + job_id).text(0); > $('#job-status-' + job_id).text(JOB_PROGRESS_FAILED); >@@ -30,7 +31,7 @@ function updateProgress(job_id, callback) { > } > > if ( recheck ) { >- setTimeout(function(){updateProgress(job_id, callback)}, 1 * 1000); >+ setTimeout(function(){updateProgress(job_id, callbacks)}, 1 * 1000); > } > }); > } >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34468
:
154216
|
154217
|
154739
|
154740
|
157517
|
157518