From 4510ca8fa1fb5f79fd5cb51344503987b971b1bf Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 11 Oct 2013 15:53:27 -0700 Subject: [PATCH 1/4] Added git attributes file to force LF endings --- .gitattributes | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..1b274cb93 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,22 @@ +# Auto detect text files and perform LF normalization +*text eol=lf + +# Custom for Visual Studio +*.cs diff=csharp +*.sln merge=union +*.csproj merge=union +*.vbproj merge=union +*.fsproj merge=union +*.dbproj merge=union + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain \ No newline at end of file From 041e767f3dc5f27e9b15b79021839c3b9644c83c Mon Sep 17 00:00:00 2001 From: fzr600dave Date: Thu, 10 Oct 2013 23:31:44 +0100 Subject: [PATCH 2/4] Added Disk space information to system. (cherry picked from commit 91625019378247b1c6ab85afaee23f2855e3298b) --- src/NzbDrone.Api/DiskSpace/DiskSpaceModule.cs | 43 ++++++++++++++ .../DiskSpace/DiskSpaceResource.cs | 15 +++++ src/NzbDrone.Api/NzbDrone.Api.csproj | 2 + .../System/DiskSpace/DiskSpaceCollection.js | 8 +++ src/UI/System/DiskSpace/DiskSpaceLayout.js | 59 +++++++++++++++++++ src/UI/System/DiskSpace/DiskSpaceModel.js | 6 ++ .../System/DiskSpace/DiskSpaceTemplate.html | 5 ++ src/UI/System/SystemLayout.js | 25 ++++++-- src/UI/System/SystemLayoutTemplate.html | 2 + 9 files changed, 160 insertions(+), 5 deletions(-) create mode 100644 src/NzbDrone.Api/DiskSpace/DiskSpaceModule.cs create mode 100644 src/NzbDrone.Api/DiskSpace/DiskSpaceResource.cs create mode 100644 src/UI/System/DiskSpace/DiskSpaceCollection.js create mode 100644 src/UI/System/DiskSpace/DiskSpaceLayout.js create mode 100644 src/UI/System/DiskSpace/DiskSpaceModel.js create mode 100644 src/UI/System/DiskSpace/DiskSpaceTemplate.html diff --git a/src/NzbDrone.Api/DiskSpace/DiskSpaceModule.cs b/src/NzbDrone.Api/DiskSpace/DiskSpaceModule.cs new file mode 100644 index 000000000..98c16934f --- /dev/null +++ b/src/NzbDrone.Api/DiskSpace/DiskSpaceModule.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; + +namespace NzbDrone.Api.DiskSpace +{ + public class DiskSpaceModule :NzbDroneRestModule + { + public DiskSpaceModule():base("diskspace") + { + GetResourceAll = GetFreeSpace; + } + public List GetFreeSpace() + { + return (DriveInfo.GetDrives() + .Where(driveInfo => driveInfo.DriveType == DriveType.Fixed) + .Select( + driveInfo => + new DiskSpaceResource() + { + DriveLetter = driveInfo.Name, + FreeSpace = SizeSuffix(driveInfo.TotalFreeSpace), + TotalSpace = SizeSuffix(driveInfo.TotalSize) + })).ToList(); + } + + static string SizeSuffix(Int64 value) + { + string[] suffixes = { "bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" }; + int i = 0; + decimal dValue = (decimal)value; + while (Math.Round(dValue / 1024) >= 1) + { + dValue /= 1024; + i++; + } + + return string.Format("{0:n1}{1}", dValue, suffixes[i]); + } + } +} diff --git a/src/NzbDrone.Api/DiskSpace/DiskSpaceResource.cs b/src/NzbDrone.Api/DiskSpace/DiskSpaceResource.cs new file mode 100644 index 000000000..8d3796051 --- /dev/null +++ b/src/NzbDrone.Api/DiskSpace/DiskSpaceResource.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using NzbDrone.Api.REST; + +namespace NzbDrone.Api.DiskSpace +{ + public class DiskSpaceResource : RestResource + { + public string DriveLetter { get; set; } + public string FreeSpace { get; set; } + public string TotalSpace { get; set; } + } +} diff --git a/src/NzbDrone.Api/NzbDrone.Api.csproj b/src/NzbDrone.Api/NzbDrone.Api.csproj index 7b885fe48..e7ebe0bbe 100644 --- a/src/NzbDrone.Api/NzbDrone.Api.csproj +++ b/src/NzbDrone.Api/NzbDrone.Api.csproj @@ -87,6 +87,8 @@ + + diff --git a/src/UI/System/DiskSpace/DiskSpaceCollection.js b/src/UI/System/DiskSpace/DiskSpaceCollection.js new file mode 100644 index 000000000..27fb20225 --- /dev/null +++ b/src/UI/System/DiskSpace/DiskSpaceCollection.js @@ -0,0 +1,8 @@ +'use strict'; +define(['backbone', 'System/DiskSpace/DiskSpaceModel'], +function(Backbone, DiskSpaceModel) { + return Backbone.Collection.extend({ + url:window.NzbDrone.ApiRoot +'/diskspace', + model: DiskSpaceModel + }); +}); \ No newline at end of file diff --git a/src/UI/System/DiskSpace/DiskSpaceLayout.js b/src/UI/System/DiskSpace/DiskSpaceLayout.js new file mode 100644 index 000000000..1db1049fd --- /dev/null +++ b/src/UI/System/DiskSpace/DiskSpaceLayout.js @@ -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' + })); + } + }); +}); \ No newline at end of file diff --git a/src/UI/System/DiskSpace/DiskSpaceModel.js b/src/UI/System/DiskSpace/DiskSpaceModel.js new file mode 100644 index 000000000..1e80926fc --- /dev/null +++ b/src/UI/System/DiskSpace/DiskSpaceModel.js @@ -0,0 +1,6 @@ +'use strict'; +define(['backbone'], function (Backbone) { + return Backbone.Model.extend({ + + }); +}); \ No newline at end of file diff --git a/src/UI/System/DiskSpace/DiskSpaceTemplate.html b/src/UI/System/DiskSpace/DiskSpaceTemplate.html new file mode 100644 index 000000000..f640d03e9 --- /dev/null +++ b/src/UI/System/DiskSpace/DiskSpaceTemplate.html @@ -0,0 +1,5 @@ +
+
+
+
+
\ No newline at end of file diff --git a/src/UI/System/SystemLayout.js b/src/UI/System/SystemLayout.js index 7aca9042f..431f55e3b 100644 --- a/src/UI/System/SystemLayout.js +++ b/src/UI/System/SystemLayout.js @@ -5,31 +5,36 @@ define( 'marionette', 'System/About/AboutView', 'System/Logs/LogsLayout', - 'System/Update/UpdateLayout' + 'System/Update/UpdateLayout', + 'System/DiskSpace/DiskSpaceLayout' ], function (Backbone, Marionette, AboutView, LogsLayout, - UpdateLayout) { + UpdateLayout, + DiskSpaceLayout) { return Marionette.Layout.extend({ template: 'System/SystemLayoutTemplate', regions: { about : '#about', logs : '#logs', - updates : '#updates' + updates: '#updates', + diskSpace: '#diskspace' }, ui: { aboutTab : '.x-about-tab', logsTab : '.x-logs-tab', - updatesTab: '.x-updates-tab' + updatesTab: '.x-updates-tab', + diskSpaceTab: '.x-diskspace-tab' }, events: { 'click .x-about-tab' : '_showAbout', 'click .x-logs-tab' : '_showLogs', - 'click .x-updates-tab': '_showUpdates' + 'click .x-updates-tab': '_showUpdates', + 'click .x-diskspace-tab':'_showDiskSpace' }, initialize: function (options) { @@ -46,6 +51,8 @@ define( case 'updates': this._showUpdates(); break; + case 'diskspace': + this._showDiskSpace(); default: this._showAbout(); } @@ -83,6 +90,14 @@ define( this.updates.show(new UpdateLayout()); this.ui.updatesTab.tab('show'); 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"); } }); }); diff --git a/src/UI/System/SystemLayoutTemplate.html b/src/UI/System/SystemLayoutTemplate.html index bddcf83b0..3eb712314 100644 --- a/src/UI/System/SystemLayoutTemplate.html +++ b/src/UI/System/SystemLayoutTemplate.html @@ -2,10 +2,12 @@
  • About
  • Logs
  • Updates
  • +
  • Disk Space
  • +
    \ No newline at end of file From 6c414929c3700c5b059470434ac939a52513ac5d Mon Sep 17 00:00:00 2001 From: fzr600dave Date: Fri, 11 Oct 2013 09:49:03 +0100 Subject: [PATCH 3/4] Updated as per markus request for viewing disk space Added two methods to Diskprovider:- getFixedDrives, getTotalSize and letting UI decide on how to display space. and changed from vent to listenTo (cherry picked from commit 5aa00cfb6498d4731d5d880c346afe747a61024e) --- src/NzbDrone.Api/DiskSpace/DiskSpaceModule.cs | 18 +++++++++------ .../DiskSpace/DiskSpaceResource.cs | 4 ++-- src/NzbDrone.Common/DiskProvider.cs | 12 ++++++++++ src/UI/System/DiskSpace/DiskSpaceLayout.js | 22 +++++++++---------- 4 files changed, 35 insertions(+), 21 deletions(-) diff --git a/src/NzbDrone.Api/DiskSpace/DiskSpaceModule.cs b/src/NzbDrone.Api/DiskSpace/DiskSpaceModule.cs index 98c16934f..0126d84fd 100644 --- a/src/NzbDrone.Api/DiskSpace/DiskSpaceModule.cs +++ b/src/NzbDrone.Api/DiskSpace/DiskSpaceModule.cs @@ -3,26 +3,30 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; +using NzbDrone.Common; namespace NzbDrone.Api.DiskSpace { public class DiskSpaceModule :NzbDroneRestModule { - public DiskSpaceModule():base("diskspace") + private readonly IDiskProvider _diskProvider; + + public DiskSpaceModule(IDiskProvider diskProvider):base("diskspace") { + _diskProvider = diskProvider; GetResourceAll = GetFreeSpace; } + public List GetFreeSpace() { - return (DriveInfo.GetDrives() - .Where(driveInfo => driveInfo.DriveType == DriveType.Fixed) + return (_diskProvider.GetFixedDrives() .Select( - driveInfo => + x => new DiskSpaceResource() { - DriveLetter = driveInfo.Name, - FreeSpace = SizeSuffix(driveInfo.TotalFreeSpace), - TotalSpace = SizeSuffix(driveInfo.TotalSize) + DriveLetter = x, + FreeSpace = _diskProvider.GetAvailableSpace(x).Value, + TotalSpace = _diskProvider.GetTotalSize(x).Value })).ToList(); } diff --git a/src/NzbDrone.Api/DiskSpace/DiskSpaceResource.cs b/src/NzbDrone.Api/DiskSpace/DiskSpaceResource.cs index 8d3796051..261ae6305 100644 --- a/src/NzbDrone.Api/DiskSpace/DiskSpaceResource.cs +++ b/src/NzbDrone.Api/DiskSpace/DiskSpaceResource.cs @@ -9,7 +9,7 @@ namespace NzbDrone.Api.DiskSpace public class DiskSpaceResource : RestResource { public string DriveLetter { get; set; } - public string FreeSpace { get; set; } - public string TotalSpace { get; set; } + public Int64 FreeSpace { get; set; } + public Int64 TotalSpace { get; set; } } } diff --git a/src/NzbDrone.Common/DiskProvider.cs b/src/NzbDrone.Common/DiskProvider.cs index 5860d95cd..a075b5e10 100644 --- a/src/NzbDrone.Common/DiskProvider.cs +++ b/src/NzbDrone.Common/DiskProvider.cs @@ -42,6 +42,8 @@ namespace NzbDrone.Common void SetFolderWriteTime(string path, DateTime time); FileAttributes GetFileAttributes(string path); void EmptyFolder(string path); + string[] GetFixedDrives(); + long? GetTotalSize(string path); } public class DiskProvider : IDiskProvider @@ -475,5 +477,15 @@ namespace NzbDrone.Common DeleteFolder(directory, true); } } + + public string[] GetFixedDrives() + { + return (DriveInfo.GetDrives().Where(x => x.DriveType == DriveType.Fixed).Select(x => x.Name)).ToArray(); + } + + public long? GetTotalSize(string path) + { + return (DriveInfo.GetDrives().Single(x => x.Name == path)).TotalSize; + } } } \ No newline at end of file diff --git a/src/UI/System/DiskSpace/DiskSpaceLayout.js b/src/UI/System/DiskSpace/DiskSpaceLayout.js index 1db1049fd..63c03aa43 100644 --- a/src/UI/System/DiskSpace/DiskSpaceLayout.js +++ b/src/UI/System/DiskSpace/DiskSpaceLayout.js @@ -4,8 +4,9 @@ define([ 'marionette', 'backgrid', 'System/DiskSpace/DiskSpaceCollection', - 'Shared/LoadingView' -], function (vent,Marionette,Backgrid,DiskSpaceCollection,LoadingView) { + 'Shared/LoadingView', + 'Cells/FileSizeCell' +], function (vent,Marionette,Backgrid,DiskSpaceCollection,LoadingView,FileSizeCell) { return Marionette.Layout.extend({ template: 'System/DiskSpace/DiskSpaceTemplate', @@ -17,35 +18,32 @@ define([ { name: 'driveLetter', label: 'Drive', - cell: Backgrid.StringCell + cell: 'string' }, { name: 'freeSpace', label: 'Free Space', - cell: Backgrid.StringCell + cell: FileSizeCell, + sortable:true }, { name: 'totalSpace', label: 'Total Space', - cell: Backgrid.StringCell + cell: FileSizeCell, + sortable:true } ], initialize: function () { this.collection = new DiskSpaceCollection(); - this.collectionPromise = this.collection.fetch(); - - vent.on(vent.Events.CommandComplete, this._commandComplete, this); + this.listenTo(this.collection, 'sync', this._showTable); }, onRender : function() { this.grid.show(new LoadingView()); }, onShow: function() { - var self = this; - this.collectionPromise.done(function() { - self._showTable(); - }); + this.collection.fetch(); }, _showTable: function() { this.grid.show(new Backgrid.Grid({ From 43a70f4479bde11b633f43d1747c3d05680a35b6 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 11 Oct 2013 16:18:04 -0700 Subject: [PATCH 4/4] Moved disk space and about to new info tab New: Disk space visible in the UI under System Info --- src/UI/Mixins/jquery.ajax.js | 2 +- src/UI/System/About/AboutViewTemplate.html | 8 ---- .../System/DiskSpace/DiskSpaceTemplate.html | 5 --- src/UI/System/{ => Info}/About/AboutView.js | 2 +- .../System/Info/About/AboutViewTemplate.html | 13 ++++++ .../DiskSpace/DiskSpaceCollection.js | 2 +- .../{ => Info}/DiskSpace/DiskSpaceLayout.js | 4 +- .../DiskSpace/DiskSpaceLayoutTemplate.html | 5 +++ .../{ => Info}/DiskSpace/DiskSpaceModel.js | 0 src/UI/System/Info/SystemInfoLayout.js | 26 +++++++++++ .../System/Info/SystemInfoLayoutTemplate.html | 7 +++ src/UI/System/SystemLayout.js | 45 +++++++------------ src/UI/System/SystemLayoutTemplate.html | 6 +-- 13 files changed, 73 insertions(+), 52 deletions(-) delete mode 100644 src/UI/System/About/AboutViewTemplate.html delete mode 100644 src/UI/System/DiskSpace/DiskSpaceTemplate.html rename src/UI/System/{ => Info}/About/AboutView.js (82%) create mode 100644 src/UI/System/Info/About/AboutViewTemplate.html rename src/UI/System/{ => Info}/DiskSpace/DiskSpaceCollection.js (74%) rename src/UI/System/{ => Info}/DiskSpace/DiskSpaceLayout.js (92%) create mode 100644 src/UI/System/Info/DiskSpace/DiskSpaceLayoutTemplate.html rename src/UI/System/{ => Info}/DiskSpace/DiskSpaceModel.js (100%) create mode 100644 src/UI/System/Info/SystemInfoLayout.js create mode 100644 src/UI/System/Info/SystemInfoLayoutTemplate.html diff --git a/src/UI/Mixins/jquery.ajax.js b/src/UI/Mixins/jquery.ajax.js index 0a932e6c2..0fe0b047f 100644 --- a/src/UI/Mixins/jquery.ajax.js +++ b/src/UI/Mixins/jquery.ajax.js @@ -22,7 +22,7 @@ define( delete xhr.data; } - + if (xhr) { xhr.headers = xhr.headers || {}; xhr.headers.Authorization = window.NzbDrone.ApiKey; diff --git a/src/UI/System/About/AboutViewTemplate.html b/src/UI/System/About/AboutViewTemplate.html deleted file mode 100644 index efe394569..000000000 --- a/src/UI/System/About/AboutViewTemplate.html +++ /dev/null @@ -1,8 +0,0 @@ -
    -
    Version
    -
    {{version}}
    -
    AppData directory
    -
    {{appData}}
    -
    Startup directory
    -
    {{startupPath}}
    -
    diff --git a/src/UI/System/DiskSpace/DiskSpaceTemplate.html b/src/UI/System/DiskSpace/DiskSpaceTemplate.html deleted file mode 100644 index f640d03e9..000000000 --- a/src/UI/System/DiskSpace/DiskSpaceTemplate.html +++ /dev/null @@ -1,5 +0,0 @@ -
    -
    -
    -
    -
    \ No newline at end of file diff --git a/src/UI/System/About/AboutView.js b/src/UI/System/Info/About/AboutView.js similarity index 82% rename from src/UI/System/About/AboutView.js rename to src/UI/System/Info/About/AboutView.js index f87b8758e..b1133db1a 100644 --- a/src/UI/System/About/AboutView.js +++ b/src/UI/System/Info/About/AboutView.js @@ -5,7 +5,7 @@ define( 'System/StatusModel' ], function (Marionette, StatusModel) { return Marionette.ItemView.extend({ - template: 'System/About/AboutViewTemplate', + template: 'System/Info/About/AboutViewTemplate', initialize: function () { this.model = StatusModel; diff --git a/src/UI/System/Info/About/AboutViewTemplate.html b/src/UI/System/Info/About/AboutViewTemplate.html new file mode 100644 index 000000000..57c32bc4e --- /dev/null +++ b/src/UI/System/Info/About/AboutViewTemplate.html @@ -0,0 +1,13 @@ +
    + About + +
    +
    Version
    +
    {{version}}
    +
    AppData directory
    +
    {{appData}}
    +
    Startup directory
    +
    {{startupPath}}
    +
    +
    + diff --git a/src/UI/System/DiskSpace/DiskSpaceCollection.js b/src/UI/System/Info/DiskSpace/DiskSpaceCollection.js similarity index 74% rename from src/UI/System/DiskSpace/DiskSpaceCollection.js rename to src/UI/System/Info/DiskSpace/DiskSpaceCollection.js index 27fb20225..b65238704 100644 --- a/src/UI/System/DiskSpace/DiskSpaceCollection.js +++ b/src/UI/System/Info/DiskSpace/DiskSpaceCollection.js @@ -1,5 +1,5 @@ 'use strict'; -define(['backbone', 'System/DiskSpace/DiskSpaceModel'], +define(['backbone', 'System/Info/DiskSpace/DiskSpaceModel'], function(Backbone, DiskSpaceModel) { return Backbone.Collection.extend({ url:window.NzbDrone.ApiRoot +'/diskspace', diff --git a/src/UI/System/DiskSpace/DiskSpaceLayout.js b/src/UI/System/Info/DiskSpace/DiskSpaceLayout.js similarity index 92% rename from src/UI/System/DiskSpace/DiskSpaceLayout.js rename to src/UI/System/Info/DiskSpace/DiskSpaceLayout.js index 63c03aa43..9a8ef6026 100644 --- a/src/UI/System/DiskSpace/DiskSpaceLayout.js +++ b/src/UI/System/Info/DiskSpace/DiskSpaceLayout.js @@ -3,12 +3,12 @@ define([ 'vent', 'marionette', 'backgrid', - 'System/DiskSpace/DiskSpaceCollection', + 'System/Info/DiskSpace/DiskSpaceCollection', 'Shared/LoadingView', 'Cells/FileSizeCell' ], function (vent,Marionette,Backgrid,DiskSpaceCollection,LoadingView,FileSizeCell) { return Marionette.Layout.extend({ - template: 'System/DiskSpace/DiskSpaceTemplate', + template: 'System/Info/DiskSpace/DiskSpaceLayoutTemplate', regions: { grid: '#x-grid' diff --git a/src/UI/System/Info/DiskSpace/DiskSpaceLayoutTemplate.html b/src/UI/System/Info/DiskSpace/DiskSpaceLayoutTemplate.html new file mode 100644 index 000000000..6cf4d34e3 --- /dev/null +++ b/src/UI/System/Info/DiskSpace/DiskSpaceLayoutTemplate.html @@ -0,0 +1,5 @@ +
    + Disk Space + +
    +
    \ No newline at end of file diff --git a/src/UI/System/DiskSpace/DiskSpaceModel.js b/src/UI/System/Info/DiskSpace/DiskSpaceModel.js similarity index 100% rename from src/UI/System/DiskSpace/DiskSpaceModel.js rename to src/UI/System/Info/DiskSpace/DiskSpaceModel.js diff --git a/src/UI/System/Info/SystemInfoLayout.js b/src/UI/System/Info/SystemInfoLayout.js new file mode 100644 index 000000000..e415c6d8d --- /dev/null +++ b/src/UI/System/Info/SystemInfoLayout.js @@ -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()); + } + }); + }); + diff --git a/src/UI/System/Info/SystemInfoLayoutTemplate.html b/src/UI/System/Info/SystemInfoLayoutTemplate.html new file mode 100644 index 000000000..74ba09bf2 --- /dev/null +++ b/src/UI/System/Info/SystemInfoLayoutTemplate.html @@ -0,0 +1,7 @@ +
    +
    +
    + +
    +
    +
    \ No newline at end of file diff --git a/src/UI/System/SystemLayout.js b/src/UI/System/SystemLayout.js index 431f55e3b..29c06d43b 100644 --- a/src/UI/System/SystemLayout.js +++ b/src/UI/System/SystemLayout.js @@ -3,38 +3,33 @@ define( [ 'backbone', 'marionette', - 'System/About/AboutView', + 'System/Info/SystemInfoLayout', 'System/Logs/LogsLayout', - 'System/Update/UpdateLayout', - 'System/DiskSpace/DiskSpaceLayout' + 'System/Update/UpdateLayout' ], function (Backbone, Marionette, - AboutView, + SystemInfoLayout, LogsLayout, - UpdateLayout, - DiskSpaceLayout) { + UpdateLayout) { return Marionette.Layout.extend({ template: 'System/SystemLayoutTemplate', regions: { - about : '#about', + info : '#info', logs : '#logs', - updates: '#updates', - diskSpace: '#diskspace' + updates: '#updates' }, ui: { - aboutTab : '.x-about-tab', + infoTab : '.x-info-tab', logsTab : '.x-logs-tab', - updatesTab: '.x-updates-tab', - diskSpaceTab: '.x-diskspace-tab' + updatesTab: '.x-updates-tab' }, events: { - 'click .x-about-tab' : '_showAbout', + 'click .x-info-tab' : '_showInfo', 'click .x-logs-tab' : '_showLogs', - 'click .x-updates-tab': '_showUpdates', - 'click .x-diskspace-tab':'_showDiskSpace' + 'click .x-updates-tab': '_showUpdates' }, initialize: function (options) { @@ -51,10 +46,8 @@ define( case 'updates': this._showUpdates(); break; - case 'diskspace': - this._showDiskSpace(); default: - this._showAbout(); + this._showInfo(); } }, @@ -62,14 +55,14 @@ define( Backbone.history.navigate(route); }, - _showAbout: function (e) { + _showInfo: function (e) { if (e) { e.preventDefault(); } - this.about.show(new AboutView()); - this.ui.aboutTab.tab('show'); - this._navigate('system/about'); + this.info.show(new SystemInfoLayout()); + this.ui.infoTab.tab('show'); + this._navigate('system/info'); }, _showLogs: function (e) { @@ -90,14 +83,6 @@ define( this.updates.show(new UpdateLayout()); this.ui.updatesTab.tab('show'); 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"); } }); }); diff --git a/src/UI/System/SystemLayoutTemplate.html b/src/UI/System/SystemLayoutTemplate.html index 3eb712314..d95a3996b 100644 --- a/src/UI/System/SystemLayoutTemplate.html +++ b/src/UI/System/SystemLayoutTemplate.html @@ -1,13 +1,11 @@ 
    -
    +
    -
    \ No newline at end of file