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

View File

@ -22,7 +22,7 @@ define(
delete xhr.data; delete xhr.data;
} }
if (xhr) { if (xhr) {
xhr.headers = xhr.headers || {}; xhr.headers = xhr.headers || {};
xhr.headers.Authorization = window.NzbDrone.ApiKey; xhr.headers.Authorization = window.NzbDrone.ApiKey;

View File

@ -1,8 +0,0 @@
<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>

View File

@ -1,5 +0,0 @@
<div class="row">
<div class="span10">
<div id="x-grid"/>
</div>
</div>

View File

@ -5,7 +5,7 @@ define(
'System/StatusModel' 'System/StatusModel'
], function (Marionette, StatusModel) { ], function (Marionette, StatusModel) {
return Marionette.ItemView.extend({ return Marionette.ItemView.extend({
template: 'System/About/AboutViewTemplate', template: 'System/Info/About/AboutViewTemplate',
initialize: function () { initialize: function () {
this.model = StatusModel; this.model = StatusModel;

View File

@ -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>

View File

@ -1,5 +1,5 @@
'use strict'; 'use strict';
define(['backbone', 'System/DiskSpace/DiskSpaceModel'], define(['backbone', 'System/Info/DiskSpace/DiskSpaceModel'],
function(Backbone, DiskSpaceModel) { function(Backbone, DiskSpaceModel) {
return Backbone.Collection.extend({ return Backbone.Collection.extend({
url:window.NzbDrone.ApiRoot +'/diskspace', url:window.NzbDrone.ApiRoot +'/diskspace',

View File

@ -3,12 +3,12 @@ define([
'vent', 'vent',
'marionette', 'marionette',
'backgrid', 'backgrid',
'System/DiskSpace/DiskSpaceCollection', 'System/Info/DiskSpace/DiskSpaceCollection',
'Shared/LoadingView', 'Shared/LoadingView',
'Cells/FileSizeCell' 'Cells/FileSizeCell'
], function (vent,Marionette,Backgrid,DiskSpaceCollection,LoadingView,FileSizeCell) { ], function (vent,Marionette,Backgrid,DiskSpaceCollection,LoadingView,FileSizeCell) {
return Marionette.Layout.extend({ return Marionette.Layout.extend({
template: 'System/DiskSpace/DiskSpaceTemplate', template: 'System/Info/DiskSpace/DiskSpaceLayoutTemplate',
regions: { regions: {
grid: '#x-grid' grid: '#x-grid'

View File

@ -0,0 +1,5 @@
<fieldset>
<legend>Disk Space</legend>
<div id="x-grid"/>
</fieldset>

View File

@ -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());
}
});
});

View File

@ -0,0 +1,7 @@
<div class="row">
<div class="span12" id="about"></div>
</div>
<div class="row">
<div class="span12" id="diskspace"></div>
</div>

View File

@ -3,38 +3,33 @@ define(
[ [
'backbone', 'backbone',
'marionette', 'marionette',
'System/About/AboutView', 'System/Info/SystemInfoLayout',
'System/Logs/LogsLayout', 'System/Logs/LogsLayout',
'System/Update/UpdateLayout', 'System/Update/UpdateLayout'
'System/DiskSpace/DiskSpaceLayout'
], function (Backbone, ], function (Backbone,
Marionette, Marionette,
AboutView, SystemInfoLayout,
LogsLayout, LogsLayout,
UpdateLayout, UpdateLayout) {
DiskSpaceLayout) {
return Marionette.Layout.extend({ return Marionette.Layout.extend({
template: 'System/SystemLayoutTemplate', template: 'System/SystemLayoutTemplate',
regions: { regions: {
about : '#about', info : '#info',
logs : '#logs', logs : '#logs',
updates: '#updates', updates: '#updates'
diskSpace: '#diskspace'
}, },
ui: { ui: {
aboutTab : '.x-about-tab', infoTab : '.x-info-tab',
logsTab : '.x-logs-tab', logsTab : '.x-logs-tab',
updatesTab: '.x-updates-tab', updatesTab: '.x-updates-tab'
diskSpaceTab: '.x-diskspace-tab'
}, },
events: { events: {
'click .x-about-tab' : '_showAbout', 'click .x-info-tab' : '_showInfo',
'click .x-logs-tab' : '_showLogs', 'click .x-logs-tab' : '_showLogs',
'click .x-updates-tab': '_showUpdates', 'click .x-updates-tab': '_showUpdates'
'click .x-diskspace-tab':'_showDiskSpace'
}, },
initialize: function (options) { initialize: function (options) {
@ -51,10 +46,8 @@ define(
case 'updates': case 'updates':
this._showUpdates(); this._showUpdates();
break; break;
case 'diskspace':
this._showDiskSpace();
default: default:
this._showAbout(); this._showInfo();
} }
}, },
@ -62,14 +55,14 @@ define(
Backbone.history.navigate(route); Backbone.history.navigate(route);
}, },
_showAbout: function (e) { _showInfo: function (e) {
if (e) { if (e) {
e.preventDefault(); e.preventDefault();
} }
this.about.show(new AboutView()); this.info.show(new SystemInfoLayout());
this.ui.aboutTab.tab('show'); this.ui.infoTab.tab('show');
this._navigate('system/about'); this._navigate('system/info');
}, },
_showLogs: function (e) { _showLogs: function (e) {
@ -90,14 +83,6 @@ define(
this.updates.show(new UpdateLayout()); this.updates.show(new UpdateLayout());
this.ui.updatesTab.tab('show'); this.ui.updatesTab.tab('show');
this._navigate('system/updates'); this._navigate('system/updates');
},
_showDiskSpace: function (e) {
if (e) {
e.preventDefault();
}
this.diskSpace.show(new DiskSpaceLayout());
this.ui.diskSpaceTab.tab('show');
this._navigate("system/diskspace");
} }
}); });
}); });

View File

@ -1,13 +1,11 @@
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li><a href="#about" class="x-about-tab no-router">About</a></li> <li><a href="#info" class="x-info-tab no-router">Info</a></li>
<li><a href="#logs" class="x-logs-tab no-router">Logs</a></li> <li><a href="#logs" class="x-logs-tab no-router">Logs</a></li>
<li><a href="#updates" class="x-updates-tab no-router">Updates</a></li> <li><a href="#updates" class="x-updates-tab no-router">Updates</a></li>
<li><a href="#diskspace" class="x-diskspace-tab no-router">Disk Space</a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<div class="tab-pane" id="about"></div> <div class="tab-pane" id="info"></div>
<div class="tab-pane" id="logs"></div> <div class="tab-pane" id="logs"></div>
<div class="tab-pane" id="updates"></div> <div class="tab-pane" id="updates"></div>
<div class="tab-pane" id="diskspace"></div>
</div> </div>