mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-18 21:35:51 -04:00
Updated as per markus request for viewing disk space
Added two methods to Diskprovider:- getFixedDrives, getTotalSize and letting UI decide on how to display space. and changed from vent to listenTo (cherry picked from commit 5aa00cfb6498d4731d5d880c346afe747a61024e)
This commit is contained in:
committed by
Mark McDowall
parent
041e767f3d
commit
6c414929c3
@@ -4,8 +4,9 @@ define([
|
||||
'marionette',
|
||||
'backgrid',
|
||||
'System/DiskSpace/DiskSpaceCollection',
|
||||
'Shared/LoadingView'
|
||||
], function (vent,Marionette,Backgrid,DiskSpaceCollection,LoadingView) {
|
||||
'Shared/LoadingView',
|
||||
'Cells/FileSizeCell'
|
||||
], function (vent,Marionette,Backgrid,DiskSpaceCollection,LoadingView,FileSizeCell) {
|
||||
return Marionette.Layout.extend({
|
||||
template: 'System/DiskSpace/DiskSpaceTemplate',
|
||||
|
||||
@@ -17,35 +18,32 @@ define([
|
||||
{
|
||||
name: 'driveLetter',
|
||||
label: 'Drive',
|
||||
cell: Backgrid.StringCell
|
||||
cell: 'string'
|
||||
},
|
||||
{
|
||||
name: 'freeSpace',
|
||||
label: 'Free Space',
|
||||
cell: Backgrid.StringCell
|
||||
cell: FileSizeCell,
|
||||
sortable:true
|
||||
},
|
||||
{
|
||||
name: 'totalSpace',
|
||||
label: 'Total Space',
|
||||
cell: Backgrid.StringCell
|
||||
cell: FileSizeCell,
|
||||
sortable:true
|
||||
}
|
||||
],
|
||||
|
||||
initialize: function () {
|
||||
this.collection = new DiskSpaceCollection();
|
||||
this.collectionPromise = this.collection.fetch();
|
||||
|
||||
vent.on(vent.Events.CommandComplete, this._commandComplete, this);
|
||||
this.listenTo(this.collection, 'sync', this._showTable);
|
||||
},
|
||||
onRender : function() {
|
||||
this.grid.show(new LoadingView());
|
||||
},
|
||||
|
||||
onShow: function() {
|
||||
var self = this;
|
||||
this.collectionPromise.done(function() {
|
||||
self._showTable();
|
||||
});
|
||||
this.collection.fetch();
|
||||
},
|
||||
_showTable: function() {
|
||||
this.grid.show(new Backgrid.Grid({
|
||||
|
||||
Reference in New Issue
Block a user