New: Backup drone's database and configuration from the UI
New: Download Backup files from the UI

Fixed: Run a database backup before upgrade
This commit is contained in:
Mark McDowall
2014-05-30 10:34:38 -07:00
parent d74e461aea
commit c5bd8b27fb
32 changed files with 552 additions and 27 deletions

View File

@@ -7,6 +7,7 @@ define(
'System/Info/SystemInfoLayout',
'System/Logs/LogsLayout',
'System/Update/UpdateLayout',
'System/Backup/BackupLayout',
'Shared/Messenger'
], function ($,
Backbone,
@@ -14,26 +15,30 @@ define(
SystemInfoLayout,
LogsLayout,
UpdateLayout,
BackupLayout,
Messenger) {
return Marionette.Layout.extend({
template: 'System/SystemLayoutTemplate',
regions: {
info : '#info',
info : '#info',
logs : '#logs',
updates: '#updates'
updates : '#updates',
backup : '#backup'
},
ui: {
infoTab : '.x-info-tab',
logsTab : '.x-logs-tab',
updatesTab: '.x-updates-tab'
infoTab : '.x-info-tab',
logsTab : '.x-logs-tab',
updatesTab : '.x-updates-tab',
backupTab : '.x-backup-tab'
},
events: {
'click .x-info-tab' : '_showInfo',
'click .x-logs-tab' : '_showLogs',
'click .x-updates-tab': '_showUpdates',
'click .x-backup-tab': '_showBackup',
'click .x-shutdown' : '_shutdown',
'click .x-restart' : '_restart'
},
@@ -52,6 +57,9 @@ define(
case 'updates':
this._showUpdates();
break;
case 'backup':
this._showBackup();
break;
default:
this._showInfo();
}
@@ -91,6 +99,16 @@ define(
this._navigate('system/updates');
},
_showBackup: function (e) {
if (e) {
e.preventDefault();
}
this.backup.show(new BackupLayout());
this.ui.backupTab.tab('show');
this._navigate('system/backup');
},
_shutdown: function () {
$.ajax({
url: window.NzbDrone.ApiRoot + '/system/shutdown',