Skip to content

Commit

Permalink
Fix Progress in case no percentage is available
Browse files Browse the repository at this point in the history
  • Loading branch information
william-gr committed Jun 28, 2013
1 parent 6f12775 commit ba01141
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions gui/freeadmin/static/lib/js/freeadmin/Progress.js
Expand Up @@ -113,26 +113,29 @@ define([
});
me._iter += 1;
} else {
console.log("next", me.poolUrl);
xhr.get(me.poolUrl, {
headers: {"X-Progress-ID": me.uuid},
handleAs: "json"
}).then(function(data) {
if(data.step) {
me._curStep = data.step;
}
if(data.percent == 100) {
me._subProgress.update({'indeterminate': true});
me._masterProgress(data.percent);
if(me._curStep == me._numSteps)
return;
if(data.percent) {
if(data.percent == 100) {
me._subProgress.update({'indeterminate': true});
me._masterProgress(data.percent);
if(me._curStep == me._numSteps)
return;
} else {
me._subProgress.update({
maximum: 100,
progress: data.percent,
indeterminate: false
});
me._masterProgress(data.percent);
}
} else {
me._subProgress.update({
maximum: 100,
progress: data.percent,
indeterminate: false
});
me._masterProgress(data.percent);
me._subProgress.update({'indeterminate': true});
}
setTimeout(function() {
me.update();
Expand Down

0 comments on commit ba01141

Please sign in to comment.