Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Improve task display and upload global progress
Browse files Browse the repository at this point in the history
Add a way to change user groupPath with api v2.
  • Loading branch information
cdujeu committed May 23, 2017
1 parent ac4ee50 commit ad1e18a
Show file tree
Hide file tree
Showing 20 changed files with 53 additions and 30 deletions.
5 changes: 5 additions & 0 deletions core/src/plugins/access.ajxp_conf/src/UsersManager.php
Expand Up @@ -126,6 +126,11 @@ public function peopleApiActions(ServerRequestInterface $requestInterface, Respo
$newAction = "update_user_profile";
$newVars["profile"] = $paramValue;
break;
case "userGroupPath":
$newAction = "user_update_group";
$newVars["file"] = basename($path);
$newVars["group_path"] = $paramValue;
break;
case "userLock":
list($lockType, $lockValue) = explode(":", $paramValue);
$newVars["lock_type"] = $lockType;
Expand Down
4 changes: 3 additions & 1 deletion core/src/plugins/access.fs/res/js/callback/deleteAction.js
Expand Up @@ -50,7 +50,9 @@ export default function (pydio) {
message:message,
dialogTitleId: 7,
validCallback:function(){
PydioApi.getClient().postSelectionWithAction('delete');
PydioApi.getClient().postSelectionWithAction('delete', () => {
pydio.getContextHolder().setSelectedNodes([]);
});
}
});
};
Expand Down
14 changes: 6 additions & 8 deletions core/src/plugins/core.tasks/js/react/PydioTasks.js
Expand Up @@ -315,15 +315,13 @@

