Sonarr/src/UI/Activity/Queue/ProgressCell.js

24 lines
708 B
JavaScript
Raw Normal View History

2015-02-03 01:18:45 +00:00
var NzbDroneCell = require('../../Cells/NzbDroneCell');
module.exports = NzbDroneCell.extend({
className : 'progress-cell',
2015-02-13 21:03:50 +00:00
render : function() {
2015-02-03 01:18:45 +00:00
this.$el.empty();
2015-02-13 21:03:50 +00:00
if (this.cellValue) {
2015-02-03 01:18:45 +00:00
var status = this.model.get('status').toLowerCase();
2015-02-13 21:03:50 +00:00
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));
2014-12-04 06:26:50 +00:00
}
2015-02-03 01:18:45 +00:00
}
2015-02-13 21:03:50 +00:00
2015-02-03 01:18:45 +00:00
return this;
}
2015-02-13 21:03:50 +00:00
});