mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-06 13:25:51 +01:00
remove gdrive column
This commit is contained in:
@@ -48,6 +48,18 @@ class BackupManager:
|
|||||||
except BaseException as msg:
|
except BaseException as msg:
|
||||||
return HttpResponse(str(msg))
|
return HttpResponse(str(msg))
|
||||||
|
|
||||||
|
def gDrive(self, request = None, userID = None, data = None):
|
||||||
|
try:
|
||||||
|
currentACL = ACLManager.loadedACL(userID)
|
||||||
|
|
||||||
|
if ACLManager.currentContextPermission(currentACL, 'addDeleteDestinations') == 0:
|
||||||
|
return ACLManager.loadError()
|
||||||
|
|
||||||
|
websitesName = ACLManager.findAllSites(currentACL, userID)
|
||||||
|
return render(request, 'backup/googleDrive.html', {'websiteList': websitesName})
|
||||||
|
except BaseException as msg:
|
||||||
|
return HttpResponse(str(msg))
|
||||||
|
|
||||||
def restoreSite(self, request = None, userID = None, data = None):
|
def restoreSite(self, request = None, userID = None, data = None):
|
||||||
try:
|
try:
|
||||||
currentACL = ACLManager.loadedACL(userID)
|
currentACL = ACLManager.loadedACL(userID)
|
||||||
|
|||||||
136
backup/templates/backup/googleDrive.html
Executable file
136
backup/templates/backup/googleDrive.html
Executable file
@@ -0,0 +1,136 @@
|
|||||||
|
{% extends "baseTemplate/index.html" %}
|
||||||
|
{% load i18n %}
|
||||||
|
{% block title %}{% trans "Set up Back up Destinations" %}{% endblock %}
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
{% load static %}
|
||||||
|
|
||||||
|
|
||||||
|
{% get_current_language as LANGUAGE_CODE %}
|
||||||
|
<!-- Current language: {{ LANGUAGE_CODE }} -->
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div id="page-title">
|
||||||
|
<h2>{% trans "Set up Back up Destinations" %} - <a target="_blank" href="http://go.cyberpanel.net/remote-backup" style="height: 23px;line-height: 21px;" class="btn btn-border btn-alt border-red btn-link font-red" title=""><span>{% trans "Remote Backups" %}</span></a></h2>
|
||||||
|
<p>{% trans "On this page you can set up your Back up destinations. (SFTP)" %}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-controller="backupDestinations" class="panel">
|
||||||
|
<div class="panel-body">
|
||||||
|
<h3 class="title-hero">
|
||||||
|
{% trans "Set up Back up Destinations (SSH port should be 22 on backup server)" %} <img ng-hide="destinationLoading" src="{% static 'images/loading.gif' %}">
|
||||||
|
</h3>
|
||||||
|
<div class="example-box-wrapper">
|
||||||
|
|
||||||
|
|
||||||
|
<form action="/" class="form-horizontal bordered-row">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "IP Address" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="text" class="form-control" ng-model="IPAddress" required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "User" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input placeholder="{% trans "Backup server SSH User, leave empty for root." %}" type="text" class="form-control" ng-model="user" required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Password" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input placeholder="" type="password" class="form-control" ng-model="password" required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Port" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input placeholder="{% trans "Backup server SSH Port, leave empty for 22." %}" type="text" class="form-control" ng-model="backupSSHPort" required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label"></label>
|
||||||
|
<div class="col-sm-4">
|
||||||
|
<button type="button" ng-click="addDestination()" class="btn btn-primary btn-lg btn-block">{% trans "Add Destination" %}</button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!------ List of Destinations --------------->
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div ng-hide="connectionFailed" class="alert alert-danger">
|
||||||
|
<p>{% trans "Connection to" %} {$ IPAddress $} {% trans "failed. Please delete and re-add. " %} {$ errorMessage $} </p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-hide="connectionSuccess" class="alert alert-success">
|
||||||
|
<p>{% trans "Connection to" %} {$ IPAddress $} {% trans "successful." %}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-hide="canNotAddDestination" class="alert alert-danger">
|
||||||
|
<p>{% trans "Cannot add destination. Error message:" %} {$ errorMessage $} </p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-hide="destinationAdded" class="alert alert-success">
|
||||||
|
<p>{% trans "Destination Added." %}</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 class="form-group">
|
||||||
|
|
||||||
|
<div class="col-sm-12">
|
||||||
|
|
||||||
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>{% trans "ID" %}</th>
|
||||||
|
<th>{% trans "IP" %}</th>
|
||||||
|
<th>{% trans "Check Connection" %}</th>
|
||||||
|
<th>{% trans "Delete" %}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr ng-repeat="record in records track by $index">
|
||||||
|
<td ng-bind="record.id"></td>
|
||||||
|
<td ng-bind="record.ip"></td>
|
||||||
|
<td><button type="button" ng-click="checkConn(record.ip)" class="btn ra-100 btn-purple">{% trans "Check Connection" %}</button></td>
|
||||||
|
<td ng-click="delDest(record.ip)"><img src="{% static 'images/delete.png' %}"></td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!------ List of records --------------->
|
||||||
|
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
@@ -6,6 +6,7 @@ urlpatterns = [
|
|||||||
url(r'^getCurrentBackups', views.getCurrentBackups, name='getCurrentBackups'),
|
url(r'^getCurrentBackups', views.getCurrentBackups, name='getCurrentBackups'),
|
||||||
url(r'^backupSite', views.backupSite, name='backupSite'),
|
url(r'^backupSite', views.backupSite, name='backupSite'),
|
||||||
url(r'^restoreSite', views.restoreSite, name='restoreSite'),
|
url(r'^restoreSite', views.restoreSite, name='restoreSite'),
|
||||||
|
url(r'^gDrive', views.gDrive, name='gDrive'),
|
||||||
|
|
||||||
|
|
||||||
url(r'^submitBackupCreation', views.submitBackupCreation, name='submitBackupCreation'),
|
url(r'^submitBackupCreation', views.submitBackupCreation, name='submitBackupCreation'),
|
||||||
|
|||||||
@@ -30,6 +30,13 @@ def backupSite(request):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
return redirect(loadLoginPage)
|
return redirect(loadLoginPage)
|
||||||
|
|
||||||
|
def gDrive(request):
|
||||||
|
try:
|
||||||
|
userID = request.session['userID']
|
||||||
|
bm = BackupManager()
|
||||||
|
return bm.gDrive(request, userID)
|
||||||
|
except KeyError:
|
||||||
|
return redirect(loadLoginPage)
|
||||||
|
|
||||||
def restoreSite(request):
|
def restoreSite(request):
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -580,6 +580,9 @@
|
|||||||
<li class="addDeleteDestinations"><a href="{% url 'backupDestinations' %}"
|
<li class="addDeleteDestinations"><a href="{% url 'backupDestinations' %}"
|
||||||
title="{% trans 'Add Destination' %}"><span>{% trans "Add/Delete Destination" %}</span></a>
|
title="{% trans 'Add Destination' %}"><span>{% trans "Add/Delete Destination" %}</span></a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="addDeleteDestinations"><a href="{% url 'gDrive' %}"
|
||||||
|
title="{% trans 'Setup Google Drive' %}"><span>{% trans "Add/Delete Destination" %}</span></a>
|
||||||
|
</li>
|
||||||
<li class="scheDuleBackups"><a href="{% url 'scheduleBackup' %}"
|
<li class="scheDuleBackups"><a href="{% url 'scheduleBackup' %}"
|
||||||
title="{% trans 'Schedule Back up' %}"><span>{% trans "Schedule Back up" %}</span></a>
|
title="{% trans 'Schedule Back up' %}"><span>{% trans "Schedule Back up" %}</span></a>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ class Administrator(models.Model):
|
|||||||
api = models.IntegerField(default=0)
|
api = models.IntegerField(default=0)
|
||||||
securityLevel = models.IntegerField(default=0)
|
securityLevel = models.IntegerField(default=0)
|
||||||
state = models.CharField(max_length=10, default='ACTIVE')
|
state = models.CharField(max_length=10, default='ACTIVE')
|
||||||
gDrive = models.TextField(max_length=65532, default='Inactive')
|
#gDrive = models.TextField(max_length=65532, default='Inactive')
|
||||||
|
|
||||||
|
|
||||||
initWebsitesLimit = models.IntegerField(default=0)
|
initWebsitesLimit = models.IntegerField(default=0)
|
||||||
|
|||||||
Reference in New Issue
Block a user