mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-07-01 10:48:45 +02:00
backuptestfinal3
This commit is contained in:
@@ -1550,19 +1550,31 @@ app.controller('RestoreWPBackup', function ($scope, $http, $timeout, $window) {
|
||||
$scope.goBackDisable = true;
|
||||
$scope.currentStatus = "Start Restoring WordPress..";
|
||||
|
||||
var Domain = $scope.domainNameCreate;
|
||||
var path = $('#wprestoresubdirpath').val()
|
||||
var home = "1";
|
||||
|
||||
if (typeof path != 'undefined' || path != '') {
|
||||
home = "0";
|
||||
}
|
||||
|
||||
var backuptype = $('#backuptype').html();
|
||||
var data;
|
||||
if (backuptype == "DataBase Backup") {
|
||||
data = {
|
||||
backupid: $('#backupid').html(),
|
||||
DesSite: $('#DesSite').children("option:selected").val(),
|
||||
Domain: ''
|
||||
Domain: '',
|
||||
path: path,
|
||||
home: home,
|
||||
}
|
||||
} else {
|
||||
data = {
|
||||
backupid: $('#backupid').html(),
|
||||
DesSite: $('#DesSite').children("option:selected").val(),
|
||||
Domain: $("input[name=Newdomain]").val()
|
||||
Domain: Domain,
|
||||
path: path,
|
||||
home: home,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -68,17 +68,39 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div id="Newsitediv" ng-hide="installationDetailsForm" style="display: none"
|
||||
class="form-group">
|
||||
<label class="col-sm-2 control-label">{% trans "Website Domain" %}</label>
|
||||
<div id="Newsitediv" ng-hide="installationDetailsForm" style="display: none" class="form-group">
|
||||
<label class="col-sm-2 control-label">{% trans "Domain Name" %}</label>
|
||||
<div class="col-sm-10">
|
||||
<input name="Newdomain" id="Newdomain" type="url"
|
||||
placeholder="Enter New Website Domain for Restoring Website "
|
||||
class="form-control" required>
|
||||
<div class="input-group bootstrap-touchspin">
|
||||
<span
|
||||
class="input-group-addon bootstrap-touchspin-prefix"
|
||||
style="display: none;"></span>
|
||||
<input ng-model="domainNameCreate" id="touchspin-demo-1" class="form-control"
|
||||
type="text" value="55"
|
||||
name="touchspin-demo-1"
|
||||
style="display: block;"
|
||||
placeholder="{% trans "Do not enter WWW, it will be auto created!" %}">
|
||||
<span class="input-group-addon bootstrap-touchspin-postfix">/</span>
|
||||
<span style="width: 25%" class="input-group-btn">
|
||||
<input id="wprestoresubdirpath" class="form-control"
|
||||
placeholder="{% trans "Leave empty for default" %}"
|
||||
type="text" value="Leave empty for default"
|
||||
name="wprestoresubdirpath" ng-model="installPath"
|
||||
style="display: block;"></span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# <div id="Newsitediv" ng-hide="installationDetailsForm" style="display: none"#}
|
||||
{# class="form-group">#}
|
||||
{# <label class="col-sm-2 control-label">{% trans "Website Domain" %}</label>#}
|
||||
{# <div class="col-sm-10">#}
|
||||
{# <input name="Newdomain" id="Newdomain" type="url"#}
|
||||
{# placeholder="Enter New Website Domain for Restoring Website "#}
|
||||
{# class="form-control" required>#}
|
||||
{# </div>#}
|
||||
{# </div>#}
|
||||
{% endif %}
|
||||
<div ng-model="installationDetailsForm" class="col-sm-12 center-div">
|
||||
<div ng-model="installationDetailsForm" class="col-sm-12 center-div" class="form-control">
|
||||
<button id="RestoreWPbackupNow" type="button"
|
||||
ng-click="RestoreWPbackupNow()"
|
||||
class="btn btn-primary btn-lg center-div">{% trans "Restore Backup Now" %}</button>
|
||||
|
||||
@@ -185,15 +185,17 @@ class WebsiteManager:
|
||||
try:
|
||||
wpsite = WPSites.objects.get(pk=sub.WPSiteID)
|
||||
web = wpsite.title
|
||||
except:
|
||||
web = "Website Not Found"
|
||||
|
||||
try:
|
||||
config = sub.config
|
||||
conf = json.loads(config)
|
||||
Backuptype = conf['Backuptype']
|
||||
except:
|
||||
web = "Website Not Found"
|
||||
Backuptype = "Backup type not exists"
|
||||
|
||||
|
||||
|
||||
Data['job'].append({
|
||||
'id': sub.id,
|
||||
'title': web,
|
||||
@@ -810,14 +812,16 @@ class WebsiteManager:
|
||||
backupid = data['backupid']
|
||||
DesSiteID = data['DesSite']
|
||||
|
||||
logging.CyberCPLogFileWriter.writeToFile("Error WP ChangeStatusThemes ....... %s"%data)
|
||||
Domain = data['Domain']
|
||||
|
||||
|
||||
extraArgs = {}
|
||||
extraArgs['adminID'] = admin.pk
|
||||
extraArgs['backupid'] = backupid
|
||||
extraArgs['DesSiteID'] = DesSiteID
|
||||
extraArgs['Domain'] = Domain
|
||||
extraArgs['path'] = data['path']
|
||||
extraArgs['home'] = data['home']
|
||||
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user