mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-05 17:43:37 +00:00
Remove Config/Backup & Restore.
This commit is contained in:
parent
60848297ab
commit
c19fc37051
5 changed files with 1 additions and 177 deletions
|
@ -17,6 +17,7 @@
|
|||
* Add database migration code
|
||||
* Change KickassTorrents provider URLs
|
||||
* Fix missing Content-Type headers for posters and banners
|
||||
* Remove config Backup & Restore
|
||||
|
||||
[develop changelog]
|
||||
* Add TVRage network name standardization
|
||||
|
|
|
@ -1,102 +0,0 @@
|
|||
#import os.path
|
||||
#import datetime
|
||||
#import locale
|
||||
#import sickbeard
|
||||
#from sickbeard.common import *
|
||||
#from sickbeard.sbdatetime import *
|
||||
#from sickbeard import config
|
||||
#from sickbeard import metadata
|
||||
#from sickbeard.metadata.generic import GenericMetadata
|
||||
#set global $title = "Config - Backup/Restore"
|
||||
#set global $header = "Backup/Restore"
|
||||
|
||||
#set global $sbPath="../.."
|
||||
|
||||
#set global $topmenu="config"#
|
||||
#include $os.path.join($sickbeard.PROG_DIR, "gui/slick/interfaces/default/inc_top.tmpl")
|
||||
|
||||
<script type="text/javascript" src="$sbRoot/js/configBackupRestore.js?$sbPID"></script>
|
||||
|
||||
#if $varExists('header')
|
||||
<h1 class="header">$header</h1>
|
||||
#else
|
||||
<h1 class="title">$title</h1>
|
||||
#end if
|
||||
|
||||
#set $indexer = 0
|
||||
#if $sickbeard.INDEXER_DEFAULT
|
||||
#set $indexer = $sickbeard.INDEXER_DEFAULT
|
||||
#end if
|
||||
|
||||
<script type="text/javascript" src="$sbRoot/js/config.js?$sbPID"></script>
|
||||
|
||||
<div id="config">
|
||||
<div id="config-content">
|
||||
|
||||
<form name="configForm" method="post" action="backuprestore">
|
||||
<div id="config-components">
|
||||
<ul>
|
||||
<li><a href="#core-component-group1">Backup</a></li>
|
||||
<li><a href="#core-component-group2">Restore</a></li>
|
||||
</ul>
|
||||
|
||||
<div id="core-component-group1" class="component-group clearfix">
|
||||
<div class="component-group-desc">
|
||||
<h3>Backup</h3>
|
||||
<p><b>Backup your main database file and config.</b></p>
|
||||
</div>
|
||||
|
||||
<fieldset class="component-group-list">
|
||||
<div class="field-pair">
|
||||
Select the folder you wish to save your backup file to:
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<input type="text" name="backupDir" id="backupDir" class="form-control input-sm input350" />
|
||||
<input class="btn btn-inline" type="button" value="Backup" id="Backup" />
|
||||
|
||||
<br/>
|
||||
|
||||
</div>
|
||||
<div class="Backup" id="Backup-result"></div>
|
||||
</fieldset>
|
||||
|
||||
</div><!-- /component-group1 //-->
|
||||
|
||||
<div id="core-component-group2" class="component-group clearfix">
|
||||
<div class="component-group-desc">
|
||||
<h3>Restore</h3>
|
||||
<p><b>Restore your main database file and config.</b></p>
|
||||
</div>
|
||||
|
||||
<fieldset class="component-group-list">
|
||||
<div class="field-pair">
|
||||
Select the backup file you wish to restore:
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<input type="text" name="backupFile" id="backupFile" class="form-control input-sm input350" />
|
||||
<input class="btn btn-inline" type="button" value="Restore" id="Restore" />
|
||||
|
||||
<br/>
|
||||
|
||||
</div>
|
||||
<div class="Restore" id="Restore-result"></div>
|
||||
</fieldset>
|
||||
</div><!-- /component-group2 //-->
|
||||
</div><!-- /config-components -->
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
<!--
|
||||
jQuery('#backupDir').fileBrowser({ title: 'Select backup folder to save to', key: 'backupPath' });
|
||||
jQuery('#backupFile').fileBrowser({ title: 'Select backup files to restore', key: 'backupFile', includeFiles: 1 });
|
||||
jQuery('#config-components').tabs();
|
||||
//-->
|
||||
</script>
|
||||
|
||||
#include $os.path.join($sickbeard.PROG_DIR,"gui/slick/interfaces/default/inc_bottom.tmpl")
|
|
@ -98,7 +98,6 @@
|
|||
\$("#SubMenu a:contains('Anime')").addClass('btn').html('<span class="submenu-icon-anime pull-left"></span> Anime');
|
||||
\$("#SubMenu a:contains('Settings')").addClass('btn').html('<span class="ui-icon ui-icon-search pull-left"></span> Search Settings');
|
||||
\$("#SubMenu a:contains('Provider')").addClass('btn').html('<span class="ui-icon ui-icon-search pull-left"></span> Search Providers');
|
||||
\$("#SubMenu a:contains('Backup/Restore')").addClass('btn').html('<span class="ui-icon ui-icon-gear pull-left"></span> Backup/Restore');
|
||||
\$("#SubMenu a:contains('General')").addClass('btn').html('<span class="ui-icon ui-icon-gear pull-left"></span> General');
|
||||
\$("#SubMenu a:contains('Episode Status')").addClass('btn').html('<span class="ui-icon ui-icon-transferthick-e-w pull-left"></span> Episode Status Management');
|
||||
\$("#SubMenu a:contains('Missed Subtitle')").addClass('btn').html('<span class="ui-icon ui-icon-transferthick-e-w pull-left"></span> Missed Subtitles');
|
||||
|
@ -198,7 +197,6 @@
|
|||
<ul class="dropdown-menu">
|
||||
<li><a href="$sbRoot/config/" tabindex="$tab#set $tab += 1#"><i class="menu-icon-help"></i> Help & Info</a></li>
|
||||
<li><a href="$sbRoot/config/general/" tabindex="$tab#set $tab += 1#"><i class="menu-icon-config"></i> General</a></li>
|
||||
<li><a href="$sbRoot/config/backuprestore/" tabindex="$tab#set $tab += 1#"><i class="menu-icon-config"></i> Backup & Restore</a></li>
|
||||
<li><a href="$sbRoot/config/search/" tabindex="$tab#set $tab += 1#"><i class="menu-icon-config"></i> Search Settings</a></li>
|
||||
<li><a href="$sbRoot/config/providers/" tabindex="$tab#set $tab += 1#"><i class="menu-icon-config"></i> Search Providers</a></li>
|
||||
<li><a href="$sbRoot/config/subtitles/" tabindex="$tab#set $tab += 1#"><i class="menu-icon-config"></i> Subtitles Settings</a></li>
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
$(document).ready(function(){
|
||||
var loading = '<img src="' + sbRoot + '/images/loading16' + themeSpinner + '.gif" height="16" width="16" />';
|
||||
|
||||
$('#Backup').click(function() {
|
||||
$("#Backup").attr("disabled", true);
|
||||
$('#Backup-result').html(loading);
|
||||
var backupDir = $("#backupDir").val();
|
||||
$.get(sbRoot + "/config/backup", {'backupDir': backupDir})
|
||||
.done(function (data) {
|
||||
$('#Backup-result').html(data);
|
||||
$("#Backup").attr("disabled", false);
|
||||
});
|
||||
});
|
||||
$('#Restore').click(function() {
|
||||
$("#Restore").attr("disabled", true);
|
||||
$('#Restore-result').html(loading);
|
||||
var backupFile = $("#backupFile").val();
|
||||
$.get(sbRoot + "/config/restore", {'backupFile': backupFile})
|
||||
.done(function (data) {
|
||||
$('#Restore-result').html(data);
|
||||
$("#Restore").attr("disabled", false);
|
||||
});
|
||||
});
|
||||
});
|
|
@ -1452,7 +1452,6 @@ class History(MainHandler):
|
|||
|
||||
ConfigMenu = [
|
||||
{'title': 'General', 'path': 'config/general/'},
|
||||
{'title': 'Backup/Restore', 'path': 'config/backuprestore/'},
|
||||
{'title': 'Search Settings', 'path': 'config/search/'},
|
||||
{'title': 'Search Providers', 'path': 'config/providers/'},
|
||||
{'title': 'Subtitles Settings', 'path': 'config/subtitles/'},
|
||||
|
@ -1618,53 +1617,6 @@ class ConfigGeneral(MainHandler):
|
|||
redirect("/config/general/")
|
||||
|
||||
|
||||
class ConfigBackupRestore(MainHandler):
|
||||
def index(self, *args, **kwargs):
|
||||
t = PageTemplate(headers=self.request.headers, file="config_backuprestore.tmpl")
|
||||
t.submenu = ConfigMenu
|
||||
return _munge(t)
|
||||
|
||||
def backup(self, backupDir=None):
|
||||
|
||||
finalResult = ''
|
||||
|
||||
if backupDir:
|
||||
source = [os.path.join(sickbeard.DATA_DIR, 'sickbeard.db'), sickbeard.CONFIG_FILE]
|
||||
target = os.path.join(backupDir, 'SickGear-' + time.strftime('%Y%m%d%H%M%S') + '.zip')
|
||||
|
||||
if helpers.makeZip(source, target):
|
||||
finalResult += "Successful backup to " + target
|
||||
else:
|
||||
finalResult += "Backup FAILED"
|
||||
else:
|
||||
finalResult += "You need to choose a folder to save your backup to!"
|
||||
|
||||
finalResult += "<br />\n"
|
||||
|
||||
return finalResult
|
||||
|
||||
|
||||
def restore(self, backupFile=None):
|
||||
|
||||
finalResult = ''
|
||||
|
||||
if backupFile:
|
||||
source = backupFile
|
||||
target_dir = os.path.join(sickbeard.DATA_DIR, 'restore')
|
||||
|
||||
if helpers.extractZip(source, target_dir):
|
||||
finalResult += "Successfully extracted restore files to " + target_dir
|
||||
finalResult += "<br>Restart SickGear to complete the restore."
|
||||
else:
|
||||
finalResult += "Restore FAILED"
|
||||
else:
|
||||
finalResult += "You need to select a backup file to restore!"
|
||||
|
||||
finalResult += "<br />\n"
|
||||
|
||||
return finalResult
|
||||
|
||||
|
||||
class ConfigSearch(MainHandler):
|
||||
def index(self, *args, **kwargs):
|
||||
|
||||
|
@ -2687,7 +2639,6 @@ class Config(MainHandler):
|
|||
|
||||
# map class names to urls
|
||||
general = ConfigGeneral
|
||||
backuprestore = ConfigBackupRestore
|
||||
search = ConfigSearch
|
||||
providers = ConfigProviders
|
||||
subtitles = ConfigSubtitles
|
||||
|
|
Loading…
Reference in a new issue