Bug 34364: Fix progress bar progress update

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Pedro Amorim 2023-07-24 15:42:57 +00:00 committed by Tomas Cohen Arazi
parent a05dff84eb
commit 1403fd847a
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
2 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,5 @@
<div class="progress">
<div id="progress-bar-[% job_id | html %]" class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:100%">
<div id="progress-bar-[% job_id | html %]" class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">
<span id="job-percent-[% job_id | html %]">0</span>% <span id="job-status-[% job_id | html %]"></span>
</div>
</div>

View File

@ -12,7 +12,8 @@ function updateProgress(job_id, callback) {
const percent = progress > 0 ? ( progress / size ) * 100 : 0;
$('#job-percent-' + job_id).text(percent.toFixed(2));
$('#job-status-' + job_id).text(JOB_PROGRESS_STARTED);
$('#progress-bar-' + job_id).attr('aria-valuenow', percent).css("width", "percent+%");
$('#progress-bar-' + job_id).attr('aria-valuenow', percent);
$('#progress-bar-' + job_id).width(Math.floor(percent) +"%");
} else if ( job.status == "finished" ) {
$('#job-percent-' + job_id).text(100);
$('#job-status-' + job_id).text(JOB_PROGRESS_FINISHED);