1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-23 22:25:14 -04: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:
Mark McDowall
2013-10-11 16:18:04 -07:00
parent 6c414929c3
commit 43a70f4479
13 changed files with 73 additions and 52 deletions
@@ -0,0 +1,8 @@
'use strict';
define(['backbone', 'System/Info/DiskSpace/DiskSpaceModel'],
function(Backbone, DiskSpaceModel) {
return Backbone.Collection.extend({
url:window.NzbDrone.ApiRoot +'/diskspace',
model: DiskSpaceModel
});
});
@@ -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'
}));
}
});
});
@@ -0,0 +1,5 @@
<fieldset>
<legend>Disk Space</legend>
<div id="x-grid"/>
</fieldset>
@@ -0,0 +1,6 @@
'use strict';
define(['backbone'], function (Backbone) {
return Backbone.Model.extend({
});
});