Merge pull request #201 from miladj/master

change the order in the queue
This commit is contained in:
hamza zia 2016-04-24 16:06:05 +08:00
commit b9363d5eac
4 changed files with 98 additions and 71 deletions

View File

@ -1,4 +1,4 @@
<!doctype> <!doctype>
<html> <html>
<!-- {{{ head --> <!-- {{{ head -->
@ -149,7 +149,11 @@
href="#" href="#"
ng-click="purgeDownloadResult()"><span class="fa fa-fw fa-times-circle">&nbsp;</span> {{ 'Purge Completed' | translate }}</a> ng-click="purgeDownloadResult()"><span class="fa fa-fw fa-times-circle">&nbsp;</span> {{ 'Purge Completed' | translate }}</a>
</li> </li>
<li>
<a
href="#"
ng-click="shutDownServer()"><span class="fa fa-fw fa-power-off">&nbsp;</span> {{ 'Shutdown Server' | translate }}</a>
</li>
<!-- not adding remove all as requires many rpc syscalls to finish <!-- not adding remove all as requires many rpc syscalls to finish
<li> <li>
<a <a
@ -443,7 +447,18 @@
ng-click="showSettings(download)"> ng-click="showSettings(download)">
<span class="fa fa-fw fa-cog"></span> <span class="fa fa-fw fa-cog"></span>
</button> </button>
<button
ng-if="hasStatus(download, 'waiting')"
class="btn btn-default hidden-phone"
ng-click="moveDown(download)">
<span class="fa fa-fw fa-arrow-circle-o-down"></span>
</button>
<button
ng-if="hasStatus(download, 'waiting')"
class="btn btn-default hidden-phone"
ng-click="moveUp(download)">
<span class="fa fa-fw fa-arrow-circle-o-up"></span>
</button>
<div class="btn-group" dropdown> <div class="btn-group" dropdown>
<button class="btn btn-default dropdown-toggle" dropdown-toggle> <button class="btn btn-default dropdown-toggle" dropdown-toggle>
<span class="caret"></span> <span class="caret"></span>

View File

@ -400,6 +400,8 @@ function(
}; };
} }
else { else {
if (ctx.gid !== d.gid)
ctx.files = [];
ctx.dir = d.dir; ctx.dir = d.dir;
ctx.status = d.status; ctx.status = d.status;
ctx.errorCode = d.errorCode; ctx.errorCode = d.errorCode;
@ -588,5 +590,11 @@ function(
return false; return false;
} }
scope.moveDown = function (d) {
rpc.once('changePosition', [d.gid, 1, 'POS_CUR']);
};
scope.moveUp = function (d) {
rpc.once('changePosition', [d.gid, -1, 'POS_CUR']);
};
}]); }]);

View File

@ -137,4 +137,7 @@ angular
translate.use(langkey); translate.use(langkey);
}; };
scope.shutDownServer = function () {
rpc.once('shutdown', []);
};
}]); }]);

View File

@ -132,5 +132,6 @@ translations.en_US = {
'Uploaded':'Uploaded', 'Uploaded':'Uploaded',
'Download GID':'Download GID', 'Download GID':'Download GID',
'Number of Pieces':'Number of Pieces', 'Number of Pieces':'Number of Pieces',
'Piece Length':'Piece Length' 'Piece Length': 'Piece Length',
'Shutdown Server': 'Shutdown Server'
}; };