Skip to content
Browse files

Fix Progress in case no percentage is available

  • Loading branch information...
1 parent 6f12775 commit ba011411a3d4be569c5e09ba70a622e060d8533c @williambr williambr committed Jun 28, 2013
Showing with 15 additions and 12 deletions.
  1. +15 −12 gui/freeadmin/static/lib/js/freeadmin/Progress.js
View
27 gui/freeadmin/static/lib/js/freeadmin/Progress.js
@@ -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();

0 comments on commit ba01141

Please sign in to comment.
Something went wrong with that request. Please try again.