mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-21 22:04:31 -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:
@@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'System/StatusModel'
|
||||
], function (Marionette, StatusModel) {
|
||||
return Marionette.ItemView.extend({
|
||||
template: 'System/Info/About/AboutViewTemplate',
|
||||
|
||||
initialize: function () {
|
||||
this.model = StatusModel;
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,13 @@
|
||||
<fieldset>
|
||||
<legend>About</legend>
|
||||
|
||||
<dl class="dl-horizontal">
|
||||
<dt>Version</dt>
|
||||
<dd>{{version}}</dd>
|
||||
<dt>AppData directory</dt>
|
||||
<dd>{{appData}}</dd>
|
||||
<dt>Startup directory</dt>
|
||||
<dd>{{startupPath}}</dd>
|
||||
</dl>
|
||||
</fieldset>
|
||||
|
||||
@@ -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({
|
||||
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,26 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'backbone',
|
||||
'marionette',
|
||||
'System/Info/About/AboutView',
|
||||
'System/Info/DiskSpace/DiskSpaceLayout'
|
||||
], function (Backbone,
|
||||
Marionette,
|
||||
AboutView,
|
||||
DiskSpaceLayout) {
|
||||
return Marionette.Layout.extend({
|
||||
template: 'System/Info/SystemInfoLayoutTemplate',
|
||||
|
||||
regions: {
|
||||
about : '#about',
|
||||
diskSpace: '#diskspace'
|
||||
},
|
||||
|
||||
onRender: function () {
|
||||
this.about.show(new AboutView());
|
||||
this.diskSpace.show(new DiskSpaceLayout());
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<div class="row">
|
||||
<div class="span12" id="about"></div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="span12" id="diskspace"></div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user