Skip to content

Commit

Permalink
added button to switch prio in queue view #19
Browse files Browse the repository at this point in the history
  • Loading branch information
kraiz committed Mar 31, 2015
1 parent 1ecbc15 commit d116f43
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
12 changes: 10 additions & 2 deletions app/js/controllers/queue.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

EiskaltApp.controller('QueueCtrl', function ($scope, $interval, settings, EiskaltRPC) {
$scope.queue = []
$scope.refreshQueue = function () {
EiskaltRPC.ListQueue().success(function(queue) {
$scope.queue = queue;
Expand All @@ -15,7 +16,14 @@ EiskaltApp.controller('QueueCtrl', function ($scope, $interval, settings, Eiskal

EiskaltApp.controller('QueueItemCtrl', function ($scope, EiskaltRPC) {
$scope.collapsed = false;
$scope.abort = function (item) {
EiskaltRPC.RemoveQueueItem(item.Target).success($scope.refreshQueue);

$scope.changePrio = function (direction) {
EiskaltRPC.SetPriorityQueueItem(
$scope.item.Target,
$scope.item.PriorityOrder + direction
).success($scope.refreshQueue);
};
$scope.abort = function () {
EiskaltRPC.RemoveQueueItem($scope.item.Target).success($scope.refreshQueue);
};
});
18 changes: 16 additions & 2 deletions app/partials/queue.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,29 @@
{{ item.Status }}
<div collapse="!collapsed">
<strong>Users:</strong> {{ item.Users }}
<br>
<strong>Prio:</strong> {{ item.Priority }}
</div>
</td>
<td>
<button class="btn btn-info btn-xs" type="button" title="Show more information"
ng-click="collapsed = !collapsed" ng-class="{active: collapsed}">
<span class="glyphicon glyphicon-info-sign"></span>
<span class="glyphicon"
ng-class="{'glyphicon-collapse-up': collapsed, 'glyphicon-collapse-down': !collapsed}">
</span>
</button>
<div class="btn-group" role="group">
<button type="button" class="btn btn-default btn-xs" title="Priority up"
ng-click="changePrio(1)" ng-disabled="item.Priority == 'Highest'">
<span class="glyphicon glyphicon-open"></span>
</button>
<button type="button" class="btn btn-default btn-xs" title="Priority down"
ng-click="changePrio(-1)" ng-disabled="item.Priority == 'Paused'">
<span class="glyphicon glyphicon-save"></span>
</button>
</div>
<button class="btn btn-danger btn-xs" type="button" title="Abort download of this file"
ng-click="abort(item)">
ng-click="abort()">
<span class="glyphicon glyphicon-remove"></span>
</button>
</td>
Expand Down

0 comments on commit d116f43

Please sign in to comment.