mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-23 22:45:06 -04:00
Added Disk space information to system.
(cherry picked from commit 91625019378247b1c6ab85afaee23f2855e3298b)
This commit is contained in:
committed by
Mark McDowall
parent
4510ca8fa1
commit
041e767f3d
@@ -0,0 +1,59 @@
|
||||
'use strict';
|
||||
define([
|
||||
'vent',
|
||||
'marionette',
|
||||
'backgrid',
|
||||
'System/DiskSpace/DiskSpaceCollection',
|
||||
'Shared/LoadingView'
|
||||
], function (vent,Marionette,Backgrid,DiskSpaceCollection,LoadingView) {
|
||||
return Marionette.Layout.extend({
|
||||
template: 'System/DiskSpace/DiskSpaceTemplate',
|
||||
|
||||
regions: {
|
||||
grid: '#x-grid'
|
||||
},
|
||||
columns:
|
||||
[
|
||||
{
|
||||
name: 'driveLetter',
|
||||
label: 'Drive',
|
||||
cell: Backgrid.StringCell
|
||||
},
|
||||
{
|
||||
name: 'freeSpace',
|
||||
label: 'Free Space',
|
||||
cell: Backgrid.StringCell
|
||||
},
|
||||
{
|
||||
name: 'totalSpace',
|
||||
label: 'Total Space',
|
||||
cell: Backgrid.StringCell
|
||||
}
|
||||
],
|
||||
|
||||
initialize: function () {
|
||||
this.collection = new DiskSpaceCollection();
|
||||
this.collectionPromise = this.collection.fetch();
|
||||
|
||||
vent.on(vent.Events.CommandComplete, this._commandComplete, this);
|
||||
},
|
||||
onRender : function() {
|
||||
this.grid.show(new LoadingView());
|
||||
},
|
||||
|
||||
onShow: function() {
|
||||
var self = this;
|
||||
this.collectionPromise.done(function() {
|
||||
self._showTable();
|
||||
});
|
||||
},
|
||||
_showTable: function() {
|
||||
this.grid.show(new Backgrid.Grid({
|
||||
row: Backgrid.Row,
|
||||
columns: this.columns,
|
||||
collection: this.collection,
|
||||
className:'table table-hover'
|
||||
}));
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user