Permalink
Browse files

Upload task status

  • Loading branch information...
1 parent 80f6cea commit 4747a04c791d5806e52757a0d82b3f41752a8899 @cdujeu cdujeu committed Sep 19, 2016
@@ -236,8 +236,12 @@
this._internal['progress'] = progress;
this.updateStatus(PydioTasks.Task.STATUS_RUNNING);
}
+ setPending(queueSize){
+ this._internal['statusMessage'] = queueSize + ' files waiting for upload';
+ this.updateStatus(PydioTasks.Task.STATUS_PENDING);
+ }
setRunning(queueSize){
- this._internal['statusMessage'] = queueSize + ' files to upload';
+ this._internal['statusMessage'] = 'Uploading ' + queueSize + ' files';
this.updateStatus(PydioTasks.Task.STATUS_RUNNING);
}
setIdle(){
@@ -303,22 +307,22 @@
}
pushFolder(folderItem){
this._folders.push(folderItem);
+ UploadTask.getInstance().setPending(this.getQueueSize());
if(this.getAutoStart() && !this._processing.length) {
this.processNext();
} // Autostart with queue was empty before
- UploadTask.getInstance().setRunning(this.getQueueSize());
this.notify('update');
}
pushFile(uploadItem){
this._uploads.push(uploadItem);
+ UploadTask.getInstance().setPending(this.getQueueSize());
uploadItem.observe("progress", function(){
let pg = this.recomputeGlobalProgress();
UploadTask.getInstance().setProgress(pg);
}.bind(this));
if(this.getAutoStart() && !this._processing.length) {
this.processNext();
} // Autostart with queue was empty before
- UploadTask.getInstance().setRunning(this.getQueueSize());
this.notify('update');
}
log(){
@@ -346,6 +350,7 @@
this._processing = [];
this._processed = [];
this.notify('update');
+ UploadTask.getInstance().setIdle();
}
processNext(){
let processable = this.getNext();
@@ -125,10 +125,10 @@
};
let statusMessage = this.props.item.getStatus();
let stopButton;
- if(statusMessage === 'new'){
- stopButton = <span className="stop-button mdi mdi-close" onClick={this.abortTransfer}/>;
- }else if(statusMessage === 'loading'){
+ if(statusMessage === 'loading'){
stopButton = <span className="stop-button icon-stop" onClick={this.abortTransfer}/>;
+ }else{
+ stopButton = <span className="stop-button mdi mdi-close" onClick={this.abortTransfer}/>;
}
if(global.pydio.MessageHash[messageIds[statusMessage]]){
statusMessage = global.pydio.MessageHash[messageIds[statusMessage]];

0 comments on commit 4747a04

Please sign in to comment.