let actions;
if(t.getStatus() === Task.STATUS_RUNNING && t.isStoppable()){
actions = (<span className="icon-stop" onClick={t.pause.bind(t)}/>);
actions = (<span className="mdi mdi-stop" onClick={t.pause.bind(t)}/>);
}else{
actions = (<span className="mdi mdi-close-circle-outline" onClick={t.stop.bind(t)}/>);
actions = (<span className="mdi mdi-close" onClick={t.stop.bind(t)}/>);
}
if(this.state.showProgress && t.hasProgress() && t.getStatus() !== Task.STATUS_FAILED){
actions = (
<div className="radial-progress">
<div className={"pie-wrapper pie-wrapper--solid progress-" + t.getProgress()}></div>
</div>
<MaterialUI.CircularProgress mode="determinate" value={t.getProgress()} size={26} style={{marginTop:8}}/>
);
}
return <div className="task_actions" onMouseOver={this.showAction} onMouseOut={this.showProgress}>{actions}</div>;
Expand Down Expand Up @@ -411,12 +409,12 @@
if(!tasks.length){
className += " invisible";
}else{
heightStyle = {height: this.state.mouseOver ? 'auto' : Math.min(tasks.length * 60, 180)};
heightStyle = {height: this.state.mouseOver ? 'auto' : Math.min(tasks.length * 61, 180)};
}
return (
<div onMouseOver={this.onMouseOver} onMouseOut={this.onMouseOut} className={className} style={heightStyle}>
<MaterialUI.Paper zDepth={2} onMouseOver={this.onMouseOver} onMouseOut={this.onMouseOut} className={className} style={heightStyle}>
{tasks}
</div>
</MaterialUI.Paper>
);
}
});
Expand Down
Expand Up @@ -11,7 +11,7 @@ div.pydio-tasks-panel{
overflow-y: auto;
overflow-x: hidden;
background-color: white;
box-shadow: @reactBoxShadowDepth1;
/*box-shadow: @reactBoxShadowDepth1;*/
z-index: 20001;
transition: @bezier_transition;
&.invisible{
Expand Down Expand Up @@ -43,9 +43,10 @@ div.pydio-tasks-panel{
cursor: pointer;
> span{
display: inline-block;
margin-top: 15px;
margin-top: 11px;
color: #325e74;
margin-left: 10px;
color: @teal-500;
font-size: 20px;
}
}
&.task-status-8{ /* error status */
Expand Down
7 changes: 4 additions & 3 deletions core/src/plugins/gui.ajax/res/themes/material/css/pydio.css
Expand Up @@ -1997,7 +1997,7 @@ div.pydio-tasks-panel {
overflow-y: auto;
overflow-x: hidden;
background-color: white;
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.12);
/*box-shadow: @reactBoxShadowDepth1;*/
z-index: 20001;
transition: all 550ms cubic-bezier(0.23, 1, 0.32, 1) 0ms;
}
Expand Down Expand Up @@ -2035,9 +2035,10 @@ div.pydio-tasks-panel div.task .task_actions {
}
div.pydio-tasks-panel div.task .task_actions > span {
display: inline-block;
margin-top: 15px;
margin-top: 11px;
color: #325e74;
margin-left: 10px;
color: #009688;
font-size: 20px;
}
div.pydio-tasks-panel div.task.task-status-8 {
/* error status */
Expand Down
Binary file removed core/src/plugins/uploader.html/i18n/ca-dropzone.png
Binary file not shown.
Binary file removed core/src/plugins/uploader.html/i18n/cs-dropzone.png
Binary file not shown.
Binary file removed core/src/plugins/uploader.html/i18n/de-dropzone.png
Binary file not shown.
1 change: 1 addition & 0 deletions core/src/plugins/uploader.html/i18n/de.php
Expand Up @@ -42,4 +42,5 @@
"20" => "Datei automatisch umbenennen",
"21" => "Bestehende Datei überschreiben",
"22" => "Optionen",
"23" => "Errors",
];
Binary file removed core/src/plugins/uploader.html/i18n/en-dropzone.png
Binary file not shown.
1 change: 1 addition & 0 deletions core/src/plugins/uploader.html/i18n/en.php
Expand Up @@ -42,4 +42,5 @@
"20" => "Rename file automatically",
"21" => "Overwrite existing file silently",
"22" => "Options",
"23" => "Errors",
];
Binary file removed core/src/plugins/uploader.html/i18n/es-dropzone.png
Binary file not shown.
1 change: 1 addition & 0 deletions core/src/plugins/uploader.html/i18n/es.php
Expand Up @@ -41,4 +41,5 @@
"19" => "Parar subida y notificarme",
"20" => "Renombar archivo",
"21" => "Sobreescribir",
"23" => "Errors",
];
Binary file removed core/src/plugins/uploader.html/i18n/fi-dropzone.png
Binary file not shown.
Binary file removed core/src/plugins/uploader.html/i18n/fr-dropzone.png
Binary file not shown.
1 change: 1 addition & 0 deletions core/src/plugins/uploader.html/i18n/fr.php
Expand Up @@ -42,4 +42,5 @@
"20" => "Renommer automatiquement",
"21" => "Remplacer le fichier existant",
"22" => "Options",
"23" => "Erreurs",
];
Binary file removed core/src/plugins/uploader.html/i18n/pt-dropzone.png
Binary file not shown.
Binary file removed core/src/plugins/uploader.html/i18n/si-dropzone.png
Binary file not shown.
41 changes: 26 additions & 15 deletions core/src/plugins/uploader.html/js/react/UploaderModel.js
Expand Up @@ -326,23 +326,24 @@
this._uploads = [];
this._processing = [];
this._processed = [];
this._errors = [];
// Todo
this._queueCounter = 0;
this._maxQueueSize = 2;
}
recomputeGlobalProgress(){
let totalCount = 0;
let totalProgress = 0;
this._uploads.concat(this._processing).forEach(function(item){
this._uploads.concat(this._processing).concat(this._processed).forEach(function(item){
if(!item.getProgress) return;
totalCount ++;
totalProgress += item.getProgress();
totalCount += item.getSize();
totalProgress += item.getProgress() * item.getSize() / 100;
});
let progress;
if(!totalCount) {
progress = 0;
}else{
progress = Math.ceil(totalProgress / totalCount);
progress = totalProgress / totalCount * 100;
}
return progress;
}
Expand All @@ -353,6 +354,9 @@
return UploaderConfigs.getInstance().getOptionAsBool("DEFAULT_AUTO_CLOSE", "upload_auto_close");
}
pushFolder(folderItem){
if(!this.getQueueSize()){
this._processed = [];
}
this._folders.push(folderItem);
UploadTask.getInstance().setPending(this.getQueueSize());
if(this.getAutoStart() && !this._processing.length) {
Expand All @@ -362,6 +366,9 @@
this.notify('item_added', folderItem);
}
pushFile(uploadItem){
if(!this.getQueueSize()){
this._processed = [];
}
this._uploads.push(uploadItem);
UploadTask.getInstance().setPending(this.getQueueSize());
uploadItem.observe("progress", function(){
Expand All @@ -380,7 +387,11 @@
let next = this.getNext();
while(next !== null){
next.process(function(){
this._processed.push(next);
if(next.getStatus() === 'error') {
this._errors.push(next);
} else {
this._processed.push(next);
}
this.notify("update");
}.bind(this));
next = this.getNext();
Expand All @@ -394,6 +405,7 @@
this._uploads = [];
this._processing = [];
this._processed = [];
this._errors = [];
this.notify('update');
UploadTask.getInstance().setIdle();
}
Expand All @@ -404,7 +416,11 @@
UploadTask.getInstance().setRunning(this.getQueueSize());
processable.process(function(){
this._processing = LangUtils.arrayWithout(this._processing, this._processing.indexOf(processable));
this._processed.push(processable);
if(processable.getStatus() === 'error') {
this._errors.push(processable)
} else {
this._processed.push(processable);
}
this.processNext();
this.notify("update");
}.bind(this));
Expand All @@ -429,7 +445,7 @@
}
stopOrRemoveItem(item){
item.abort();
['_uploads', '_folders', '_processing', '_processed'].forEach(function(key){
['_uploads', '_folders', '_processing', '_processed', '_errors'].forEach(function(key){
let arr = this[key];
if(arr.indexOf(item) !== -1) {
this[key] = LangUtils.arrayWithout(arr, arr.indexOf(item));
Expand All @@ -441,17 +457,12 @@
return {
processing: this._processing,
pending: this._folders.concat(this._uploads),
processed: this._processed
processed: this._processed,
errors: this._errors
};
}
hasErrors(){
let result = false;
this._processed.map(function(item){
if(item.getStatus() === 'error'){
result = true;
}
});
return result;
return this._errors.length ? this._errors : false;
}
static getInstance(){
if(!UploaderStore.__INSTANCE){
Expand Down
1 change: 1 addition & 0 deletions core/src/plugins/uploader.html/js/react/UploaderView.js
Expand Up @@ -251,6 +251,7 @@
if(this.state && this.state.items){
this.renderSection(items, this.state.items.processing, global.pydio.MessageHash['html_uploader.14'], 'section-processing');
this.renderSection(items, this.state.items.pending, global.pydio.MessageHash['html_uploader.15'], 'section-pending');
this.renderSection(items, this.state.items.errors, global.pydio.MessageHash['html_uploader.23'], 'section-errors');
this.renderSection(items, this.state.items.processed, global.pydio.MessageHash['html_uploader.16'], 'section-processed');
}
return (
Expand Down

0 comments on commit ad1e18a

Please sign in to comment.