mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-09 04:22:30 +01:00
New: Progress bar for Activity: Queue
This commit is contained in:
parent
6b56e912eb
commit
bffc64b92b
29
src/UI/Activity/Queue/ProgressCell.js
Normal file
29
src/UI/Activity/Queue/ProgressCell.js
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
define(
|
||||||
|
[
|
||||||
|
'Cells/NzbDroneCell'
|
||||||
|
], function (NzbDroneCell) {
|
||||||
|
return NzbDroneCell.extend({
|
||||||
|
|
||||||
|
className: 'progress-cell',
|
||||||
|
|
||||||
|
render: function () {
|
||||||
|
this.$el.empty();
|
||||||
|
|
||||||
|
if (this.cellValue) {
|
||||||
|
|
||||||
|
var status = this.model.get('status').toLowerCase();
|
||||||
|
|
||||||
|
if (status === 'downloading') {
|
||||||
|
var progress = 100 - (this.model.get('sizeleft') / this.model.get('size') * 100);
|
||||||
|
|
||||||
|
this.$el.html('<div class="progress" title="{0}%">'.format(progress.toFixed(1)) +
|
||||||
|
'<div class="progress-bar progress-bar-purple" style="width: {0}%;"></div></div>'.format(progress));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
@ -10,6 +10,7 @@ define(
|
|||||||
'Cells/QualityCell',
|
'Cells/QualityCell',
|
||||||
'Activity/Queue/QueueStatusCell',
|
'Activity/Queue/QueueStatusCell',
|
||||||
'Activity/Queue/TimeleftCell',
|
'Activity/Queue/TimeleftCell',
|
||||||
|
'Activity/Queue/ProgressCell',
|
||||||
'Shared/Grid/Pager'
|
'Shared/Grid/Pager'
|
||||||
], function (Marionette,
|
], function (Marionette,
|
||||||
Backgrid,
|
Backgrid,
|
||||||
@ -20,6 +21,7 @@ define(
|
|||||||
QualityCell,
|
QualityCell,
|
||||||
QueueStatusCell,
|
QueueStatusCell,
|
||||||
TimeleftCell,
|
TimeleftCell,
|
||||||
|
ProgressCell,
|
||||||
GridPager) {
|
GridPager) {
|
||||||
return Marionette.Layout.extend({
|
return Marionette.Layout.extend({
|
||||||
template: 'Activity/Queue/QueueLayoutTemplate',
|
template: 'Activity/Queue/QueueLayoutTemplate',
|
||||||
@ -66,6 +68,12 @@ define(
|
|||||||
label : 'Timeleft',
|
label : 'Timeleft',
|
||||||
cell : TimeleftCell,
|
cell : TimeleftCell,
|
||||||
cellValue : 'this'
|
cellValue : 'this'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name : 'episode',
|
||||||
|
label : 'Progress',
|
||||||
|
cell : ProgressCell,
|
||||||
|
cellValue : 'this'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
td.episode-status-cell, td.quality-cell, td.history-quality-cell {
|
td.episode-status-cell, td.quality-cell, td.history-quality-cell, td.progress-cell {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: 80px;
|
width: 80px;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user