mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-15 09:46:11 +01:00
remotewpbackupv2 configer and create
This commit is contained in:
@@ -1527,6 +1527,12 @@ app.controller('CreateV2Backup', function ($scope, $http, $timeout, $compile) {
|
||||
|
||||
$scope.CreateV2BackupButton = function () {
|
||||
$scope.backupLoading = false;
|
||||
$scope.installationDetailsForm = true;
|
||||
$scope.installationProgress = false;
|
||||
$scope.errorMessageBox = true;
|
||||
$scope.success = true;
|
||||
$scope.couldNotConnect = true;
|
||||
$scope.goBackDisable = true;
|
||||
|
||||
var url = "/IncrementalBackups/CreateV2BackupButton";
|
||||
|
||||
@@ -1554,12 +1560,15 @@ app.controller('CreateV2Backup', function ($scope, $http, $timeout, $compile) {
|
||||
|
||||
}
|
||||
else {
|
||||
$scope.backupLoading = true;
|
||||
$scope.installationDetailsForm = true;
|
||||
$scope.installationProgress = false;
|
||||
$scope.errorMessageBox = false;
|
||||
$scope.success = true;
|
||||
$scope.couldNotConnect = true;
|
||||
$scope.goBackDisable = false;
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: response.data.error_message,
|
||||
type: 'error'
|
||||
});
|
||||
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1612,8 +1621,8 @@ app.controller('CreateV2Backup', function ($scope, $http, $timeout, $compile) {
|
||||
$scope.currentStatus = response.data.currentStatus;
|
||||
$timeout.cancel();
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
else {
|
||||
$scope.webSiteCreationLoading = true;
|
||||
$scope.installationDetailsForm = true;
|
||||
$scope.installationProgress = false;
|
||||
@@ -1691,6 +1700,7 @@ app.controller('ConfigureV2Backup', function ($scope, $http, $timeout){
|
||||
Selectedwebsite: $scope.selwebsite,
|
||||
sfptpasswd: $scope.sfptpasswd,
|
||||
hostName: $scope.hostName,
|
||||
UserName: $scope.UserName,
|
||||
};
|
||||
|
||||
var config = {
|
||||
|
||||
@@ -108,6 +108,14 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-hide="installationDetailsForm" class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Username" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input name="accountName" type="text" class="form-control"
|
||||
ng-model="UserName">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-hide="installationDetailsForm" class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Password" %}</label>
|
||||
<div class="col-sm-6">
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
</div>
|
||||
|
||||
<div ng-hide="success" class="alert alert-success">
|
||||
<p>{% trans "Website succesfully created." %}</p>
|
||||
<p>{% trans "Backup succesfully." %}</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -775,21 +775,16 @@ def CreateV2BackupButton(request):
|
||||
Selectedwebsite = data['Selectedwebsite']
|
||||
Selectedrepo = data['Selectedrepo']
|
||||
|
||||
extraArgs = {}
|
||||
|
||||
extraArgs['function'] = 'InitiateBackup'
|
||||
extraArgs['BackendName'] = Selectedrepo
|
||||
extraArgs['domain'] = Selectedwebsite
|
||||
extraArgs['BasePath']= '/home/backup'
|
||||
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
|
||||
|
||||
background = CPBackupsV2(extraArgs)
|
||||
|
||||
background = CPBackupsV2({'domain': Selectedwebsite, 'BasePath': '/home/backup', 'BackupDatabase': 1, 'BackupData': 1,
|
||||
'BackupEmails': 1, 'BackendName': Selectedrepo, 'function': 'InitiateBackup', })
|
||||
background.start()
|
||||
|
||||
time.sleep(2)
|
||||
|
||||
data_ret = {'status': 1, 'installStatus': 1, 'error_message': 'None',
|
||||
'tempStatusPath': extraArgs['tempStatusPath']}
|
||||
data_ret = {'status': 1, 'installStatus': 1, 'error_message': 'None',}
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
@@ -873,12 +868,13 @@ def ConfigureSftpV2Backup(request):
|
||||
Selectedwebsite = data['Selectedwebsite']
|
||||
sfptpasswd = data['sfptpasswd']
|
||||
hostName = data['hostName']
|
||||
UserName = data['UserName']
|
||||
admin = Administrator.objects.get(pk=userID)
|
||||
|
||||
req_data = {}
|
||||
req_data['name'] = 'SFTP'
|
||||
req_data['host'] = Selectedwebsite
|
||||
req_data['user'] = hostName
|
||||
req_data['host'] = hostName
|
||||
req_data['user'] = UserName
|
||||
req_data['password'] = sfptpasswd
|
||||
|
||||
|
||||
|
||||
@@ -1820,7 +1820,7 @@ class BackupManager:
|
||||
command = 'rm -f ' + statusFile
|
||||
subprocess.call(shlex.split(command))
|
||||
data_ret = {'abort': 1, 'installStatus': 1, 'installationProgress': "100",
|
||||
'currentStatus': 'Successfully Installed.'}
|
||||
'currentStatus': 'Successfully Created.'}
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
elif lastLine.find('[404]') > -1:
|
||||
|
||||
Reference in New Issue
Block a user