backupstartdone2

This commit is contained in:
Hassan Hashmi
2022-06-07 11:12:10 +05:00
parent 4f392bebdc
commit 3b06360da7
4 changed files with 235 additions and 21 deletions

View File

@@ -1378,10 +1378,19 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
}
$scope.CreateBackup = function (){
$('#wordpresshomeloading').show();
var data = {
WPid: $('#WPid').html(),
$scope.CreateBackup = function () {
$('#wordpresshomeloading').show();
$scope.wordpresshomeloading = false;
$scope.stagingDetailsForm = true;
$scope.installationProgress = false;
$scope.errorMessageBox = true;
$scope.success = true;
$scope.couldNotConnect = true;
$scope.goBackDisable = true;
$scope.currentStatus = "Starting creation Backups..";
var data = {
WPid: $('#WPid').html(),
}
var url = "/websites/WPCreateBackup";
@@ -1396,12 +1405,15 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
function ListInitialDatas(response) {
$('#wordpresshomeloading').hide();
$('createbackupbutton').hide();
if (response.data.status === 1) {
new PNotify({
title: 'Success!',
text: 'Backup Created!.',
text: 'Creating Backups!.',
type: 'success'
});
statusFile = response.data.tempStatusPath;
getCreationStatus();
} else {
new PNotify({
title: 'Operation Failed!',

View File

@@ -43,8 +43,8 @@
data-toggle="tab">Themes</a></li>
<li><a href="#tab4" data-toggle="tab"
ng-click="fetchstaging()">Staging</a></li>
</li>
<li><a href="#tab5" data-toggle="tab"
>Backups</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab1">
@@ -362,6 +362,55 @@
</div>
</div>
<div class="tab-pane" id="tab5">
<h2>Create Backup Now</h2>
<div class="col-sm-12" style="margin-top: 1%">
<button id="createbackupbutton" type="button"
ng-click="CreateBackup()"
class="btn btn-primary btn-lg center-div">{% trans "Create Backup" %}</button>
</div>
<div style="margin-top: 1%" ng-hide="installationProgress" class="form-group">
<label class="col-sm-2 control-label"></label>
<div class="col-sm-7">
<div class="alert alert-success text-center">
<h2>{$ currentStatus $}</h2>
</div>
<div class="progress">
<div id="installProgress" class="progress-bar"
role="progressbar" aria-valuenow="70"
aria-valuemin="0" aria-valuemax="100"
style="width:0%">
<span class="sr-only">70% Complete</span>
</div>
</div>
<div ng-hide="errorMessageBox" class="alert alert-danger">
<p>{% trans "Error message:" %} {$ errorMessage $}</p>
</div>
<div ng-hide="success" class="alert alert-success">
<p>{% trans "Backup succesfully created." %}</p>
</div>
<div ng-hide="couldNotConnect" class="alert alert-danger">
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
</div>
</div>
</div>
<div ng-hide="installationProgress" class="form-group center-div">
<div class="col-sm-12">
<button type="button" ng-disabled="goBackDisable"
ng-click="goBack()"
class="btn btn-primary btn-lg center-div">{% trans "Go Back" %}</button>
</div>
</div>
</div>
</div>
</div>
<hr>
@@ -396,11 +445,7 @@
</svg>
Autoupdate Configurations
</a>
<div class="col-sm-12" style="margin-top: 1%">
<button type="button"
ng-click="CreateBackup()"
class="btn btn-primary btn-lg center-div">{% trans "Create Backup" %}</button>
</div>
<div id="autoUpdateConfig" class="modal fade" tabindex="-1" role="dialog"
aria-hidden="true">
<div class="modal-dialog">

View File

@@ -704,21 +704,20 @@ class WebsiteManager:
else:
return ACLManager.loadError()
# extraArgs = {}
# extraArgs['adminID'] = admin.pk
# extraArgs['StagingDomain'] = StagingObj.FinalURL
# extraArgs['StagingName'] = StagingObj.title
# extraArgs['WPid'] = WPManagerID
# extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
extraArgs = {}
extraArgs['adminID'] = admin.pk
extraArgs['WPid'] = WPManagerID
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
# background = ApplicationInstaller('CreateStagingNow', extraArgs)
# background.start()
background = ApplicationInstaller('WPCreateBackup', extraArgs)
background.start()
time.sleep(2)
data_ret = {'status': 1, 'installStatus': 1, 'error_message': 'None',}
data_ret = {'status': 1, 'installStatus': 1, 'error_message': 'None',
'tempStatusPath': extraArgs['tempStatusPath']}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)