mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-29 13:25:13 +02:00
Moved disk space and about to new info tab
New: Disk space visible in the UI under System Info
This commit is contained in:
57
src/UI/System/Info/DiskSpace/DiskSpaceLayout.js
Normal file
57
src/UI/System/Info/DiskSpace/DiskSpaceLayout.js
Normal file
@@ -0,0 +1,57 @@
|
||||
'use strict';
|
||||
define([
|
||||
'vent',
|
||||
'marionette',
|
||||
'backgrid',
|
||||
'System/Info/DiskSpace/DiskSpaceCollection',
|
||||
'Shared/LoadingView',
|
||||
'Cells/FileSizeCell'
|
||||
], function (vent,Marionette,Backgrid,DiskSpaceCollection,LoadingView,FileSizeCell) {
|
||||
return Marionette.Layout.extend({
|
||||
template: 'System/Info/DiskSpace/DiskSpaceLayoutTemplate',
|
||||
|
||||
regions: {
|
||||
grid: '#x-grid'
|
||||
},
|
||||
columns:
|
||||
[
|
||||
{
|
||||
name: 'driveLetter',
|
||||
label: 'Drive',
|
||||
cell: 'string'
|
||||
},
|
||||
{
|
||||
name: 'freeSpace',
|
||||
label: 'Free Space',
|
||||
cell: FileSizeCell,
|
||||
sortable:true
|
||||
},
|
||||
{
|
||||
name: 'totalSpace',
|
||||
label: 'Total Space',
|
||||
cell: FileSizeCell,
|
||||
sortable:true
|
||||
}
|
||||
],
|
||||
|
||||
initialize: function () {
|
||||
this.collection = new DiskSpaceCollection();
|
||||
this.listenTo(this.collection, 'sync', this._showTable);
|
||||
},
|
||||
onRender : function() {
|
||||
this.grid.show(new LoadingView());
|
||||
},
|
||||
|
||||
onShow: function() {
|
||||
this.collection.fetch();
|
||||
},
|
||||
_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