Added Disk space information to system.

(cherry picked from commit 91625019378247b1c6ab85afaee23f2855e3298b)
This commit is contained in:
fzr600dave
2013-10-10 23:31:44 +01:00
committed by Mark McDowall
parent 4510ca8fa1
commit 041e767f3d
9 changed files with 160 additions and 5 deletions
@@ -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'
}));
}
});
});