Review Code

This commit is contained in:
Zarak Khan
2024-02-22 11:35:06 +05:00
parent 8b4c0ffc3b
commit 2fab5982a4
75 changed files with 11067 additions and 1022 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,130 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
{% if BackupStat %}
<div ng-controller="ConfigureV2BackupV2" class="p-8">
<div class="flex items-center py-4">
<p class="text-xl font-bold">Configure v2 Backup Destinations</p>
<img ng-hide="cyberpanelLoading"
src="{% static 'images/loading.gif' %}">
</div>
<hr>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Select Website</p>
</div>
<div>
<select id="selwebsite" ng-change="selectwebsite()" ng-model="selwebsite"
class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in websiteList %}
<option value="{{ items }}">{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Select Backup Type</p>
</div>
<div>
<select ng-change="selectbackuptype()" ng-model="v2backuptype"
class="w-80 bg-gray-100 rounded px-2 py-1">
<option>SFTP</option>
<option>GDrive</option>
</select>
</div>
</div>
{# <div>#}
{# <div class="flex justify-center mt-6 mb-2">#}
{# <button id="CreateV2BackupButton" ng-click="CreateV2BackupButton()"#}
{# class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">#}
{# Create Backup#}
{# </button>#}
{# </div>#}
{# </div>#}
{# <div ng-hide="installationProgress">#}
{# <div class="col-sm-7">#}
{# <div class="flex justify-center font-bold text-xl">#}
{# <h2>{$ currentStatus $}</h2>#}
{# </div>#}
{# <div class="w-full bg-gray-100 rounded-full mt-3">#}
{# <div id="installProgress"#}
{# class="bg-green-600 text-xs font-medium text-white text-center p-2 leading-none rounded-full"#}
{# style="width:0%">#}
{# </div>#}
{# </div>#}
{# <div ng-hide="errorMessageBox"#}
{# class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">#}
{# <p>{% trans "Error message:" %} {$ errorMessage $}</p>#}
{# </div>#}
{# <div ng-hide="success" class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">#}
{# <p>{% trans "Backup succesfully." %}</p>#}
{# </div>#}
{# <div ng-hide="couldNotConnect"#}
{# class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">#}
{# <p>{% trans "Could not connect to server. Please refresh this page." %}</p>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# <div ng-hide="installationProgress" class="flex justify-center mt-3">#}
{# <div class="col-sm-4">#}
{# <button type="button" ng-disabled="goBackDisable" ng-click="goBack()"#}
{# class="bg-blue-500 px-3 py-2 rounded-lg text-xl font-semibold text-white">{% trans "Go Back" %}</button>#}
{# </div>#}
{# </div>#}
</div>
{% else %}
<style>
.feturecard {
width: 30%;
padding: 46px;
margin: 15px
}
</style>
<div class="container">
<div id="page-title" align="center">
<h1 style="color: black"><strong>Backups v2 - Incremental Backups! </strong></h1>
<p style="font-size: 15px; color: black; margin-top: 1%">Is your website's data protection strategy up
to par? Are you tired of dealing with slow and unreliable backup solutions that don't offer the
level of robustness you need? <br><br>
Introducing CyberPanel's latest feature, Backups v2! With Backups v2, you can ensure that your
website's data is protected like never before. Our advanced incremental backup system utilizes
rclone, a powerful backup tool that supports over 30+ backends, including popular cloud storage
providers like Google Drive, Dropbox, Amazon S3, and more!<br><br>
Gone are the days of slow and cumbersome full backups. With Backups v2, you can take advantage of
incremental backups that only capture changes to your data, making the process lightning-fast and
highly efficient. This means you can save time and bandwidth while still maintaining the highest
level of data integrity.<br><br>
Whether you have a small blog or a large e-commerce website, Backups v2 is tailored to meet your
needs. With its robustness and versatility, you can have peace of mind knowing that your website's
data is backed up securely and can be easily restored whenever you need it.
<br></p>
</div>
<p align="center">
<iframe width="788.54" height="443" src="https://www.youtube.com/embed/7dI1013xvUc"
title="YouTube video player" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowfullscreen></iframe>
</p>
<div style="margin-top: 2%">
<stripe-pricing-table pricing-table-id="prctbl_1MQtdYJMfY1fWGMszc4tx78j"
publishable-key="pk_live_51ITXBmJMfY1fWGMs2G0LAydJweIDMp2WaYocM0xyzdn03WaHUbMw6uxfVuktAkgpRyUql7tz7gF5OwdccEZLd6Ot00XX6tGoZx">
</stripe-pricing-table>
<stripe-pricing-table pricing-table-id="prctbl_1LpSqSJMfY1fWGMsxSNhPLsc"
publishable-key="pk_live_51ITXBmJMfY1fWGMs2G0LAydJweIDMp2WaYocM0xyzdn03WaHUbMw6uxfVuktAkgpRyUql7tz7gF5OwdccEZLd6Ot00XX6tGoZx">
</stripe-pricing-table>
<stripe-pricing-table pricing-table-id="prctbl_1M6WpCJMfY1fWGMsQXFlZWcW"
publishable-key="pk_live_51ITXBmJMfY1fWGMs2G0LAydJweIDMp2WaYocM0xyzdn03WaHUbMw6uxfVuktAkgpRyUql7tz7gF5OwdccEZLd6Ot00XX6tGoZx">
</stripe-pricing-table>
</div>
</div>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,133 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="CreateV2BackupV2" class="p-8">
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
<div class="flex items-center">
<p class="text-4xl font-bold">Create V2 Backup -</p>
<a target="_blank" href="http://go.cyberpanel.net/backup"
style="height: 23px;line-height: 21px;"
class="bg-blue-200 px-2 font-bold mt-2 ml-3"
title=""><span>{% trans "Backup Docs" %}</span></a>
</div>
</div>
<p class="text-xs text-gray-600 py-2 font-semibold">This page can be used to create your backup
</p>
<div class="flex items-center py-4">
<p class="text-xl font-bold">Create v2 Backup</p>
<img ng-hide="backupLoading" src="{% static 'images/loading.gif' %}">
<a class="ml-2 font-semibold text-gray-500" href="{% url 'RestoreV2backupSite' %}">- Restore Backups</a>
</div>
<hr>
<p class="border" align="center" style="margin-top: 2%; margin-bottom: 2%">
<iframe width="788.54" height="443" src="https://www.youtube.com/embed/7dI1013xvUc"
title="YouTube video player" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowfullscreen></iframe>
</p>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Select Website</p>
</div>
<div>
<select id="create-backup-select" ng-change="selectwebsite()" ng-model="selwebsite"
class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in websiteList %}
<option value="{{ items }}">{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Select Repo</p>
</div>
<div>
<select id="reposelectbox" ng-change="selectrepo()" ng-model="testhabbi"
class="w-80 bg-gray-100 rounded px-2 py-1">
</select>
</div>
</div>
<div class="flex mt-4 px-6">
<div>
<p class="font-semibold w-60">Backup Content</p>
</div>
<div>
<div class="checkbox">
<label>
<input ng-model="websiteData" type="checkbox" value="">
Data
</label>
</div>
</div>
</div>
<div class="flex px-6">
<div>
<p class="font-semibold w-60"></p>
</div>
<div>
<div class="checkbox">
<label>
<input ng-model="websiteDatabases" type="checkbox" value="">
Databases
</label>
</div>
</div>
</div>
<div class="flex px-6">
<div>
<p class="font-semibold w-60"></p>
</div>
<div>
<div class="checkbox">
<label>
<input ng-model="websiteEmails" type="checkbox" value="">
Emails
</label>
</div>
</div>
</div>
<div>
<div class="flex justify-center mt-6 mb-2">
<button id="CreateV2BackupButton" ng-click="CreateV2BackupButton()"
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
Create Backup
</button>
</div>
</div>
<div ng-hide="installationProgress">
<div class="col-sm-7">
<div class="flex justify-center font-bold text-xl">
<h2>{$ currentStatus $}</h2>
</div>
<div class="w-full bg-gray-100 rounded-full mt-3">
<div id="installProgress"
class="bg-green-600 text-xs font-medium text-white text-center p-2 leading-none rounded-full"
style="width:0%">
</div>
</div>
<div ng-hide="errorMessageBox"
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "Error message:" %} {$ errorMessage $}</p>
</div>
<div ng-hide="success" class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
<p>{% trans "Backup succesfully." %}</p>
</div>
<div ng-hide="couldNotConnect"
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
</div>
</div>
</div>
<div ng-hide="installationProgress" class="flex justify-center mt-3">
<div class="col-sm-4">
<button type="button" ng-disabled="goBackDisable" ng-click="goBack()"
class="bg-blue-500 px-3 py-2 rounded-lg text-xl font-semibold text-white">{% trans "Go Back" %}</button>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,229 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
{% if BackupStat %}
<div ng-controller="ScheduleV2BackupV2" class="p-8">
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
<div class="flex items-center">
<p class="text-4xl font-bold">Schedule V2 Backup -</p>
<a target="_blank" href="http://go.cyberpanel.net/backup"
style="height: 23px;line-height: 21px;"
class="bg-blue-200 px-2 font-bold mt-2 ml-3"
title=""><span>{% trans "Backup Docs" %}</span></a>
</div>
</div>
<p class="text-xs text-gray-600 py-2 font-semibold">This page can be used to schedule your backups.
</p>
<div class="flex items-center py-4">
<p class="text-xl font-bold">Schedule v2 Backup</p>
<img ng-hide="backupLoading"
src="{% static 'images/loading.gif' %}">
</div>
<hr>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Select Website</p>
</div>
<div>
<select id="create-backup-select" ng-change="selectwebsite()" ng-model="selwebsite"
class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in websiteList %}
<option value="{{ items }}">{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Backup Frequency</p>
</div>
<div>
<select id="create-backup-select" ng-model="frequency"
class="w-80 bg-gray-100 rounded px-2 py-1">
<option>30 Minutes</option>
<option>1 Hour</option>
<option>6 Hours</option>
<option>12 Hours</option>
<option>1 Day</option>
<option>3 Days</option>
<option>1 Week</option>
</select>
</div>
</div>
<div class="flex mt-4 px-6">
<div>
<p class="font-semibold w-60">Select Repo</p>
</div>
<div>
<select id="reposelectbox" ng-change="selectrepo()" ng-model="testhabbi"
class="w-80 bg-gray-100 rounded px-2 py-1">
</select>
</div>
</div>
<div class="flex mt-4 px-6">
<div>
<p class="font-semibold w-60">Backup Retention</p>
</div>
<div>
<select id="create-backup-select" ng-model="retention"
class="w-80 bg-gray-100 rounded px-2 py-1">
<option value="1">1 Day</option>
<option value="3">3 Days</option>
<option value="30">30 Days</option>
</select>
</div>
</div>
<div class="flex mt-4 px-6">
<div>
<p class="font-semibold w-60">Backup Content</p>
</div>
<div>
<label>
<input ng-model="websiteData" type="checkbox" value="">
Data
</label>
</div>
</div>
<div class="flex px-6">
<div>
<p class="font-semibold w-60"></p>
</div>
<div>
<div class="checkbox">
<label>
<input ng-model="websiteDatabases" type="checkbox" value="">
Databases
</label>
</div>
</div>
</div>
<div class="flex px-6">
<div>
<p class="font-semibold w-60"></p>
</div>
<div>
<div class="checkbox">
<label>
<input ng-model="websiteEmails" type="checkbox" value="">
Emails
</label>
</div>
</div>
</div>
<div>
<div class="flex justify-center mt-6 mb-2">
<button id="CreateV2BackupButton" ng-click="CreateScheduleV2()"
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
Create Schedule
</button>
</div>
</div>
<div class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr class="bg-gray-200 mt-6 w-full rounded-t-lg border-b-2 border-gray-400">
<th scope="col" class="px-6 py-3">
Repo
</th>
<th scope="col" class="px-6 py-3">
Frequency
</th>
<th scope="col" class="px-6 py-3">
Retention
</th>
<th scope="col" class="px-6 py-3">
Backup Websites?
</th>
<th scope="col" class="px-6 py-3">
Backup Databases?
</th>
<th scope="col" class="px-6 py-3">
Backup Emails?
</th>
<th scope="col" class="px-6 py-3">
Last Run
</th>
<th scope="col" class="px-6 py-3">
Delete
</th>
</tr>
</thead>
<tbody ng-repeat="record in records track by $index"
class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td ng-bind="record.repo" class="px-6 py-4">
</td>
<td ng-bind="record.frequency" class="px-6 py-4">
</td>
<td ng-bind="record.retention" class="px-6 py-4">
</td>
<td ng-bind="record.websiteData" class="px-6 py-4">
</td>
<td ng-bind="record.websiteDatabases" class="px-6 py-4">
</td>
<td ng-bind="record.websiteEmails" class="px-6 py-4">
</td>
<td ng-bind="record.lastRun" class="px-6 py-4">
</td>
<td class="px-6 py-4">
</td>
</tr>
</tbody>
</table>
</div>
</div>
{% else %}
<style>
.feturecard {
width: 30%;
padding: 46px;
margin: 15px
}
</style>
<div class="container">
<div id="page-title" align="center">
<h1 style="color: black"><strong>Backups v2 - Incremental Backups! </strong></h1>
<p style="font-size: 15px; color: black; margin-top: 1%">Is your website's data protection strategy up
to par? Are you tired of dealing with slow and unreliable backup solutions that don't offer the
level of robustness you need? <br><br>
Introducing CyberPanel's latest feature, Backups v2! With Backups v2, you can ensure that your
website's data is protected like never before. Our advanced incremental backup system utilizes
rclone, a powerful backup tool that supports over 30+ backends, including popular cloud storage
providers like Google Drive, Dropbox, Amazon S3, and more!<br><br>
Gone are the days of slow and cumbersome full backups. With Backups v2, you can take advantage of
incremental backups that only capture changes to your data, making the process lightning-fast and
highly efficient. This means you can save time and bandwidth while still maintaining the highest
level of data integrity.<br><br>
Whether you have a small blog or a large e-commerce website, Backups v2 is tailored to meet your
needs. With its robustness and versatility, you can have peace of mind knowing that your website's
data is backed up securely and can be easily restored whenever you need it.
<br></p>
</div>
<p align="center">
<iframe width="788.54" height="443" src="https://www.youtube.com/embed/7dI1013xvUc"
title="YouTube video player" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowfullscreen></iframe>
</p>
<div style="margin-top: 2%">
<stripe-pricing-table pricing-table-id="prctbl_1MQtdYJMfY1fWGMszc4tx78j"
publishable-key="pk_live_51ITXBmJMfY1fWGMs2G0LAydJweIDMp2WaYocM0xyzdn03WaHUbMw6uxfVuktAkgpRyUql7tz7gF5OwdccEZLd6Ot00XX6tGoZx">
</stripe-pricing-table>
<stripe-pricing-table pricing-table-id="prctbl_1LpSqSJMfY1fWGMsxSNhPLsc"
publishable-key="pk_live_51ITXBmJMfY1fWGMs2G0LAydJweIDMp2WaYocM0xyzdn03WaHUbMw6uxfVuktAkgpRyUql7tz7gF5OwdccEZLd6Ot00XX6tGoZx">
</stripe-pricing-table>
<stripe-pricing-table pricing-table-id="prctbl_1M6WpCJMfY1fWGMsQXFlZWcW"
publishable-key="pk_live_51ITXBmJMfY1fWGMs2G0LAydJweIDMp2WaYocM0xyzdn03WaHUbMw6uxfVuktAkgpRyUql7tz7gF5OwdccEZLd6Ot00XX6tGoZx">
</stripe-pricing-table>
</div>
</div>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,193 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="scheduleBackupIncV2" class="p-8">
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
<div class="flex items-center">
<p class="text-4xl font-bold">Schedule Backup -</p>
<a target="_blank" href="https://cyberpanel.net/"
style="height: 23px;line-height: 21px;"
class="bg-blue-200 px-2 font-bold mt-2 ml-3"
title=""><span>{% trans "Remote Backups" %}</span></a>
</div>
</div>
<p class="text-xs text-gray-600 py-2 font-semibold">On this page you can schedule Backups to localhost or remote
server (If you have added one).
</p>
<div class="flex items-center py-4">
<p class="text-xl font-bold">Schedule Backup</p>
<img ng-hide="cyberpanelLoading"
src="{% static 'images/loading.gif' %}">
</div>
<hr>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Select Destination</p>
</div>
<div>
<select ng-change="scheduleFreqView()" ng-model="backupDest" class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in destinations %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div>
<div ng-hide="scheduleFreq" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Select Frequency</p>
</div>
<div>
<select ng-change="scheduleBtnView()" ng-model="backupFreq"
class="w-80 bg-gray-100 rounded px-2 py-1">
<option>Daily</option>
<option>Weekly</option>
</select>
</div>
</div>
<div ng-hide="scheduleRetention" class="flex mt-4 px-6">
<div>
<p class="font-semibold w-60">Select Backup Retention. Leave 0 for no limit</p>
</div>
<div>
<input ng-model="backupRetention" type="number" class="w-80 bg-gray-100 rounded px-2 py-1"
value="0">
</div>
</div>
<div ng-hide="scheduleFreq">
<div class="flex mt-4 px-6">
<div>
<p class="font-semibold w-60">Backup Content</p>
</div>
<div>
<label>
<input ng-model="websiteData" type="checkbox" value="">
Data
</label>
</div>
</div>
<div class="flex px-6">
<div>
<p class="font-semibold w-60"></p>
</div>
<div>
<label>
<input ng-model="websiteDatabases" type="checkbox" value="">
Databases
</label>
</div>
</div>
<div class="flex px-6">
<div>
<p class="font-semibold w-60"></p>
</div>
<div>
<div class="checkbox">
<label>
<input ng-model="websiteEmails" type="checkbox" value="">
Emails
</label>
</div>
</div>
</div>
</div>
<div ng-hide="scheduleFreq">
<div class="flex justify-center mt-6 mb-2">
<button ng-click="addSchedule()"
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
Add Destination
</button>
</div>
</div>
</div>
<div ng-hide="scheduleFreq" class="form-group">
<div class="col-sm-12">
<input type="text" ng-model="accountsSearch"
placeholder="{% trans 'Search Accounts..' %}"
class="w-full bg-gray-100 rounded px-2 py-1">
</div>
</div>
<div ng-hide="scheduleFreq" class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr class="bg-gray-200 mt-6 w-full rounded-t-lg border-b-2 border-gray-400">
<th scope="col" class="px-6 py-3">
Select sites to be included in this job
</th>
<th scope="col" class="px-6 py-3">
<input ng-model="webSiteStatus" ng-change="allChecked(webSiteStatus)"
type="checkbox" value="">
</th>
</tr>
</thead>
<tbody ng-repeat="web in WebSitesList | filter:accountsSearch"
class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td ng-bind="web.domain" class="px-6 py-4">
</td>
<td ng-click="" class="px-6 py-4">
<input ng-model="webSiteStatus"
ng-change="addRemoveWebsite(web.domain,webSiteStatus)"
type="checkbox" value="">
</td>
</tr>
</tbody>
</table>
</div>
<div class="row">
<div class="col-sm-4 col-sm-offset-8">
<nav aria-label="Page navigation">
<ul class="pagination">
<li ng-repeat="page in pagination"
ng-click="getFurtherWebsitesFromDB($index+1)" id="webPages"><a
href="">{$ $index + 1 $}</a></li>
</ul>
</nav>
</div>
</div>
<div class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr class="bg-gray-200 mt-6 w-full rounded-t-lg border-b-2 border-gray-400">
<th scope="col" class="px-6 py-3">
ID
</th>
<th scope="col" class="px-6 py-3">
Destination
</th>
<th scope="col" class="px-6 py-3">
Frequency
</th>
<th scope="col" class="px-6 py-3">
Sites
</th>
<th scope="col" class="px-6 py-3">
Delete
</th>
</tr>
</thead>
<tbody ng-repeat="record in records track by $index"
class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td ng-bind="record.id" class="px-6 py-4">
</td>
<td ng-bind="record.destination" class="px-6 py-4">
</td>
<td ng-bind="record.frequency" class="px-6 py-4">
</td>
<td ng-bind="record.numberOfSites" class="px-6 py-4">
</td>
<td class="px-6 py-4">
Delete Edit
</td>
</tr>
</tbody>
</table>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,140 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="createIncrementalBackupsV2" class="p-8">
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
<div class="flex items-center">
<p class="text-4xl font-bold">Backup Website -</p>
<a target="_blank" href="https://cyberpanel.net/docs/2-create-restore-incremental-backups/"
style="height: 23px;line-height: 21px;"
class="bg-blue-200 px-2 font-bold mt-2 ml-3"
title=""><span>{% trans "Backup Docs" %}</span></a>
</div>
</div>
<p class="text-xs text-gray-600 py-2 font-semibold">This page can be used to create incremental backups for your
websites.
</p>
<div class="flex items-center py-4">
<p class="text-xl font-bold">Backup Website</p>
<img ng-hide="cyberpanelLoading"
src="{% static 'images/loading.gif' %}">
</div>
<hr>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Select Website</p>
</div>
<div>
<select ng-change="fetchDetails()" ng-model="websiteToBeBacked"
class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in websiteList %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div ng-hide="destination">
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Destination</p>
</div>
<div>
<select ng-change="destinationSelection()" ng-model="backupDestinations"
class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in destinations %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="flex mt-4 px-6">
<div>
<p class="font-semibold w-60">Backup Content</p>
</div>
<div>
<label>
<input ng-model="websiteData" type="checkbox" value="">
Data
</label>
</div>
</div>
<div class="flex px-6">
<div>
<p class="font-semibold w-60"></p>
</div>
<div>
<label>
<input ng-model="websiteDatabases" type="checkbox" value="">
Databases
</label>
</div>
</div>
<div class="flex px-6">
<div>
<p class="font-semibold w-60"></p>
</div>
<div>
<label>
<input ng-model="websiteEmails" type="checkbox" value="">
Emails
</label>
</div>
</div>
</div>
<div ng-hide="runningBackup" class="border">
<div>
<div>
<textarea ng-model="status" class="w-full" rows="10"></textarea>
</div>
</div>
</div>
<div ng-hide="backupButton">
<div class="flex justify-center mt-6 mb-2">
<button ng-click="createBackup()"
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
Create Backup
</button>
</div>
</div>
<div class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr class="bg-gray-200 mt-6 w-full rounded-t-lg border-b-2 border-gray-400">
<th scope="col" class="px-6 py-3">
ID
</th>
<th scope="col" class="px-6 py-3">
Date
</th>
<th scope="col" class="px-6 py-3">
Restore
</th>
<th scope="col" class="px-6 py-3">
Delete
</th>
</tr>
</thead>
<tbody ng-repeat="record in records track by $index"
class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td ng-bind="record.id" class="px-6 py-4">
</td>
<td ng-bind="record.date" class="px-6 py-4">
</td>
<td class="px-6 py-4">
Restore
</td>
<td ng-click="deleteBackup(record.id)" class="px-6 py-4">
<img class="ml-2 cursor-pointer" src="{% static 'images/delete.png' %}">
</td>
</tr>
</tbody>
</table>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,156 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="incrementalDestinationsV2" class="p-8">
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
<div class="flex items-center">
<p class="text-4xl font-bold">Set up Incremental Backup Destinations -</p>
<a target="_blank"
href="https://cyberpanel.net/docs/1-add-remove-destinations-for-incremental-backups/"
style="height: 23px;line-height: 21px;"
class="bg-blue-200 px-2 font-bold mt-2 ml-3"
title=""><span>{% trans "Remote Backups" %}</span></a>
</div>
</div>
<p class="text-xs text-gray-600 py-2 font-semibold">On this page you can set up your Backup destinations. (SFTP
and AWS)
</p>
<div class="flex items-center py-4">
<p class="text-xl font-bold">Set up Backup Destinations.</p>
<img ng-hide="cyberpanelLoading"
src="{% static 'images/loading.gif' %}">
</div>
<hr>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Select Type</p>
</div>
<div>
<select ng-change="fetchDetails()" ng-model="destinationType"
class="w-80 bg-gray-100 rounded px-2 py-1">
{# <option>SFTP</option>#}
<option>AWS</option>
</select>
</div>
</div>
<div>
<div ng-hide="sftpHide" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">IP Address</p>
</div>
<div>
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="IPAddress" required>
</div>
</div>
<div ng-hide="sftpHide" class="flex mt-4 px-6">
<div>
<p class="font-semibold w-60">Password</p>
</div>
<div>
<input placeholder="" type="password" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="password"
required>
</div>
</div>
<div ng-hide="sftpHide" class="flex mt-4 px-6">
<div>
<p class="font-semibold w-60">Port</p>
</div>
<div>
<input placeholder="{% trans "Backup server SSH Port, leave empty for 22." %}"
type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="backupSSHPort" required>
</div>
</div>
<div ng-hide="sftpHide">
<div class="flex justify-center mt-6 mb-2">
<button ng-click="addDestination('SFTP')"
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
Add Destination
</button>
</div>
</div>
</div>
<div ng-hide="sftpHide" class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr class="bg-gray-200 mt-6 w-full rounded-t-lg border-b-2 border-gray-400">
<th scope="col" class="px-6 py-3">
IP
</th>
<th scope="col" class="px-6 py-3">
Port
</th>
<th scope="col" class="px-6 py-3">
Delete
</th>
</tr>
</thead>
<tbody ng-repeat="record in records track by $index"
class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td ng-bind="record.ip" class="px-6 py-4">
</td>
<td ng-bind="record.port" class="px-6 py-4">
</td>
<td ng-click="removeDestination('SFTP',record.ip)" class="px-6 py-4">
<img class="ml-2 cursor-pointer" src="{% static 'images/delete.png' %}">
</td>
</tr>
</tbody>
</table>
</div>
<div ng-hide="awsHide" class="flex mt-4 px-6">
<div>
<p class="font-semibold w-60">AWS_ACCESS_KEY_ID</p>
</div>
<div>
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="AWS_ACCESS_KEY_ID" required>
</div>
</div>
<div ng-hide="awsHide" class="flex mt-4 px-6">
<div>
<p class="font-semibold w-60">AWS_SECRET_ACCESS_KEY</p>
</div>
<div>
<input placeholder="" type="password" class="w-80 bg-gray-100 rounded px-2 py-1"
ng-model="AWS_SECRET_ACCESS_KEY" required>
</div>
</div>
<div ng-hide="awsHide">
<div class="flex justify-center mt-6 mb-2">
<button ng-click="addDestination('AWS')"
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
Add Destination
</button>
</div>
</div>
<div ng-hide="awsHide" class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr class="bg-gray-200 mt-6 w-full rounded-t-lg border-b-2 border-gray-400">
<th scope="col" class="px-6 py-3">
AWS_ACCESS_KEY_ID
</th>
<th scope="col" class="px-6 py-3">
Delete
</th>
</tr>
</thead>
<tbody ng-repeat="record in records track by $index"
class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td ng-bind="record.AWS_ACCESS_KEY_ID" class="px-6 py-4">
</td>
<td ng-click="removeDestination('AWS', record.AWS_ACCESS_KEY_ID)" class="px-6 py-4">
<img class="ml-2 cursor-pointer" src="{% static 'images/delete.png' %}">
</td>
</tr>
</tbody>
</table>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,125 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="restoreRemoteBackupsIncV2" class="p-8">
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
<div class="flex items-center">
<p class="text-4xl font-bold">Restore Remote Incremental Backups -</p>
<a target="_blank"
href="https://cyberpanel.net/docs/3-restore-backups-from-remote-destination/"
style="height: 23px;line-height: 21px;"
class="bg-blue-200 px-2 font-bold mt-2 ml-3"
title=""><span>{% trans "Backup Docs" %}</span></a>
</div>
</div>
<p class="text-xs text-gray-600 py-2 font-semibold">This page can be used to restore remote incremental backups
for your websites.
</p>
<div class="flex items-center py-4">
<p class="text-xl font-bold">Backup Website</p>
<img ng-hide="cyberpanelLoading"
src="{% static 'images/loading.gif' %}">
</div>
<hr>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Select Website</p>
</div>
<div>
<select ng-change="showThings()" ng-model="websiteToBeBacked"
class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in websiteList %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div>
<div ng-hide="destination" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Destination</p>
</div>
<div>
<select ng-model="backupDestinations"
class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in destinations %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div ng-hide="destination" class="flex mt-4 px-6">
<div>
<p class="font-semibold w-60">Encrypted Backup Password</p>
</div>
<div>
<input type="password" name="password" class="w-80 bg-gray-100 rounded px-2 py-1"
ng-model="password"
required>
</div>
</div>
<div ng-hide="destination">
<div class="flex justify-center mt-6 mb-2">
<button ng-click="fetchDetails()"
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
Fetch Restore Points
</button>
<img ng-hide="cyberpanelLoading" src="{% static 'images/loading.gif' %}">
</div>
</div>
</div>
<div ng-hide="runningBackup" class="form-group">
<div class="border">
<div class="col-sm-12">
<textarea ng-model="status" class="w-full" rows="10"></textarea>
</div>
</div>
</div>
<div class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr class="bg-gray-200 mt-6 w-full rounded-t-lg border-b-2 border-gray-400">
<th scope="col" class="px-6 py-3">
Snapshot ID
</th>
<th scope="col" class="px-6 py-3">
Date
</th>
<th scope="col" class="px-6 py-3">
Host
</th>
<th scope="col" class="px-6 py-3">
Path
</th>
<th scope="col" class="px-6 py-3">
Actions
</th>
</tr>
</thead>
<tbody ng-repeat="web in WebSitesList | filter:accountsSearch"
class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td ng-bind="record.id" class="px-6 py-4">
</td>
<td ng-bind="record.date" class="px-6 py-4">
</td>
<td ng-bind="record.host" class="px-6 py-4">
</td>
<td ng-bind="record.path" class="px-6 py-4">
</td>
<td class="px-6 py-4">
<a ng-click="restorePoint(record.id, record.path)"
class=""
title=""><span>Restore</span></a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
{% endblock %}

View File

@@ -3,8 +3,11 @@ from . import views
urlpatterns = [
url(r'^createBackup$', views.create_backup, name='createBackupInc'),
url(r'^V2/createBackupV2$', views.create_backupV2, name='createBackupIncV2'),
url(r'^restoreRemoteBackups$', views.restore_remote_backups, name='restoreRemoteBackupsInc'),
url(r'^V2/restoreRemoteBackupsV2$', views.restore_remote_backupsV2, name='restoreRemoteBackupsIncV2'),
url(r'^backupDestinations$', views.backup_destinations, name='backupDestinationsInc'),
url(r'^V2/backupDestinationsV2$', views.backup_destinationsV2, name='backupDestinationsIncV2'),
url(r'^addDestination$', views.add_destination, name='addDestinationInc'),
url(r'^populateCurrentRecords$', views.populate_current_records, name='populateCurrentRecordsInc'),
url(r'^removeDestination$', views.remove_destination, name='removeDestinationInc'),
@@ -15,6 +18,7 @@ urlpatterns = [
url(r'^fetchRestorePoints$', views.fetch_restore_points, name='fetchRestorePointsInc'),
url(r'^restorePoint$', views.restore_point, name='restorePointInc'),
url(r'^scheduleBackups$', views.schedule_backups, name='scheduleBackupsInc'),
url(r'^V2/scheduleBackupsV2$', views.schedule_backupsV2, name='scheduleBackupsIncV2'),
url(r'^submitBackupSchedule$', views.submit_backup_schedule, name='submitBackupScheduleInc'),
url(r'^scheduleDelete$', views.schedule_delete, name='scheduleDeleteInc'),
url(r'^getCurrentBackupSchedules$', views.get_current_backup_schedules, name='getCurrentBackupSchedulesInc'),
@@ -24,7 +28,9 @@ urlpatterns = [
url(r'^addWebsite$', views.add_website, name='addWebsite'),
### V2 Backups URls
url(r'^CreateV2Backup$', views.CreateV2Backup, name='CreateV2Backup'),
url(r'^V2/CreateV2BackupV2$', views.CreateV2BackupV2, name='CreateV2BackupV2'),
url(r'^ConfigureV2Backup$', views.ConfigureV2Backup, name='ConfigureV2Backup'),
url(r'^V2/ConfigureV2BackupV2$', views.ConfigureV2BackupV2, name='ConfigureV2BackupV2'),
url(r'^ConfigureV2BackupSetup$', views.ConfigureV2BackupSetup, name='ConfigureV2BackupSetup'),
url(r'^RestoreV2backupSite$', views.RestoreV2backupSite, name='RestoreV2backupSite'),
url(r'^selectwebsiteRetorev2$', views.selectwebsiteRetorev2, name='selectwebsiteRetorev2'),
@@ -36,7 +42,8 @@ urlpatterns = [
url(r'^ConfigureSftpV2Backup$', views.ConfigureSftpV2Backup, name='ConfigureSftpV2Backup'),
url(r'^schedulev2Backups$', views.schedulev2Backups, name='schedulev2Backups'),
url(r'^V2/schedulev2BackupsV2$', views.schedulev2BackupsV2, name='schedulev2BackupsV2'),
url(r'^DeleteScheduleV2$', views.DeleteScheduleV2, name='DeleteScheduleV2'),
url(r'^CreateScheduleV2$', views.CreateScheduleV2, name='CreateScheduleV2'),
]
]

View File

@@ -23,8 +23,6 @@ from .IncBackupsControl import IncJobs
from .models import IncJob, BackupJob, JobSites
def def_renderer(request, templateName, args, context=None):
proc = httpProc(request, templateName,
args, context)
@@ -53,10 +51,7 @@ def _get_user_acl(request):
return user_id, current_acl
def create_backup(request):
try:
user_id, current_acl = _get_user_acl(request)
if ACLManager.currentContextPermission(current_acl, 'createBackup') == 0:
@@ -73,6 +68,23 @@ def create_backup(request):
return redirect(loadLoginPage)
def create_backupV2(request):
try:
user_id, current_acl = _get_user_acl(request)
if ACLManager.currentContextPermission(current_acl, 'createBackup') == 0:
return ACLManager.loadError()
websites = ACLManager.findAllSites(current_acl, user_id)
destinations = _get_destinations(local=True)
return def_renderer(request, 'IncBackups/createBackupV2.html',
{'websiteList': websites, 'destinations': destinations}, 'createBackup')
except BaseException as msg:
logging.writeToFile(str(msg))
return redirect(loadLoginPage)
def backup_destinations(request):
try:
user_id, current_acl = _get_user_acl(request)
@@ -85,6 +97,18 @@ def backup_destinations(request):
return redirect(loadLoginPage)
def backup_destinationsV2(request):
try:
user_id, current_acl = _get_user_acl(request)
if ACLManager.currentContextPermission(current_acl, 'addDeleteDestinations') == 0:
return ACLManager.loadError()
return def_renderer(request, 'IncBackups/incrementalDestinationsV2.html', {}, 'addDeleteDestinations')
except BaseException as msg:
logging.writeToFile(str(msg))
return redirect(loadLoginPage)
def add_destination(request):
try:
user_id, current_acl = _get_user_acl(request)
@@ -219,6 +243,7 @@ def populate_current_records(request):
final_json = json.dumps(final_dic)
return HttpResponse(final_json)
def remove_destination(request):
try:
user_id, current_acl = _get_user_acl(request)
@@ -246,6 +271,7 @@ def remove_destination(request):
final_json = json.dumps(final_dic)
return HttpResponse(final_json)
def fetch_current_backups(request):
try:
user_id, current_acl = _get_user_acl(request)
@@ -291,6 +317,7 @@ def fetch_current_backups(request):
final_json = json.dumps(final_dic)
return HttpResponse(final_json)
def submit_backup_creation(request):
try:
user_id, current_acl = _get_user_acl(request)
@@ -329,6 +356,7 @@ def submit_backup_creation(request):
final_json = json.dumps(final_dic)
return HttpResponse(final_json)
def get_backup_status(request):
try:
data = json.loads(request.body)
@@ -392,6 +420,7 @@ def get_backup_status(request):
logging.writeToFile(str(msg) + " [backupStatus]")
return HttpResponse(final_json)
def delete_backup(request):
try:
@@ -422,6 +451,7 @@ def delete_backup(request):
final_json = json.dumps(final_dic)
return HttpResponse(final_json)
def fetch_restore_points(request):
try:
user_id, current_acl = _get_user_acl(request)
@@ -456,6 +486,7 @@ def fetch_restore_points(request):
final_json = json.dumps(final_dic)
return HttpResponse(final_json)
def restore_point(request):
try:
user_id, current_acl = _get_user_acl(request)
@@ -519,6 +550,23 @@ def schedule_backups(request):
return redirect(loadLoginPage)
def schedule_backupsV2(request):
try:
user_id, current_acl = _get_user_acl(request)
if ACLManager.currentContextPermission(current_acl, 'scheduleBackups') == 0:
return ACLManager.loadError()
websites = ACLManager.findAllSites(current_acl, user_id)
destinations = _get_destinations(local=True)
return def_renderer(request, 'IncBackups/backupScheduleV2.html',
{'websiteList': websites, 'destinations': destinations}, 'scheduleBackups')
except BaseException as msg:
logging.writeToFile(str(msg))
return redirect(loadLoginPage)
def submit_backup_schedule(request):
try:
user_id, current_acl = _get_user_acl(request)
@@ -638,6 +686,23 @@ def restore_remote_backups(request):
return redirect(loadLoginPage)
def restore_remote_backupsV2(request):
try:
user_id, current_acl = _get_user_acl(request)
if ACLManager.currentContextPermission(current_acl, 'createBackup') == 0:
return ACLManager.loadError()
websites = ACLManager.findAllSites(current_acl, user_id)
destinations = _get_destinations()
return def_renderer(request, 'IncBackups/restoreRemoteBackupsV2.html',
{'websiteList': websites, 'destinations': destinations}, 'createBackup')
except BaseException as msg:
logging.writeToFile(str(msg))
return redirect(loadLoginPage)
def save_changes(request):
try:
user_id, current_acl = _get_user_acl(request)
@@ -712,6 +777,7 @@ def add_website(request):
final_json = json.dumps({'status': 0, 'error_message': str(msg)})
return HttpResponse(final_json)
#### Backups v2
def ConfigureV2Backup(request):
@@ -729,18 +795,44 @@ def ConfigureV2Backup(request):
websites = ACLManager.findAllSites(current_acl, user_id)
#
# destinations = _get_destinations(local=True)
proc = httpProc(request, 'IncBackups/ConfigureV2Backup.html', {'websiteList': websites, 'BackupStat': BackupStat})
proc = httpProc(request, 'IncBackups/ConfigureV2Backup.html',
{'websiteList': websites, 'BackupStat': BackupStat})
return proc.render()
except BaseException as msg:
logging.writeToFile(str(msg))
return redirect(loadLoginPage)
def ConfigureV2BackupV2(request):
try:
user_id, current_acl = _get_user_acl(request)
if ACLManager.currentContextPermission(current_acl, 'createBackup') == 0:
return ACLManager.loadError()
if ACLManager.CheckForPremFeature('all'):
BackupStat = 1
else:
BackupStat = 0
websites = ACLManager.findAllSites(current_acl, user_id)
#
# destinations = _get_destinations(local=True)
proc = httpProc(request, 'IncBackups/ConfigureV2BackupV2.html',
{'websiteList': websites, 'BackupStat': BackupStat})
return proc.render()
except BaseException as msg:
logging.writeToFile(str(msg))
return redirect(loadLoginPage)
def ConfigureV2BackupSetup(request):
try:
userID = request.session['userID']
req_data={}
req_data = {}
req_data['name'] = 'GDrive'
req_data['token'] = request.GET.get('t')
req_data['refresh_token'] = request.GET.get('r')
@@ -754,7 +846,6 @@ def ConfigureV2BackupSetup(request):
currentACL = ACLManager.loadedACL(userID)
admin = Administrator.objects.get(pk=userID)
if ACLManager.checkOwnership(website, admin, currentACL) == 1:
pass
else:
@@ -769,9 +860,10 @@ def ConfigureV2BackupSetup(request):
return ConfigureV2Backup(request)
except BaseException as msg:
logging.writeToFile("Error configure"+str(msg))
logging.writeToFile("Error configure" + str(msg))
return redirect(loadLoginPage)
def CreateV2Backup(request):
try:
userID = request.session['userID']
@@ -780,6 +872,16 @@ def CreateV2Backup(request):
except KeyError:
return redirect(loadLoginPage)
def CreateV2BackupV2(request):
try:
userID = request.session['userID']
bm = BackupManager()
return bm.CreateV2backupSiteV2(request, userID)
except KeyError:
return redirect(loadLoginPage)
def CreateV2BackupButton(request):
try:
userID = request.session['userID']
@@ -787,7 +889,6 @@ def CreateV2BackupButton(request):
Selectedwebsite = data['Selectedwebsite']
Selectedrepo = data['Selectedrepo']
currentACL = ACLManager.loadedACL(userID)
admin = Administrator.objects.get(pk=userID)
@@ -796,7 +897,6 @@ def CreateV2BackupButton(request):
else:
return ACLManager.loadError()
extra_args = {}
extra_args['function'] = 'InitiateBackup'
extra_args['website'] = Selectedwebsite
@@ -816,7 +916,7 @@ def CreateV2BackupButton(request):
time.sleep(2)
data_ret = {'status': 1, 'installStatus': 1, 'error_message': 'None',}
data_ret = {'status': 1, 'installStatus': 1, 'error_message': 'None', }
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
@@ -825,6 +925,7 @@ def CreateV2BackupButton(request):
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
def CreateV2BackupStatus(request):
try:
userID = request.session['userID']
@@ -833,6 +934,7 @@ def CreateV2BackupStatus(request):
except KeyError:
return redirect(loadLoginPage)
def RestoreV2backupSite(request):
try:
userID = request.session['userID']
@@ -841,6 +943,7 @@ def RestoreV2backupSite(request):
except KeyError:
return redirect(loadLoginPage)
def RestorePathV2(request):
try:
userID = request.session['userID']
@@ -870,14 +973,13 @@ def RestorePathV2(request):
# extra_args['BackupEmails'] = data['websiteEmails'] if 'websiteEmails' in data else False
# extra_args['BackupDatabase'] = data['websiteDatabases'] if 'websiteDatabases' in data else False
background = CPBackupsV2(extra_args)
background.start()
# vm = CPBackupsV2({'domain': Selectedwebsite, 'BackendName': Selectedrepo, "function": "", 'BasePath': '/home/backup'})
# status = vm.InitiateRestore(SnapShotId, Path)
data_ret = {'status': 1, 'installStatus': 1, 'error_message': 'None',}
data_ret = {'status': 1, 'installStatus': 1, 'error_message': 'None', }
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
@@ -886,6 +988,7 @@ def RestorePathV2(request):
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
def selectwebsiteRetorev2(request):
import re
try:
@@ -901,11 +1004,11 @@ def selectwebsiteRetorev2(request):
else:
return ACLManager.loadError()
obj = Websites.objects.get(domain = str(Selectedwebsite))
#/home/cyberpanel.net/.config/rclone/rclone.conf
path = '/home/%s/.config/rclone/rclone.conf' %(obj.domain)
obj = Websites.objects.get(domain=str(Selectedwebsite))
# /home/cyberpanel.net/.config/rclone/rclone.conf
path = '/home/%s/.config/rclone/rclone.conf' % (obj.domain)
command = 'cat %s'%(path)
command = 'cat %s' % (path)
result = pu.outputExecutioner(command)
if result.find('type') > -1:
@@ -917,7 +1020,6 @@ def selectwebsiteRetorev2(request):
final_json = json.dumps({'status': 0, 'fetchStatus': 0, 'error_message': 'Could not Find repo'})
return HttpResponse(final_json)
# final_json = json.dumps({'status': 1, 'fetchStatus': 1, 'error_message': "None", "data": 1})
# return HttpResponse(final_json)
except BaseException as msg:
@@ -925,6 +1027,7 @@ def selectwebsiteRetorev2(request):
final_json = json.dumps(final_dic)
return HttpResponse(final_json)
def ConfigureSftpV2Backup(request):
try:
userID = request.session['userID']
@@ -949,7 +1052,6 @@ def ConfigureSftpV2Backup(request):
req_data['password'] = sfptpasswd
req_data['Repo_Name'] = Repo_Name
cpbuv2 = CPBackupsV2(
{'domain': Selectedwebsite, 'BasePath': '/home/backup', 'BackupDatabase': 1, 'BackupData': 1,
'BackupEmails': 1, 'BackendName': 'SFTP', 'function': None})
@@ -967,6 +1069,7 @@ def ConfigureSftpV2Backup(request):
final_json = json.dumps(final_dic)
return HttpResponse(final_json)
def selectwebsiteCreatev2(request):
import re
try:
@@ -982,16 +1085,15 @@ def selectwebsiteCreatev2(request):
else:
return ACLManager.loadError()
obj = Websites.objects.get(domain = str(Selectedwebsite))
#/home/cyberpanel.net/.config/rclone/rclone.conf
path = '/home/%s/.config/rclone/rclone.conf' %(obj.domain)
obj = Websites.objects.get(domain=str(Selectedwebsite))
# /home/cyberpanel.net/.config/rclone/rclone.conf
path = '/home/%s/.config/rclone/rclone.conf' % (obj.domain)
command = 'cat %s'%(path)
command = 'cat %s' % (path)
CurrentContent = pu.outputExecutioner(command)
status, currentSchedules = CPBackupsV2.FetchCurrentSchedules(str(Selectedwebsite))
if CurrentContent.find('No such file or directory') > -1:
LocalRclonePath = f'/home/{obj.domain}/.config/rclone'
command = f'mkdir -p {LocalRclonePath}'
@@ -1010,7 +1112,8 @@ def selectwebsiteCreatev2(request):
if result.find('type') > -1:
pattern = r'\[(.*?)\]'
matches = re.findall(pattern, result)
final_json = json.dumps({'status': 1, 'fetchStatus': 1, 'error_message': "None", "data": matches, 'currentSchedules': currentSchedules})
final_json = json.dumps({'status': 1, 'fetchStatus': 1, 'error_message': "None", "data": matches,
'currentSchedules': currentSchedules})
return HttpResponse(final_json)
else:
final_json = json.dumps({'status': 0, 'fetchStatus': 0, 'error_message': 'Could not Find repo'})
@@ -1022,13 +1125,14 @@ def selectwebsiteCreatev2(request):
if result.find('type') > -1:
pattern = r'\[(.*?)\]'
matches = re.findall(pattern, result)
final_json = json.dumps({'status': 1, 'fetchStatus': 1, 'error_message': "None", "data": matches, 'currentSchedules': currentSchedules})
final_json = json.dumps({'status': 1, 'fetchStatus': 1, 'error_message': "None", "data": matches,
'currentSchedules': currentSchedules})
return HttpResponse(final_json)
else:
final_json = json.dumps({'status': 0, 'fetchStatus': 0, 'error_message': 'Could not Find repo', 'currentSchedules': currentSchedules})
final_json = json.dumps({'status': 0, 'fetchStatus': 0, 'error_message': 'Could not Find repo',
'currentSchedules': currentSchedules})
return HttpResponse(final_json)
# logging.writeToFile(str(CurrentContent))
# final_json = json.dumps({'status': 1, 'fetchStatus': 1, 'error_message': "None", "data": None})
# return HttpResponse(final_json)
@@ -1040,12 +1144,13 @@ def selectwebsiteCreatev2(request):
final_json = json.dumps(final_dic)
return HttpResponse(final_json)
def selectreporestorev2(request):
try:
userID = request.session['userID']
data = json.loads(request.body)
Selectedrepo = data['Selectedrepo']
Selectedwebsite= data['Selectedwebsite']
Selectedwebsite = data['Selectedwebsite']
currentACL = ACLManager.loadedACL(userID)
admin = Administrator.objects.get(pk=userID)
@@ -1054,12 +1159,11 @@ def selectreporestorev2(request):
else:
return ACLManager.loadError()
# f'rustic -r testremote snapshots --password "" --json 2>/dev/null'
# final_json = json.dumps({'status': 0, 'fetchStatus': 1, 'error_message': Selectedrepo })
# return HttpResponse(final_json)
vm = CPBackupsV2({'domain': Selectedwebsite, 'BackendName': Selectedrepo, "function":""})
vm = CPBackupsV2({'domain': Selectedwebsite, 'BackendName': Selectedrepo, "function": ""})
status, data = vm.FetchSnapShots()
if status == 1:
@@ -1067,7 +1171,7 @@ def selectreporestorev2(request):
return HttpResponse(final_json)
else:
# final_json = json.dumps({'status': 0, 'fetchStatus': 1, 'error_message': ac,})
final_json = json.dumps({'status': 0, 'fetchStatus': 1, 'error_message': 'Cannot Find!',})
final_json = json.dumps({'status': 0, 'fetchStatus': 1, 'error_message': 'Cannot Find!', })
return HttpResponse(final_json)
@@ -1076,6 +1180,7 @@ def selectreporestorev2(request):
final_json = json.dumps(final_dic)
return HttpResponse(final_json)
def schedulev2Backups(request):
try:
userID = request.session['userID']
@@ -1084,6 +1189,16 @@ def schedulev2Backups(request):
except KeyError:
return redirect(loadLoginPage)
def schedulev2BackupsV2(request):
try:
userID = request.session['userID']
bm = BackupManager()
return bm.schedulev2BackupsV2(request, userID)
except KeyError:
return redirect(loadLoginPage)
def DeleteScheduleV2(request):
try:
userID = request.session['userID']
@@ -1103,8 +1218,8 @@ def DeleteScheduleV2(request):
else:
return ACLManager.loadError()
status, message = CPBackupsV2.DeleteSchedule(Selectedwebsite, repo, frequency, websiteData, websiteDatabases, websiteEmails)
status, message = CPBackupsV2.DeleteSchedule(Selectedwebsite, repo, frequency, websiteData, websiteDatabases,
websiteEmails)
final_dic = {'status': 1, 'error_message': message}
final_json = json.dumps(final_dic)
@@ -1119,6 +1234,7 @@ def DeleteScheduleV2(request):
final_json = json.dumps(final_dic)
return HttpResponse(final_json)
def CreateScheduleV2(request):
try:
userID = request.session['userID']
@@ -1144,8 +1260,8 @@ def CreateScheduleV2(request):
else:
return ACLManager.loadError()
status, message = CPBackupsV2.CreateScheduleV2(Selectedwebsite, repo, frequency, websiteData, websiteDatabases, websiteEmails, retention)
status, message = CPBackupsV2.CreateScheduleV2(Selectedwebsite, repo, frequency, websiteData, websiteDatabases,
websiteEmails, retention)
final_dic = {'status': 1, 'error_message': message}
final_json = json.dumps(final_dic)
@@ -1158,4 +1274,4 @@ def CreateScheduleV2(request):
except BaseException as msg:
final_dic = {'status': 0, 'fetchStatus': 0, 'error_message': str(msg)}
final_json = json.dumps(final_dic)
return HttpResponse(final_json)
return HttpResponse(final_json)

View File

@@ -84,6 +84,12 @@ class BackupManager:
proc = httpProc(request, 'IncBackups/CreateV2Backup.html', {'websiteList': websitesName}, 'createBackup')
return proc.render()
def CreateV2backupSiteV2(self, request=None, userID=None, data=None):
currentACL = ACLManager.loadedACL(userID)
websitesName = ACLManager.findAllSites(currentACL, userID)
proc = httpProc(request, 'IncBackups/CreateV2BackupV2.html', {'websiteList': websitesName}, 'createBackup')
return proc.render()
def schedulev2Backups(self, request=None, userID=None, data=None):
if ACLManager.CheckForPremFeature('all'):
@@ -97,6 +103,19 @@ class BackupManager:
{'websiteList': websitesName, "BackupStat": BackupStat}, 'createBackup')
return proc.render()
def schedulev2BackupsV2(self, request=None, userID=None, data=None):
if ACLManager.CheckForPremFeature('all'):
BackupStat = 1
else:
BackupStat = 0
currentACL = ACLManager.loadedACL(userID)
websitesName = ACLManager.findAllSites(currentACL, userID)
proc = httpProc(request, 'IncBackups/ScheduleV2BackupV2.html',
{'websiteList': websitesName, "BackupStat": BackupStat}, 'createBackup')
return proc.render()
def gDrive(self, request=None, userID=None, data=None):
currentACL = ACLManager.loadedACL(userID)
admin = Administrator.objects.get(pk=userID)
@@ -109,6 +128,18 @@ class BackupManager:
'createBackup')
return proc.render()
def gDriveV2(self, request=None, userID=None, data=None):
currentACL = ACLManager.loadedACL(userID)
admin = Administrator.objects.get(pk=userID)
gDriveAcctsList = []
gDriveAccts = admin.gdrive_set.all()
for items in gDriveAccts:
gDriveAcctsList.append(items.name)
websitesName = ACLManager.findAllSites(currentACL, userID)
proc = httpProc(request, 'backup/googleDriveV2.html', {'accounts': gDriveAcctsList, 'websites': websitesName},
'createBackup')
return proc.render()
def gDriveSetup(self, userID=None, request=None):
try:
currentACL = ACLManager.loadedACL(userID)
@@ -779,6 +810,10 @@ class BackupManager:
proc = httpProc(request, 'backup/backupDestinations.html', {}, 'addDeleteDestinations')
return proc.render()
def backupDestinationsV2(self, request=None, userID=None, data=None):
proc = httpProc(request, 'backup/backupDestinationsV2.html', {}, 'addDeleteDestinations')
return proc.render()
def submitDestinationCreation(self, userID=None, data=None):
try:
currentACL = ACLManager.loadedACL(userID)
@@ -951,6 +986,17 @@ class BackupManager:
'scheduleBackups')
return proc.render()
def scheduleBackupV2(self, request, userID=None, data=None):
currentACL = ACLManager.loadedACL(userID)
destinations = NormalBackupDests.objects.all()
dests = []
for dest in destinations:
dests.append(dest.name)
websitesName = ACLManager.findAllSites(currentACL, userID)
proc = httpProc(request, 'backup/backupScheduleV2.html', {'destinations': dests, 'websites': websitesName},
'scheduleBackups')
return proc.render()
def getCurrentBackupSchedules(self, userID=None, data=None):
try:
currentACL = ACLManager.loadedACL(userID)
@@ -1077,6 +1123,10 @@ class BackupManager:
proc = httpProc(request, 'backup/remoteBackups.html', None, 'remoteBackups')
return proc.render()
def remoteBackupsV2(self, request, userID=None, data=None):
proc = httpProc(request, 'backup/remoteBackupsV2.html', None, 'remoteBackups')
return proc.render()
def submitRemoteBackups(self, userID=None, data=None):
try:
currentACL = ACLManager.loadedACL(userID)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,194 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="backupDestinationsV2" class="p-8">
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
<div class="flex items-center">
<p class="text-4xl font-bold">Set up Backup Destinations -</p>
<a target="_blank"
href="https://go.cyberpanel.net/remote-backup"
style="height: 23px;line-height: 21px;"
class="bg-blue-200 px-2 font-bold mt-2 ml-3"
title=""><span>{% trans "Remote Backups" %}</span></a>
</div>
</div>
<p class="text-xs text-gray-600 py-2 font-semibold">On this page you can set up your Backup destinations. (SFTP)
</p>
<div class="py-4">
<p class="text-xl font-bold">Set up Backup Destinations.</p>
<img ng-hide="cyberpanelLoading"
src="{% static 'images/loading.gif' %}">
</div>
<hr>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Select Type</p>
</div>
<div>
<select ng-change="fetchDetails()" ng-model="destinationType"
class="w-80 bg-gray-100 rounded px-2 py-1">
<option>local</option>
<option>SFTP</option>
</select>
</div>
</div>
<div ng-hide="sftpHide" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Name</p>
</div>
<div>
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="name" required>
</div>
</div>
<div ng-hide="sftpHide" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">IP Address</p>
</div>
<div>
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="IPAddress" required>
</div>
</div>
<div ng-hide="sftpHide" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Username</p>
</div>
<div>
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="userName" required>
</div>
</div>
<div ng-hide="sftpHide" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Password</p>
</div>
<div>
<input placeholder="" type="password" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="password"
required>
</div>
</div>
<div ng-hide="sftpHide" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Port</p>
</div>
<div>
<input placeholder="{% trans "Backup server SSH Port, leave empty for 22." %}"
type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="backupSSHPort" required>
</div>
</div>
<div ng-hide="sftpHide" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Path</p>
</div>
<div>
<input placeholder="Path on remote server to store backups." type="text"
class="w-80 bg-gray-100 rounded px-2 py-1"
ng-model="path" required>
</div>
</div>
<div ng-hide="sftpHide" class="flex justify-center mt-6 mb-2">
<button ng-click="addDestination('SFTP')"
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
Add Destination
</button>
</div>
<hr>
<div ng-hide="sftpHide" class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr>
<th scope="col" class="px-6 py-3">
Name
</th>
<th scope="col" class="px-6 py-3">
IP
</th>
<th scope="col" class="px-6 py-3">
Username
</th>
<th scope="col" class="px-6 py-3">
Path
</th>
<th scope="col" class="px-6 py-3">
Port
</th>
<th scope="col" class="px-6 py-3">
Delete
</th>
</tr>
</thead>
<tbody ng-repeat="record in records track by $index" class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td ng-bind="record.name" class="px-6 py-4">
</td>
<td ng-bind="record.ip" class="px-6 py-4">
</td>
<td ng-bind="record.username" class="px-6 py-4">
</td>
<td ng-bind="record.path" class="px-6 py-4">
</td>
<td ng-bind="record.port" class="px-6 py-4">
</td>
<td ng-click="removeDestination('SFTP', record.name)" class="px-6 py-4">
<img src="{% static 'images/delete.png' %}">
</td>
</tr>
</tbody>
</table>
</div>
<div ng-hide="localHide" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Name</p>
</div>
<div>
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="name" required>
</div>
</div>
<div ng-hide="localHide" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Local Path</p>
</div>
<div>
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="localPath" required>
</div>
</div>
<div ng-hide="localHide" class="flex justify-center mt-6 mb-2">
<button ng-click="addDestination('local')"
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
Add Destination
</button>
</div>
<hr>
<div ng-hide="localHide" class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr>
<th scope="col" class="px-6 py-3">
Name
</th>
<th scope="col" class="px-6 py-3">
Path
</th>
<th scope="col" class="px-6 py-3">
Delete
</th>
</tr>
</thead>
<tbody ng-repeat="record in records track by $index"
class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td ng-bind="record.name" class="px-6 py-4">
</td>
<td ng-bind="record.path" class="px-6 py-4">
</td>
<td ng-click="removeDestination('local', record.name)" class="px-6 py-4">
<img src="{% static 'images/delete.png' %}">
</td>
</tr>
</tbody>
</table>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,299 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="scheduleBackupV2" class="p-8">
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
<div class="flex items-center">
<p class="text-4xl font-bold">Schedule Backup -</p>
<a target="_blank"
href="https://go.cyberpanel.net/remote-backup"
style="height: 23px;line-height: 21px; text-decoration: underline"
class="bg-blue-200 px-2 font-bold mt-2 ml-3"
title=""><span>{% trans "Remote Backups" %}</span></a>
</div>
</div>
<p class="text-xs text-gray-600 py-2 font-semibold">On this page you can schedule Backups to localhost or remote
server (If you have added one)</p>
<div class="py-4">
<p class="text-xl font-bold">Create New Backup Schedule</p>
<img ng-hide="cyberPanelLoading"
src="{% static 'images/loading.gif' %}" alt="cyberPanelLoading">
</div>
<hr>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Select Destination</p>
</div>
<div>
<select ng-model="selectedAccountAdd" class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in destinations %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Name</p>
</div>
<div>
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="name" required>
</div>
</div>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Select Backup Frequency</p>
</div>
<div>
<select ng-model="backupFrequency" class="w-80 bg-gray-100 rounded px-2 py-1">
<option>Never</option>
<option>Daily</option>
<option>Weekly</option>
</select>
</div>
</div>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Select Backup Retention. Leave 0 for no limit</p>
</div>
<div>
<input ng-model="backupRetention" class="w-80 bg-gray-100 rounded px-2 py-1" type="number" value="0">
</div>
</div>
<div class="flex justify-center mt-6">
<button ng-click="addSchedule()"
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
Add Schedule
</button>
</div>
<div class="py-4">
<p class="text-xl font-bold">Manage Existing Backup Schedules</p>
<img ng-hide="cyberPanelLoading"
src="{% static 'images/loading.gif' %}" alt="cyberPanelLoading">
</div>
<hr>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Select Destination</p>
</div>
<div>
<select ng-change="fetchJobs()" ng-model="selectedAccount" class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in destinations %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div ng-hide="jobsHidden" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Select Job</p>
</div>
<div>
<select ng-change="fetchWebsites()" ng-model="selectedJob" class="w-80 bg-gray-100 rounded px-2 py-1">
<option ng-repeat="job in jobs track by $index">{$ job $}</option>
</select>
</div>
<div ng-hide="driveHidden" class="w-80 ml-4">
<button ng-click="deleteAccount()"
class="bg-orange-500 text-white font-semibold px-2 py-1">
Delete
</button>
</div>
</div>
<div ng-hide="driveHidden" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Add Sites for Backup</p>
</div>
<div>
<select ng-model="selectedWebsite" class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in websites %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
<div class="w-80 ml-4">
<button ng-click="addSite('one')"
class="bg-orange-500 text-white font-semibold px-2 py-1">
Add Site
</button>
<button ng-click="addSite('all')"
class="bg-orange-500 text-white font-semibold px-2 py-1">
Add All
</button>
</div>
</div>
<hr>
<div ng-hide="driveHidden" class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr class="bg-gray-200 mt-6 w-full rounded-t-lg border-b-2 border-gray-400">
<th scope="col" class="px-6 py-3">
Last Run
</th>
<th scope="col" class="px-6 py-3">
All Sites
</th>
<th scope="col" class="px-6 py-3">
Frequency ({$ currently $})
</th>
<th scope="col" class="px-6 py-3">
Retention ({$ currently $})
</th>
<th scope="col" class="px-6 py-3">
Current Status
</th>
</tr>
</thead>
<tbody class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td class="px-6 py-4">
{$ lastRun $}
</td>
<td class="px-6 py-4">
{$ allSites $}
</td>
<td class="px-6 py-4 text-red-500 font-bold">
<select ng-change="changeFrequency()" ng-model="backupFrequency"
class="bg-gray-100 rounded">
<option>Never</option>
<option>Daily</option>
<option>Weekly</option>
</select>
</td>
<td class="px-6 py-4">
{$ currentStatus $}
</td>
</tr>
</tbody>
</table>
</div>
<div ng-hide="driveHidden" class="border border-4 p-2 mt-4">
<div class="flex justify-between mt-2">
<div>
<a onclick="return false;" ng-hide="driveHidden" ng-click="fetchLogs()"
class="bg-orange-500 text-white font-bold px-4 py-2"
href="#" data-modal-target="logs" data-modal-toggle="logs"><i class="fa fa-plus-square"
aria-hidden="true"></i> {% trans "View Logs" %}
</a>
<div id="logs" tabindex="-1"
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
<div class="relative p-4 w-full max-w-2xl max-h-full">
<div class="relative bg-white shadow dark:bg-gray-700">
<div class="flex items-center bg-blue-400 px-4 py-4">
<p class="font-bold">Backup Logs</p>
<img ng-hide="cyberPanelLoading"
src="{% static 'images/loading.gif' %}">
<button type="button" data-modal-toggle="logs"
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
data-modal-hide="logs">
<svg class="w-3 h-3" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
</svg>
<span class="sr-only">Close modal</span>
</button>
</div>
<div class="p-4 md:p-5">
<div>
<div class="flex justify-end">
<select ng-model="recordsToShowLogs"
ng-change="fetchLogs()"
class="w-40 bg-gray-100 rounded px-2 py-1" id="example-select">
<option>10</option>
<option>50</option>
<option>100</option>
</select>
</div>
<div class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr class="bg-gray-200 mt-6 w-full rounded-t-lg border-b-2 border-gray-400">
<th scope="col" class="px-6 py-3">
Type
</th>
<th scope="col" class="px-6 py-3">
Message
</th>
</tr>
</thead>
<tbody ng-repeat="log in logs track by $index"
class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td ng-bind="log.type" class="px-6 py-4">
</td>
<td ng-bind="log.message" class="px-6 py-4">
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="flex justify-end p-4 md:p-5">
<select ng-model="currentPageLogs"
class="w-40 bg-gray-100 rounded px-2 py-1"
ng-change="fetchLogs()">
<option ng-repeat="page in paginationLogs">
{$
$index + 1
$}
</option>
</select>
</div>
</div>
</div>
</div>
</div>
<div>
<select ng-model="recordsToShow"
ng-change="fetchWebsites()"
class="w-40 bg-gray-100 rounded px-2 py-1" id="example-select">
<option>10</option>
<option>50</option>
<option>100</option>
</select>
</div>
</div>
<div class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr class="bg-gray-200 mt-6 w-full rounded-t-lg border-b-2 border-gray-400">
<th scope="col" class="px-6 py-3">
Sites
</th>
<th scope="col" class="px-6 py-3">
Action
</th>
</tr>
</thead>
<tbody ng-repeat="website in websites track by $index"
class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td ng-bind="website.name" class="px-6 py-4">
</td>
<td class="px-6 py-4">
<button type="button" ng-click="deleteSite(website.name)"
class="bg-red-500 text-white font-semibold px-2 py-1">{% trans "Delete" %}</button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="flex justify-end">
<select ng-model="currentPage" class="w-40 bg-gray-100 rounded px-2 py-1"
ng-change="fetchWebsites()">
<option ng-repeat="page in pagination">{$ $index + 1
$}
</option>
</select>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,287 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="googleDriveV2" class="p-8">
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
<div class="flex items-center">
<p class="text-4xl font-bold">Set up Google Drive Backups -</p>
<a target="_blank"
href="https://cyberpanel.net/docs/backup-to-google-drive/"
style="height: 23px;line-height: 21px;"
class="bg-blue-200 px-2 font-bold mt-2 ml-3"
title=""><span>{% trans "Remote Backups" %}</span></a>
</div>
</div>
<p class="text-xs text-gray-600 py-2 font-semibold">On this page you can set up and manage Google Drive
Backups.</p>
<hr>
<div class="py-4">
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
<div class="flex items-center">
<p class="text-sm text-gray-600 py-2 font-semibold">On this page you can set up and manage Google
Drive Backups.
<img ng-hide="cyberPanelLoading" src="{% static 'images/loading.gif' %}"></p>
<div>
<a onclick="return false;"
class="bg-red-300 px-2 py-1 font-bold mt-2 ml-3"
href="https://cyberpanel.net/docs/backup-to-google-drive/" data-modal-target="newAccount"
data-modal-toggle="newAccount"><i class="fa fa-plus-square"
aria-hidden="true"></i> {% trans "Setup new Account" %}
</a>
<div id="newAccount" tabindex="-1"
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
<div class="relative p-4 w-full max-w-2xl max-h-full">
<div class="relative bg-white shadow dark:bg-gray-700">
<div class="flex items-center bg-blue-400 px-4 py-4">
<p class="font-bold">Set up account</p>
<img ng-hide="cyberPanelLoading"
src="{% static 'images/loading.gif' %}">
<button type="button" data-modal-toggle="newAccount"
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
data-modal-hide="newAccount">
<svg class="w-3 h-3" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
</svg>
<span class="sr-only">Close modal</span>
</button>
</div>
<div ng-hide="installationDetailsForm" class="p-4 md:p-5">
<div>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-32">Account Name</p>
</div>
<div>
<input name="accountName" type="text"
class="w-80 bg-gray-100 rounded px-2 py-1"
ng-model="accountName">
</div>
</div>
<div class="flex gap-1 justify-end py-2">
<div>
<button ng-click="setupAccount()" type="button"
data-modal-toggle="newAccount" data-modal-hide="newAccount"
class="text-white bg-green-600 hover:bg-green-800 focus:ring-4 focus:outline-none focus:ring-green-300 dark:focus:ring-green-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2">
Save <img
ng-hide="cyberPanelLoading"
src="{% static 'images/loading.gif' %}"></button>
<button ng-disabled="savingSettings" type="button"
data-modal-toggle="newAccount"
data-modal-hide="newAccount"
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2"
data-dismiss="modal">{% trans "Close" %}</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<hr>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Select Drive Account</p>
</div>
<div>
<select ng-change="fetchWebsites()" ng-model="selectedAccount"
class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in accounts %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
<div ng-hide="driveHidden" class="w-80 ml-4">
<button ng-click="deleteAccount()"
class="bg-orange-500 text-white font-semibold px-2 py-1">
Delete
</button>
</div>
</div>
<div ng-hide="driveHidden" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Select Backup Frequency</p>
</div>
<div>
<select ng-change="changeFrequency()" ng-model="backupFrequency"
class="w-80 bg-gray-100 rounded px-2 py-1">
<option>Never</option>
<option>Daily</option>
<option>Weekly</option>
</select>
</div>
<div class="w-80 ml-4">
Currently: {$ currently $}
</div>
</div>
<div ng-hide="driveHidden" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Add Sites for Backup</p>
</div>
<div>
<select ng-model="selectedWebsite" class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in websites %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
<div class="w-80 ml-4">
<button ng-click="addSite()"
class="bg-orange-500 text-white font-semibold px-2 py-1">
Add Site
</button>
</div>
</div>
<div ng-hide="driveHidden" id="checkret" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Backup File Retention
(<a href="https://cyberpanel.net/cyberpanel-addons">Paid Feature</a> )</p>
</div>
<div>
<select id="fileretention" ng-model="Retentiontime" ng-change="changeRetention()"
class="w-80 bg-gray-100 rounded px-2 py-1">
<option value="1d">1 days</option>
<option value="1w"> 1 week</option>
<option value="1m"> 1 month</option>
<option value="6m"> 6 months</option>
</select>
</div>
</div>
<div ng-hide="driveHidden" class="border border-4 p-2 mt-4">
<div class="flex justify-between mt-2">
<div>
<a onclick="return false;" ng-click="fetchLogs()" ng-hide="driveHidden"
class="bg-orange-500 text-white font-bold px-4 py-2"
href="#" data-modal-target="backupLogs" data-modal-toggle="backupLogs"><i
class="fa fa-plus-square"
aria-hidden="true"></i> {% trans "View Logs" %}
</a>
<div id="backupLogs" tabindex="-1"
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
<div class="relative p-4 w-full max-w-2xl max-h-full">
<div class="relative bg-white shadow dark:bg-gray-700">
<div class="flex items-center bg-blue-400 px-4 py-4">
<p class="font-bold">Git Logs</p>
<img ng-hide="cyberPanelLoading"
src="{% static 'images/loading.gif' %}">
<button type="button" data-modal-toggle="backupLogs"
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
data-modal-hide="backupLogs">
<svg class="w-3 h-3" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
</svg>
<span class="sr-only">Close modal</span>
</button>
</div>
<div class="p-4 md:p-5">
<div>
<div class="flex justify-end">
<select ng-model="recordsToShowLogs"
ng-change="fetchLogs()"
class="w-40 bg-gray-100 rounded px-2 py-1" id="example-select">
<option>10</option>
<option>50</option>
<option>100</option>
</select>
</div>
<div class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr class="bg-gray-200 mt-6 w-full rounded-t-lg border-b-2 border-gray-400">
<th scope="col" class="px-6 py-3">
Type
</th>
<th scope="col" class="px-6 py-3">
Message
</th>
</tr>
</thead>
<tbody ng-repeat="log in logs track by $index"
class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td ng-bind="log.type" class="px-6 py-4">
</td>
<td ng-bind="log.message" class="px-6 py-4">
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="flex justify-end p-4 md:p-5">
<select ng-model="currentPageLogs"
class="w-40 bg-gray-100 rounded px-2 py-1"
ng-change="fetchLogs()">
<option ng-repeat="page in paginationLogs">
{$
$index + 1
$}
</option>
</select>
</div>
</div>
</div>
</div>
</div>
<div>
<select ng-model="recordsToShow"
ng-change="fetchWebsites()"
class="w-40 bg-gray-100 rounded px-2 py-1" id="example-select">
<option>10</option>
<option>50</option>
<option>100</option>
</select>
</div>
</div>
<div class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr class="bg-gray-200 mt-6 w-full rounded-t-lg border-b-2 border-gray-400">
<th scope="col" class="px-6 py-3">
Sites
</th>
<th scope="col" class="px-6 py-3">
Action
</th>
</tr>
</thead>
<tbody ng-repeat="website in websites track by $index"
class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td ng-bind="website.name" class="px-6 py-4">
</td>
<td class="px-6 py-4">
<button type="button" ng-click="deleteSite(website.name)"
class="bg-red-500 text-white font-semibold px-2 py-1">{% trans "Delete" %}</button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="flex justify-end">
<select ng-model="currentPage" class="w-40 bg-gray-100 rounded px-2 py-1"
ng-change="fetchWebsites()">
<option ng-repeat="page in pagination">{$ $index + 1
$}
</option>
</select>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,146 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="remoteBackupControlV2" class="p-8">
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
<div class="flex items-center">
<p class="text-4xl font-bold">Remote Backups -</p>
<a target="_blank" href="http://go.cyberpanel.net/remote-transfer"
style="height: 23px;line-height: 21px;" class="bg-blue-200 px-2 font-bold mt-2 ml-3"
title=""><span>{% trans "Remote Transfer" %}</span></a>
</div>
</div>
<p class="text-xs text-gray-600 py-2 font-semibold">This feature can import website(s) from remote server
</p>
<div class="py-4">
<p class="text-xl font-bold">Remote Backups</p>
<img ng-hide="backupLoading" src="{% static 'images/loading.gif' %}">
</div>
<hr>
<p ng-bind="transferStatus"></p>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">IP Address</p>
</div>
<div>
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="IPAddress" required>
</div>
</div>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Password</p>
</div>
<div>
<input ng-change="passwordEnter()" type="password" class="w-80 bg-gray-100 rounded px-2 py-1"
ng-model="password" required>
</div>
</div>
<div ng-hide="backupButton" class="flex justify-center mt-6 mb-2">
<button ng-disabled="fetchAccountsBtn" ng-click="fetchAccountsFromRemoteServer()"
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
Fetch Accounts
</button>
</div>
<div ng-hide="transferBoxBtn">
<div class="flex justify-center mt-6 mb-2">
<button ng-disabled="startTransferbtn" ng-click="startTransfer()"
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
Start Transfer
</button>
</div>
<div class="flex justify-center mt-6 mb-2">
<button ng-disabled="stopTransferbtn" ng-click="cancelRemoteBackup()"
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
Cancel
</button>
</div>
</div>
<div ng-hide="notificationsBox" class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-4">
<div ng-hide="errorMessage"
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{$ error_message $}</p>
</div>
<div ng-hide="couldNotConnect"
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "Could not connect, please refresh this page." %}</p>
</div>
<div ng-hide="accountsFetched"
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
<p>{% trans "Accounts Successfully Fetched from remote server." %}</p>
</div>
<div ng-hide="backupProcessStarted"
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
<p>{% trans "Backup Process successfully started." %}</p>
</div>
<div ng-hide="backupCancelled"
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
<p>{% trans "Backup successfully cancelled." %}</p>
</div>
</div>
</div>
<div ng-hide="accountsInRemoteServerTable" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60"></p>
</div>
<div>
<input type="text" ng-model="accountsSearch" placeholder="{% trans 'Search Accounts..' %}"
class="w-80 bg-gray-100 rounded px-2 py-1">
</div>
</div>
<hr>
<div ng-hide="accountsInRemoteServerTable" class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr>
<th scope="col" class="px-6 py-3">
Website
</th>
<th scope="col" class="px-6 py-3">
PHP
</th>
<th scope="col" class="px-6 py-3">
Package
</th>
<th scope="col" class="px-6 py-3">
Email
</th>
<th scope="col" class="px-6 py-3">
<input ng-model="webSiteStatus" ng-change="allChecked(webSiteStatus)" type="checkbox" value="">
</th>
</tr>
</thead>
<tbody ng-repeat="record in records | filter:accountsSearch"
class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td ng-bind="record.website" class="px-6 py-4">
</td>
<td ng-bind="record.php" class="px-6 py-4">
</td>
<td ng-bind="record.package" class="px-6 py-4">
</td>
<td ng-bind="record.email" class="px-6 py-4">
</td>
<td ng-click="" class="px-6 py-4">
<input ng-model="webSiteStatus" ng-change="addRemoveWebsite(record.website,webSiteStatus)"
type="checkbox" value="">
</td>
</tr>
</tbody>
</table>
</div>
<div ng-hide="backupStatus" class="form-group">
<div class="col-sm-6">
<textarea ng-model="requestData" rows="15" class="form-control"></textarea>
</div>
<div class="col-sm-6">
<textarea ng-model="restoreData" rows="15" class="form-control"></textarea>
</div>
</div>
</div>
{% endblock %}

View File

@@ -9,6 +9,7 @@ urlpatterns = [
url(r'^restoreSite', views.restoreSite, name='restoreSite'),
url(r'^V2/restoreSiteV2', views.restoreSiteV2, name='restoreSiteV2'),
url(r'^gDrive$', views.gDrive, name='gDrive'),
url(r'^V2/gDriveV2$', views.gDriveV2, name='gDriveV2'),
url(r'^gDriveSetup$', views.gDriveSetup, name='gDriveSetup'),
url(r'^fetchgDriveSites$', views.fetchgDriveSites, name='fetchgDriveSites'),
url(r'^addSitegDrive$', views.addSitegDrive, name='addSitegDrive'),
@@ -28,6 +29,7 @@ urlpatterns = [
url(r'^submitRestore', views.submitRestore, name='submitRestore'),
url(r'^backupDestinations', views.backupDestinations, name='backupDestinations'),
url(r'^V2/backupDestinationsV2', views.backupDestinationsV2, name='backupDestinationsV2'),
url(r'^getCurrentBackupDestinations', views.getCurrentBackupDestinations, name='getCurrentBackupDestinations'),
@@ -38,6 +40,7 @@ urlpatterns = [
url(r'^deleteDestination', views.deleteDestination, name='deleteDestination'),
url(r'^scheduleBackup', views.scheduleBackup, name='scheduleBackup'),
url(r'^V2/scheduleBackupV2', views.scheduleBackupV2, name='scheduleBackupV2'),
url(r'^getCurrentBackupSchedules', views.getCurrentBackupSchedules, name='getCurrentBackupSchedules'),
@@ -46,6 +49,7 @@ urlpatterns = [
url(r'^scheduleDelete', views.scheduleDelete, name='scheduleDelete'),
url(r'^remoteBackups', views.remoteBackups, name='remoteBackups'),
url(r'^V2/remoteBackupsV2', views.remoteBackupsV2, name='remoteBackupsV2'),
url(r'^submitRemoteBackups', views.submitRemoteBackups, name='submitRemoteBackups'),
url(r'^getRemoteTransferStatus', views.getRemoteTransferStatus, name='getRemoteTransferStatus'),
url(r'^remoteBackupRestore', views.remoteBackupRestore, name='remoteBackupRestore'),

View File

@@ -51,6 +51,15 @@ def gDrive(request):
return redirect(loadLoginPage)
def gDriveV2(request):
try:
userID = request.session['userID']
bm = BackupManager()
return bm.gDriveV2(request, userID)
except KeyError:
return redirect(loadLoginPage)
def gDriveSetup(request):
try:
userID = request.session['userID']
@@ -238,6 +247,15 @@ def backupDestinations(request):
return redirect(loadLoginPage)
def backupDestinationsV2(request):
try:
userID = request.session['userID']
bm = BackupManager()
return bm.backupDestinationsV2(request, userID)
except KeyError:
return redirect(loadLoginPage)
def submitDestinationCreation(request):
try:
userID = request.session['userID']
@@ -304,6 +322,15 @@ def scheduleBackup(request):
return redirect(loadLoginPage)
def scheduleBackupV2(request):
try:
userID = request.session['userID']
bm = BackupManager()
return bm.scheduleBackupV2(request, userID)
except KeyError:
return redirect(loadLoginPage)
def getCurrentBackupSchedules(request):
try:
userID = request.session['userID']
@@ -360,6 +387,15 @@ def remoteBackups(request):
return redirect(loadLoginPage)
def remoteBackupsV2(request):
try:
userID = request.session['userID']
bm = BackupManager()
return bm.remoteBackupsV2(request, userID)
except KeyError:
return redirect(loadLoginPage)
def submitRemoteBackups(request):
try:
userID = request.session['userID']

View File

@@ -607,35 +607,28 @@
{# #}
{# </div>#}
<ul class="progress-box">
<ul>
<li>
<div class="progress-title">
{% trans "CPU Usage" %}
<b>{$ cpuUsage $}%</b>
</div>
<div class="progressbar-small progressbar" data-value="{$ cpuUsage $}">
<div class="progressbar-value bg-yellow tooltip-button" title="{$ cpuUsage $}%">
<div>
<p class="font-semibold">CPU Usage</p>
<div class="radial-progress bg-gray-200 text-orange-500"
style="--value:{$ cpuUsage $};" role="progressbar">{$ cpuUsage $}%
</div>
</div>
</li>
<li>
<b class="pull-right">{$ ramUsage $}%</b>
<div class="progress-title">
{% trans "RAM Usage" %}
</div>
<div class="progressbar-small progressbar" data-value="{$ ramUsage $}">
<div class="progressbar-value bg-red tooltip-button" title="{$ ramUsage $}%"></div>
<div>
<p class="font-semibold">RAM Usage</p>
<div class="radial-progress bg-gray-200 text-orange-500"
style="--value:{$ ramUsage $};" role="progressbar">{$ ramUsage $}%
</div>
</div>
</li>
<li>
<div class="progress-title">
{% trans "Disk Usage" %}
<b>{$ diskUsage $}%</b>
</div>
<div class="progressbar" data-value="{$ diskUsage $}">
<div class="progressbar-value bg-green">
<div class="progress-label">{$ diskUsage $}%</div>
<div>
<p class="font-semibold">Disk Usage</p>
<div class="radial-progress bg-gray-200 text-orange-500"
style="--value:{$ diskUsage $};" role="progressbar">{$ diskUsage $}%
</div>
</div>
</li>

View File

@@ -8,6 +8,7 @@
<title>{% block titleNew %}Page Title{% endblock %}</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/flowbite@1.3.4/dist/flowbite.js"></script>
<link href="https://cdn.jsdelivr.net/npm/daisyui@4.7.2/dist/full.min.css" rel="stylesheet" type="text/css"/>
{% load static %}
<script src="{% static 'baseTemplate/angularjs.1.6.5.js' %}"></script>
@@ -366,7 +367,7 @@
Restore Backups</a>
</li>
<li>
<a href="#"
<a href="{% url 'RemoteBackupConfigV2' %}"
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">
Remote Backup</a>
</li>
@@ -775,17 +776,17 @@
</div>
<ul id="dropdown-example-9" class="hidden py-2 space-y-2">
<li>
<a href="#"
<a href="{% url 'CreateV2BackupV2' %}"
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">
Create/Restore V2 Backup</a>
</li>
<li>
<a href="#"
<a href="{% url 'ConfigureV2BackupV2' %}"
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">
Configure Backend</a>
</li>
<li>
<a href="#"
<a href="{% url 'schedulev2BackupsV2' %}"
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">
Schedule V2 Backup</a>
</li>
@@ -827,22 +828,22 @@
Restore Backup</a>
</li>
<li>
<a href="#"
<a href="{% url 'backupDestinationsV2' %}"
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">
Add/Delete Backup</a>
</li>
<li>
<a href="#"
<a href="{% url 'scheduleBackupV2' %}"
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">
Schedule Backup</a>
</li>
<li>
<a href="#"
<a href="{% url 'gDriveV2' %}"
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">
Setup Google Drive</a>
</li>
<li>
<a href="#"
<a href="{% url 'remoteBackupsV2' %}"
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">
Remote Backups</a>
</li>
@@ -876,22 +877,22 @@
</div>
<ul id="dropdown-example-11" class="hidden py-2 space-y-2">
<li>
<a href="#"
<a href="{% url 'createBackupIncV2' %}"
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">
Create/Restore Backup</a>
</li>
<li>
<a href="#"
<a href="{% url 'backupDestinationsIncV2' %}"
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">
Add/Remove Destination</a>
</li>
<li>
<a href="#"
<a href="{% url 'scheduleBackupsIncV2' %}"
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">
Schedule Backups</a>
</li>
<li>
<a href="#"
<a href="{% url 'restoreRemoteBackupsIncV2' %}"
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">
Restore from Remote</a>
</li>
@@ -930,7 +931,7 @@
</div>
<ul id="dropdown-example-12" class="hidden py-2 space-y-2">
<li>
<a href="#"
<a href="{% url 'v2ManageSSLV2' %}"
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">
Manage SSL V2</a>
</li>
@@ -969,17 +970,17 @@
</div>
<ul id="dropdown-example-13" class="hidden py-2 space-y-2">
<li>
<a href="#"
<a href="{% url 'manageSSLV2' %}"
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">
Manage SSL</a>
</li>
<li>
<a href="#"
<a href="{% url 'sslForHostNameV2' %}"
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">
Hostname SSL</a>
</li>
<li>
<a href="#"
<a href="{% url 'sslForMailServerV2' %}"
class="flex items-center w-full text-base font-normal text-white transition duration-75 rounded-lg group hover:bg-cyan-400 dark:text-white dark:hover:bg-gray-700 pl-11">
MailServer SSL</a>
</li>
@@ -1691,6 +1692,9 @@
<script src="{% static 'filemanager/js/fileManagerV2.js' %}"></script>
<script src="{% static 'ftp/ftpV2.js' %}"></script>
<script src="{% static 'backup/backupV2.js' %}"></script>
<script src="{% static 'emailMarketing/emailMarketingV2.js' %}"></script>
<script src="{% static 'IncBackups/IncBackupsV2.js' %}"></script>
<script src="{% static 'manageSSL/manageSSLV2.js' %}"></script>
</body>
</html>

View File

@@ -11,6 +11,13 @@
<p class="text-4xl font-bold">List Database</p>
<p class="text-xs text-gray-600 py-2 font-semibold">List databases or change their passwords.</p>
</div>
<div>
<div class="sm:mt-6">
<a href="{% url 'createDatabaseV2' %}"
class="bg-orange-500 px-3 py-3 rounded-lg text-xl font-semibold text-white">Create Database
</a>
</div>
</div>
</div>
<div class="py-4">
<p class="text-xl font-bold">List Database</p>
@@ -129,132 +136,166 @@
class="bg-orange-500 text-white font-semibold px-2 py-1">{% trans "Change" %}</button>
</td>
<td class="px-6 py-4">
<button ng-click="remoteAccess(record.dbUser)" data-toggle="modal"
data-target="#remoteAccess" type="button"
class="bg-orange-500 text-white font-semibold px-2 py-1">{% trans "Manage" %}</button>
{# <a onclick="return false;"#}
{# ng-click="remoteAccess(record.dbUser)"#}
{# class="bg-orange-500 text-white font-semibold px-2 py-1"#}
{# href="#" data-modal-target="edit"#}
{# data-modal-toggle="edit">{% trans "Manage" %}#}
{# </a>#}
{# <div id="edit" tabindex="-1"#}
{# class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">#}
{# <div class="relative p-4 w-full max-w-2xl max-h-full">#}
{# <div class="relative bg-white shadow dark:bg-gray-700">#}
{# <div class="flex items-center bg-blue-400 px-4 py-4">#}
{# <p class="font-bold">Remote Access</p>#}
{# <img ng-hide="dbLoading"#}
{# src="{% static 'images/loading.gif' %}">#}
{# <button type="button" data-modal-toggle="edit"#}
{# class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"#}
{# data-modal-hide="edit">#}
{# <svg class="w-3 h-3" aria-hidden="true"#}
{# xmlns="http://www.w3.org/2000/svg" fill="none"#}
{# viewBox="0 0 14 14">#}
{# <path stroke="currentColor" stroke-linecap="round"#}
{# stroke-linejoin="round" stroke-width="2"#}
{# d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>#}
{# </svg>#}
{# <span class="sr-only">Close modal</span>#}
{# </button>#}
{# </div>#}
{# <div class="p-4 md:p-5">#}
{# <form name="containerSettingsForm">#}
{# <div ng-hide="installationDetailsForm"#}
{# class="flex mt-4 py-2 px-6">#}
{# <div>#}
{# <p class="font-semibold w-60">Allow Remote Access on following#}
{# IP</p>#}
{# </div>#}
{# <div>#}
{# <input placeholder="IP Address"#}
{# name="remoteIP" type="text"#}
{# class="w-80 bg-gray-100 rounded px-2 py-1"#}
{# ng-model="$parent.remoteIP"#}
{# required>#}
{# </div>#}
{# </div>#}
{# </form>#}
{# <div class="flex justify-center mt-3">#}
{# <button ng-click="allowRemoteIP()"#}
{# class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">#}
{# Save Changes#}
{# </button>#}
{# </div>#}
{# <div class="relative py-5 overflow-x-auto">#}
{# <table class="w-full text-sm text-left rtl:text-right">#}
{# <thead>#}
{# <tr>#}
{# <th scope="col" class="px-6 py-3">#}
{# Username#}
{# </th>#}
{# <th scope="col" class="px-6 py-3">#}
{# Host#}
{# </th>#}
{# </tr>#}
{# </thead>#}
{# <tbody class="border shadow-lg py-3 px-6 rounded-b-lg">#}
{# <tr>#}
{# <td class="px-6 py-4">#}
{# {$ dbUsername $}#}
{# </td>#}
{# <td class="px-6 py-4">#}
{# {$ dbHost $}#}
{# </td>#}
{# </tr>#}
{# </tbody>#}
{# </table>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
</td>
</tr>
</tbody>
</table>
</div>
</div>
{# <div>#}
{# <button ng-click="deleteUserInitial(record.name)" data-modal-target="DeleteListUser"#}
{# data-modal-toggle="DeleteListUser"#}
{# class="bg-orange-500 px-2 py-1 text-white"#}
{# type="button">#}
{# Delete#}
{# </button>#}
{##}
{# <div id="DeleteListUser" tabindex="-1"#}
{# class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">#}
{# <div class="relative p-4 w-full max-w-md max-h-full">#}
{# <div class="relative bg-white rounded-lg shadow dark:bg-gray-700">#}
{# <button type="button" data-modal-toggle="DeleteListUser"#}
{# class="absolute top-3 end-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white"#}
{# data-modal-hide="DeleteListUser">#}
{# <svg class="w-3 h-3" aria-hidden="true"#}
{# xmlns="http://www.w3.org/2000/svg" fill="none"#}
{# viewBox="0 0 14 14">#}
{# <path stroke="currentColor" stroke-linecap="round"#}
{# stroke-linejoin="round" stroke-width="2"#}
{# d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>#}
{# </svg>#}
{# <span class="sr-only">Close modal</span>#}
{# </button>#}
{# <div class="p-4 md:p-5 text-center">#}
{# <svg class="mx-auto mb-4 text-gray-400 w-12 h-12 dark:text-gray-200"#}
{# aria-hidden="true"#}
{# xmlns="http://www.w3.org/2000/svg" fill="none"#}
{# viewBox="0 0 20 20">#}
{# <path stroke="currentColor" stroke-linecap="round"#}
{# stroke-linejoin="round" stroke-width="2"#}
{# d="M10 11V6m0 8h.01M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/>#}
{# </svg>#}
{# <h3 class="mb-5 text-lg font-normal text-gray-500 dark:text-gray-400">#}
{# Are you sure you want to#}
{# delete this user {$ UserToDelete $} ?</h3>#}
{# <button ng-click="deleteUserFinal()" data-modal-hide="DeleteListUser" type="button"#}
{# data-modal-toggle="DeleteListUser"#}
{# class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2">#}
{# Yes, I'm sure#}
{# </button>#}
{# <button data-modal-hide="DeleteListUser" type="button"#}
{# data-modal-toggle="DeleteListUser"#}
{# class="text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600">#}
{# No, cancel#}
{# </button>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# <div>#}
{# <button ng-click="editInitial(record.name)" data-modal-target="EditListUser"#}
{# data-modal-toggle="EditListUser"#}
{# class="bg-orange-500 px-2 py-1 text-white"#}
{# type="button">#}
{# Edit#}
{# </button>#}
{##}
{# <div id="EditListUser" tabindex="-1"#}
{# class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">#}
{# <div>#}
{# <div class="relative bg-white rounded-lg shadow dark:bg-gray-700">#}
{# <h2 class="px-4 py-4 font-bold text-xl">Edit Users</h2>#}
{# <button type="button" data-modal-toggle="EditListUser"#}
{# class="absolute top-3 end-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white"#}
{# data-modal-hide="EditListUser">#}
{# <svg class="w-3 h-3" aria-hidden="true"#}
{# xmlns="http://www.w3.org/2000/svg" fill="none"#}
{# viewBox="0 0 14 14">#}
{# <path stroke="currentColor" stroke-linecap="round"#}
{# stroke-linejoin="round" stroke-width="2"#}
{# d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>#}
{# </svg>#}
{# <span class="sr-only">Close modal</span>#}
{# </button>#}
{# <div class="p-4">#}
{# <div ng-hide="installationDetailsForm" class="flex mt-4 py-2 px-6">#}
{# <div>#}
{# <p class="font-semibold w-60">Name</p>#}
{# </div>#}
{# <div>#}
{# <input name="name" type="text" class="w-80 bg-gray-100 rounded px-2 py-1"#}
{# ng-model="name" readonly>#}
{# </div>#}
{# </div>#}
{# <div class="flex py-2 px-6">#}
{# <div>#}
{# <p class="font-semibold w-60">New Owner</p>#}
{# </div>#}
{# <div>#}
{# <select ng-change="saveResellerChanges()"#}
{# ng-model="$parent.newOwner"#}
{# class="w-80 bg-gray-100 rounded px-2 py-1">#}
{# {% for items in resellerPrivUsers %}#}
{# <option>{{ items }}</option>#}
{# {% endfor %}#}
{# </select>#}
{# </div>#}
{# </div>#}
{# <div class="flex py-2 px-6">#}
{# <div>#}
{# <p class="font-semibold w-60">Select ACL</p>#}
{# </div>#}
{# <div>#}
{# <select ng-change="changeACLFunc()"#}
{# ng-model="$parent.selectedACL"#}
{# class="w-80 bg-gray-100 rounded px-2 py-1">#}
{# {% for items in aclNames %}#}
{# <option>{{ items }}</option>#}
{# {% endfor %}#}
{# </select>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
<a onclick="return false;"
ng-click="remoteAccess(record.dbUser)"
class="bg-orange-500 text-white font-semibold px-2 py-1"
href="#" data-modal-target="edit"
data-modal-toggle="edit">{% trans "Manage" %}
</a>
<div id="edit" tabindex="-1"
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
<div class="relative p-4 w-full max-w-2xl max-h-full">
<div class="relative bg-white shadow dark:bg-gray-700">
<div class="flex items-center bg-blue-400 px-4 py-4">
<p class="font-bold">Remote Access</p>
<img ng-hide="dbLoading"
src="{% static 'images/loading.gif' %}">
<button type="button" data-modal-toggle="edit"
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
data-modal-hide="edit">
<svg class="w-3 h-3" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
</svg>
<span class="sr-only">Close modal</span>
</button>
</div>
<div class="p-4 md:p-5">
<form name="containerSettingsForm">
<div ng-hide="installationDetailsForm"
class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Allow Remote Access on following
IP</p>
</div>
<div>
<input placeholder="IP Address"
name="remoteIP" type="text"
class="w-80 bg-gray-100 rounded px-2 py-1"
ng-model="$parent.remoteIP"
required>
</div>
</div>
</form>
<div class="flex justify-center mt-3">
<button ng-click="allowRemoteIP()"
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
Save Changes
</button>
</div>
<div class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr>
<th scope="col" class="px-6 py-3">
Username
</th>
<th scope="col" class="px-6 py-3">
Host
</th>
</tr>
</thead>
<tbody class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td class="px-6 py-4">
{$ dbUsername $}
</td>
<td class="px-6 py-4">
{$ dbHost $}
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -7,11 +7,16 @@
<div ng-controller="addModifyDNSRecordsCloudFlareV2" class="p-8">
<div>
<p class="text-4xl font-bold">Add/Modify DNS Zone</p>
<div class="flex items-center">
<p class="text-4xl font-bold">Add/Modify DNS Zone -</p>
<a target="_blank" href="http://go.cyberpanel.net/dns-records"
class="bg-blue-200 px-2 font-bold mt-2 ml-3"
title=""><span>{% trans "DNS Docs" %}</span></a>
</div>
<p class="text-xs text-gray-600 py-2 font-semibold">On this page you can add/modify dns records for domains
whose dns zone is already created.</p>
</div>
<div class="py-4">
<div class="flex items-center py-4">
<p class="text-xl font-bold">Add Records</p>
<img ng-hide="recordsLoading" src="{% static 'images/loading.gif' %}">
</div>

View File

@@ -7,7 +7,12 @@
<div ng-controller="addModifyDNSRecordsV2" class="p-8">
<div>
<p class="text-4xl font-bold">Add/Modify DNS Zone</p>
<div class="flex items-center">
<p class="text-4xl font-bold">Add/Modify DNS Zone -</p>
<a target="_blank" href="http://go.cyberpanel.net/dns-records"
class="bg-blue-200 px-2 font-bold mt-2 ml-3"
title=""><span>{% trans "DNS Docs" %}</span></a>
</div>
<p class="text-xs text-gray-600 py-2 font-semibold">On this page you can add/modify dns records for domains
whose dns zone is already created.</p>
</div>
@@ -28,7 +33,7 @@
</div>
{% else %}
<div>
<div class="py-4">
<div class="flex items-center py-4">
<p class="text-xl font-bold">Add Records</p>
<img ng-hide="recordsLoading" src="{% static 'images/loading.gif' %}">
</div>

View File

@@ -7,7 +7,11 @@
<div ng-controller="configureDefaultNameserversV2" class="p-8">
<div>
<p class="text-4xl font-bold">Configure Default Nameserver</p>
<div class="flex items-center">
<p class="text-4xl font-bold">Configure Default Nameserver -</p>
<a target="_blank" href="http://go.cyberpanel.net/dns-records"
class="bg-blue-200 px-2 font-bold mt-2 ml-3" title=""><span>{% trans "DNS Docs" %}</span></a>
</div>
<p class="text-xs text-gray-600 py-2 font-semibold">You can use this page to setup nameservers using which
people on the internet can resolve websites hosted on this server.</p>
</div>
@@ -27,7 +31,7 @@
</div>
{% else %}
<div>
<div class="py-4">
<div class="flex items-center py-4">
<p class="text-xl font-bold">Details</p>
<img ng-hide="cyberPanelLoading" src="{% static 'images/loading.gif' %}">
</div>

View File

@@ -6,8 +6,10 @@
{% load static %}
<div ng-controller="createDNSZoneV2" class="p-8">
<div>
<p class="text-4xl font-bold">Create DNS Zone</p>
<div class="flex items-center">
<p class="text-4xl font-bold">Create DNS Zone -</p>
<a target="_blank" href="http://go.cyberpanel.net/dns-records"
class="bg-blue-200 px-2 font-bold mt-2 ml-3" title=""><span>{% trans "DNS Docs" %}</span></a>
</div>
<p class="text-xs text-gray-600 py-2 font-semibold">This page is used to create DNS zone, to edit dns
zone you can visit Modify DNS Zone Page.</p>
@@ -27,7 +29,7 @@
</div>
{% else %}
<div>
<div class="py-4">
<div class="flex items-center py-4">
<p class="text-xl font-bold">Details</p>
<img ng-hide="createDNSZoneLoading" src="{% static 'images/loading.gif' %}">
</div>

View File

@@ -7,7 +7,12 @@
<div ng-controller="createNameserverV2" class="p-8">
<div>
<p class="text-4xl font-bold">Create NameServer</p>
<div class="flex items-center">
<p class="text-4xl font-bold">Create NameServer -</p>
<a target="_blank" href="http://go.cyberpanel.net/dns-records"
class="bg-blue-200 px-2 font-bold mt-2 ml-3"
title=""><span>{% trans "DNS Docs" %}</span></a>
</div>
<p class="text-xs text-gray-600 py-2 font-semibold">You can use this page to setup nameservers using
which
people on the internet can resolve websites hosted on this server.</p>
@@ -66,7 +71,6 @@
<input value="IP Address for first nameserver." name="firstNSIP" type="text"
class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="firstNSIP" required>
</div>
<div class="text-orange-500 font-semibold ml-3"><p>{% trans "MB (0 = Unlimited)" %}</p></div>
</div>
<div class="flex py-2 px-6">
<div>

View File

@@ -6,8 +6,10 @@
{% load static %}
<div ng-controller="deleteDNSZoneV2" class="p-8">
<div>
<p class="text-4xl font-bold">Delete DNS Zone</p>
<div class="flex items-center">
<p class="text-4xl font-bold">Delete DNS Zone -</p>
<a target="_blank" href="http://go.cyberpanel.net/dns-records"
class="bg-blue-200 px-2 font-bold mt-2 ml-3" title=""><span>{% trans "DNS Docs" %}</span></a>
</div>
<p class="text-xs text-gray-600 py-2 font-semibold">This page can be used to delete DNS Zone. Deleting
the DNS zone will remove all its related records as well.</p>
@@ -28,7 +30,7 @@
{% else %}
<div>
<div class="py-4">
<p class="text-xl font-bold">Details</p>
<p class="text-xl font-bold">Delete DNS Zone</p>
</div>
<hr>
<div id="createPackages">

View File

@@ -14,9 +14,10 @@ from .models import SMTPHosts, EmailTemplate
from loginSystem.models import Administrator
from .emACL import emACL
class EmailMarketingManager:
def __init__(self, request = None, domain = None):
def __init__(self, request=None, domain=None):
self.request = request
self.domain = domain
@@ -118,6 +119,25 @@ class EmailMarketingManager:
except KeyError as msg:
return redirect(loadLoginPage)
def createEmailListV2(self):
try:
userID = self.request.session['userID']
currentACL = ACLManager.loadedACL(userID)
admin = Administrator.objects.get(pk=userID)
if ACLManager.checkOwnership(self.domain, admin, currentACL) == 1:
pass
else:
return ACLManager.loadError()
if emACL.checkIfEMEnabled(admin.userName) == 0:
return ACLManager.loadError()
proc = httpProc(self.request, 'emailMarketing/createEmailListV2.html', {'domain': self.domain})
return proc.render()
except KeyError as msg:
return redirect(loadLoginPage)
def submitEmailList(self):
try:
@@ -170,7 +190,8 @@ class EmailMarketingManager:
listNames = emACL.getEmailsLists(self.domain)
proc = httpProc(self.request, 'emailMarketing/manageLists.html', {'listNames': listNames, 'domain': self.domain})
proc = httpProc(self.request, 'emailMarketing/manageLists.html',
{'listNames': listNames, 'domain': self.domain})
return proc.render()
except KeyError as msg:
@@ -256,7 +277,8 @@ class EmailMarketingManager:
verified = emailList.verified
notVerified = emailList.notVerified
data_ret = {'status': 1, 'logs': json_data, 'pagination': pagination, 'totalEmails': totalEmail, 'verified': verified, 'notVerified': notVerified}
data_ret = {'status': 1, 'logs': json_data, 'pagination': pagination, 'totalEmails': totalEmail,
'verified': verified, 'notVerified': notVerified}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
@@ -495,6 +517,33 @@ class EmailMarketingManager:
except KeyError as msg:
return redirect(loadLoginPage)
def manageSMTPV2(self):
try:
userID = self.request.session['userID']
currentACL = ACLManager.loadedACL(userID)
admin = Administrator.objects.get(pk=userID)
if ACLManager.checkOwnership(self.domain, admin, currentACL) == 1:
pass
else:
return ACLManager.loadError()
if emACL.checkIfEMEnabled(admin.userName) == 0:
return ACLManager.loadError()
website = Websites.objects.get(domain=self.domain)
emailLists = website.emaillists_set.all()
listNames = []
for items in emailLists:
listNames.append(items.listName)
proc = httpProc(self.request, 'emailMarketing/manageSMTPHostsV2.html',
{'listNames': listNames, 'domain': self.domain})
return proc.render()
except KeyError as msg:
return redirect(loadLoginPage)
def saveSMTPHost(self):
try:
userID = self.request.session['userID']
@@ -503,7 +552,6 @@ class EmailMarketingManager:
if emACL.checkIfEMEnabled(admin.userName) == 0:
return ACLManager.loadErrorJson()
data = json.loads(self.request.body)
smtpHost = data['smtpHost']
@@ -694,7 +742,8 @@ class EmailMarketingManager:
return ACLManager.loadErrorJson()
admin = Administrator.objects.get(pk=userID)
newTemplate = EmailTemplate(owner=admin, name=name.replace(' ', ''), subject=subject, fromName=fromName, fromEmail=fromEmail,
newTemplate = EmailTemplate(owner=admin, name=name.replace(' ', ''), subject=subject, fromName=fromName,
fromEmail=fromEmail,
replyTo=replyTo, emailMessage=emailMessage)
newTemplate.save()
@@ -719,7 +768,6 @@ class EmailMarketingManager:
hostNames = emACL.allSMTPHosts(currentACL, admin)
listNames = emACL.allEmailsLists(currentACL, admin)
Data = {}
Data['templateNames'] = templateNames
Data['hostNames'] = hostNames
@@ -896,4 +944,4 @@ class EmailMarketingManager:
except:
pass
return HttpResponse('Email Address Successfully removed from the list.')
return HttpResponse('Email Address Successfully removed from the list.')

View File

@@ -0,0 +1,395 @@
var emailListURL = "/emailMarketing/" + $("#domainNamePageV2").text() + "/emailListsV2";
$("#emailListsV2").attr("href", emailListURL);
$("#emailListsChildV2").attr("href", emailListURL);
newapp.controller('createEmailListV2', function ($scope, $http, $timeout) {
$scope.installationDetailsForm = false;
$scope.installationProgress = true;
$scope.cyberPanelLoading = true;
$scope.goBackDisable = true;
var statusFile;
var path;
$scope.goBack = function () {
$scope.installationDetailsForm = false;
$scope.installationProgress = true;
$scope.cyberPanelLoading = true;
$scope.goBackDisable = true;
$("#installProgress").css("width", "0%");
};
$scope.createEmailList = function () {
$scope.installationDetailsForm = true;
$scope.installationProgress = false;
$scope.cyberPanelLoading = false;
$scope.goBackDisable = true;
$scope.currentStatus = "Starting to load email addresses..";
url = "/emailMarketing/submitEmailList";
var data = {
domain: $("#domainNamePage").text(),
path: $scope.path,
listName: $scope.listName
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
if (response.data.status === 1) {
statusFile = response.data.tempStatusPath;
getInstallStatus();
} else {
$scope.installationDetailsForm = true;
$scope.cyberPanelLoading = true;
$scope.goBackDisable = false;
new PNotify({
title: 'Operation Failed!',
text: response.data.error_message,
type: 'error'
});
}
}
function cantLoadInitialDatas(response) {
$scope.cyberPanelLoading = true;
new PNotify({
title: 'Operation Failed!',
text: 'Could not connect to server, please refresh this page',
type: 'error'
});
}
};
function getInstallStatus() {
url = "/websites/installWordpressStatus";
var data = {
statusFile: statusFile,
domainName: $("#domainNamePage").text()
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
if (response.data.abort === 1) {
if (response.data.installStatus === 1) {
$scope.installationDetailsForm = true;
$scope.installationProgress = false;
$scope.cyberPanelLoading = true;
$scope.goBackDisable = false;
$scope.currentStatus = 'Emails successfully loaded.';
$timeout.cancel();
} else {
$scope.installationDetailsForm = true;
$scope.installationProgress = false;
$scope.cyberPanelLoading = true;
$scope.goBackDisable = false;
$scope.currentStatus = response.data.error_message;
}
} else {
$scope.installPercentage = response.data.installationProgress;
$scope.currentStatus = response.data.currentStatus;
$timeout(getInstallStatus, 1000);
}
}
function cantLoadInitialDatas(response) {
$scope.cyberPanelLoading = true;
new PNotify({
title: 'Operation Failed!',
text: 'Could not connect to server, please refresh this page',
type: 'error'
});
}
}
$scope.fetchEmails = function () {
$scope.cyberPanelLoading = false;
url = "/emailMarketing/fetchEmails";
var data = {'listName': $scope.listName};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
$scope.cyberPanelLoading = true;
if (response.data.status === 1) {
$scope.records = JSON.parse(response.data.data);
} else {
new PNotify({
title: 'Operation Failed!',
text: response.data.error_message,
type: 'error'
});
}
}
function cantLoadInitialDatas(response) {
$scope.cyberPanelLoading = false;
new PNotify({
title: 'Operation Failed!',
text: 'Could not connect to server, please refresh this page',
type: 'error'
});
}
};
});
newapp.controller('composeMessageCTRLV2', function ($scope, $http) {
$scope.cyberPanelLoading = true;
$scope.saveTemplate = function (status, userName) {
$scope.cyberPanelLoading = false;
url = "/emailMarketing/saveEmailTemplate";
var data = {
name: $scope.name,
subject: $scope.subject,
fromName: $scope.fromName,
fromEmail: $scope.fromEmail,
replyTo: $scope.replyTo,
emailMessage: $scope.emailMessage
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
$scope.cyberPanelLoading = true;
if (response.data.status === 1) {
new PNotify({
title: 'Success!',
text: 'Template successfully saved.',
type: 'success'
});
} else {
new PNotify({
title: 'Operation Failed!',
text: response.data.error_message,
type: 'error'
});
}
}
function cantLoadInitialDatas(response) {
$scope.cyberPanelLoading = false;
new PNotify({
title: 'Operation Failed!',
text: 'Could not connect to server, please refresh this page',
type: 'error'
});
}
};
});
newapp.controller('manageSMTPHostsCTRLV2', function ($scope, $http) {
$scope.cyberPanelLoading = true;
$scope.fetchSMTPHosts = function () {
$scope.cyberPanelLoading = false;
url = "/emailMarketing/fetchSMTPHosts";
var data = {};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
$scope.cyberPanelLoading = true;
if (response.data.status === 1) {
$scope.records = JSON.parse(response.data.data);
} else {
new PNotify({
title: 'Operation Failed!',
text: response.data.error_message,
type: 'error'
});
}
}
function cantLoadInitialDatas(response) {
$scope.cyberPanelLoading = false;
new PNotify({
title: 'Operation Failed!',
text: 'Could not connect to server, please refresh this page',
type: 'error'
});
}
};
$scope.fetchSMTPHosts();
$scope.saveSMTPHost = function (status, userName) {
$scope.cyberPanelLoading = false;
url = "/emailMarketing/saveSMTPHost";
var data = {
smtpHost: $scope.smtpHost,
smtpPort: $scope.smtpPort,
smtpUserName: $scope.smtpUserName,
smtpPassword: $scope.smtpPassword
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
$scope.cyberPanelLoading = true;
if (response.data.status === 1) {
$scope.fetchSMTPHosts();
new PNotify({
title: 'Success!',
text: 'Successfully saved new SMTP host.',
type: 'success'
});
} else {
new PNotify({
title: 'Operation Failed!',
text: response.data.error_message,
type: 'error'
});
}
}
function cantLoadInitialDatas(response) {
$scope.cyberPanelLoading = false;
new PNotify({
title: 'Operation Failed!',
text: 'Could not connect to server, please refresh this page',
type: 'error'
});
}
};
$scope.smtpHostOperations = function (operation, id) {
$scope.cyberPanelLoading = false;
url = "/emailMarketing/smtpHostOperations";
var data = {
id: id,
operation: operation
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
$scope.cyberPanelLoading = true;
$scope.fetchSMTPHosts();
if (response.data.status === 1) {
new PNotify({
title: 'Success!',
text: response.data.message,
type: 'success'
});
} else {
new PNotify({
title: 'Operation Failed!',
text: response.data.error_message,
type: 'error'
});
}
}
function cantLoadInitialDatas(response) {
$scope.cyberPanelLoading = false;
new PNotify({
title: 'Operation Failed!',
text: 'Could not connect to server, please refresh this page',
type: 'error'
});
}
};
});

View File

@@ -0,0 +1,79 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="composeMessageCTRLV2" class="p-8">
<div>
<p class="text-4xl font-bold">Compose Email Message</p>
<p class="text-xs text-gray-600 py-2 font-semibold">On this page you can compose email message to be sent
out later.</p>
</div>
<div class="py-4">
<p class="text-xl font-bold">Compose Email Message</p>
<img ng-hide="cyberPanelLoading" src="{% static 'images/loading.gif' %}">
</div>
<hr>
<div>
<div>
<div ng-hide="installationDetailsForm">
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-48">Template Name</p>
</div>
<div>
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="name" required>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Email Subject</p>
</div>
<div>
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="subject" required>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">From Name</p>
</div>
<div>
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="fromName" required>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">From Email</p>
</div>
<div>
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="fromEmail" required>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Reply Email</p>
</div>
<div>
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="replyTo" required>
</div>
</div>
</div>
<div ng-hide="request" class="py-2 px-6">
<div>
<textarea placeholder="Paste your email message, any format is accepted. (HTML or Plain)"
ng-model="emailMessage" rows="15" class="border"></textarea>
</div>
</div>
</div>
<div ng-hide="installationProgress" class="flex justify-center">
<button ng-click="saveTemplate()"
class="bg-orange-500 px-3 py-4 rounded-lg text-xl font-semibold text-white">
Save Template
</button>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,71 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="createEmailListV2" class="p-8">
<div>
<p class="text-4xl font-bold">Create Email List - <span id="domainNamePage">{{ domain }}</span></p>
<p class="text-xs text-gray-600 py-2 font-semibold">Create email list, to send out news letters and
marketing emails.</p>
</div>
<div class="py-4">
<p class="text-xl font-bold">Create Email List</p>
<img ng-hide="cyberPanelLoading" src="{% static 'images/loading.gif' %}">
</div>
<hr>
<div id="createPackages">
<div>
<div ng-hide="installationDetailsForm">
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-48">List Name</p>
</div>
<div>
<input name="pname" type="text" class="w-80 bg-gray-100 rounded px-2 py-1"
ng-model="listName"
required>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Path</p>
</div>
<div>
<input placeholder="Path to emails file (.txt and .csv accepted)" type="text"
class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="path" required>
</div>
</div>
</div>
</div>
<div ng-hide="installationDetailsForm" class="flex justify-center">
<button ng-click="createEmailList()"
class="bg-orange-500 px-3 py-4 rounded-lg text-xl font-semibold text-white">
Create List
</button>
</div>
<div ng-hide="installationProgress" class="form-group">
<div class="flex justify-center font-bold text-xl">
<h2>{$ currentStatus $}</h2>
</div>
<div class="w-full bg-gray-100 rounded-full mt-3">
<div id="installProgress"
class="bg-green-600 text-xs font-medium text-white text-center p-2 leading-none rounded-full"
style="width:0%">
</div>
</div>
</div>
<div ng-hide="installationProgress" class="flex justify-center mt-3">
<button ng-disabled="goBackDisable"
ng-click="goBack()"
class="bg-blue-500 px-3 py-2 rounded-lg text-xl font-semibold text-white">
Go Back
</button>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,222 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="manageEmailLists" class="p-8">
<div>
<div class="flex justify-between items-center">
<div>
<div>
<p class="text-4xl font-bold">Manage Email Lists - <span id="domainNamePage">{{ domain }}</span>
</p>
<p class="text-xs text-gray-600 py-2 font-semibold">On this page you can manage your email lists
(Delete, Verify, Add More Emails).</p>
</div>
</div>
</div>
</div>
<div>
<div class="py-4">
<p class="text-xl font-bold">Manage Email Lists</p>
<img ng-hide="cyberPanelLoading"
src="{% static 'images/loading.gif' %}">
</div>
<hr>
<div>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Select List</p>
</div>
<div>
<select ng-change="fetchEmails(1)" ng-model="listName"
class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in listNames %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div ng-hide="emailsAccounts" class="form-group">
<div ng-hide="mailConfigured==1">
<div class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "SSL for email is not configured properly, you may get Self-Signed error on mail clients such as Outlook and Thunderbird. More details " %}<a
href="https://cyberpanel.net/docs/6-self-signed-ssl-error-on-outlook-thunderbird/">here</a>.
</p>
</div>
<a target="_blank" href="" class="flex justify-center mt-3">
<button ng-click='fixMailSSL()' class="bg-orange-500 text-white font-semibold px-2 py-1">Fix
Now
</button>
</a>
</div>
<div class="py-4">
<p class="text-xl font-bold">Details To Configure Mail Clients</p>
</div>
<div>
<div>
<div ng-hide="creationBox" class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr>
<th scope="col" class="px-6 py-3">
Emails
</th>
<th scope="col" class="px-6 py-3">
Disk Usage
</th>
<th scope="col" class="px-6 py-3">
Actions
</th>
</tr>
</thead>
<tbody ng-repeat="record in records track by $index"
class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td ng-bind="record.email" class="px-6 py-4">
</td>
<td ng-bind="record.DiskUsage" class="px-6 py-4">
</td>
<td class="flex gap-2 px-6 py-4">
<button ng-click="changePasswordInitial(record.email)"
class="bg-orange-500 text-white font-semibold px-2 py-1">Change
Password
</button>
<button ng-click="deleteEmailAccountFinal(record.email)"
class="bg-red-500 text-white font-semibold px-2 py-1">Delete
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div>
<div ng-hide="creationBox" class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<div class="bg-gray-200 mt-6 w-full rounded-t-lg border-b-2 border-gray-400">
<p class="font-bold px-4 py-1">POP3</p>
</div>
<thead>
<tr>
<th scope="col" class="px-6 py-3">
Server Hostname
</th>
<th scope="col" class="px-6 py-3">
Port
</th>
<th scope="col" class="px-6 py-3">
Port
</th>
<th scope="col" class="px-6 py-3">
SSL
</th>
</tr>
</thead>
<tbody class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td class="px-6 py-4">
{$ serverHostname $}
</td>
<td class="px-6 py-4">
110
</td>
<td class="px-6 py-4">
995 (SSL)
</td>
<td class="px-6 py-4">
STARTTLS
</td>
</tr>
</tbody>
</table>
</div>
<div ng-hide="creationBox" class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<div class="bg-gray-200 mt-6 w-full rounded-t-lg border-b-2 border-gray-400">
<p class="font-bold px-4 py-1">IMAP</p>
</div>
<thead>
<tr>
<th scope="col" class="px-6 py-3">
Server Hostname
</th>
<th scope="col" class="px-6 py-3">
Port
</th>
<th scope="col" class="px-6 py-3">
Port
</th>
<th scope="col" class="px-6 py-3">
SSL
</th>
</tr>
</thead>
<tbody class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td class="px-6 py-4">
{$ serverHostname $}
</td>
<td class="px-6 py-4">
143
</td>
<td class="px-6 py-4">
993 (SSL)
</td>
<td class="px-6 py-4">
STARTTLS
</td>
</tr>
</tbody>
</table>
</div>
<div ng-hide="creationBox" class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<div class="bg-gray-200 mt-6 w-full rounded-t-lg border-b-2 border-gray-400">
<p class="font-bold px-4 py-1">SMTP</p>
</div>
<thead>
<tr>
<th scope="col" class="px-6 py-3">
Server Hostname
</th>
<th scope="col" class="px-6 py-3">
Port
</th>
<th scope="col" class="px-6 py-3">
Port
</th>
<th scope="col" class="px-6 py-3">
465 SSL
</th>
</tr>
</thead>
<tbody class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td class="px-6 py-4">
{$ serverHostname $}
</td>
<td class="px-6 py-4">
25
</td>
<td class="px-6 py-4">
587 (SSL)
</td>
<td class="px-6 py-4">
STARTTLS
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,142 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="manageSMTPHostsCTRLV2" class="p-8">
<div>
<p class="text-4xl font-bold">Manage SMTP Hosts</p>
<p class="text-xs text-gray-600 py-2 font-semibold">On this page you can manage STMP Host. (SMTP hosts are
used to send emails.</p>
</div>
<div>
<div class="py-4">
<p class="text-xl font-bold">Manage SMTP Hosts</p>
<img ng-hide="cyberPanelLoading" src="{% static 'images/loading.gif' %}">
</div>
<hr>
<div ng-hide="installationDetailsForm">
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-48">SMTP Host</p>
</div>
<div>
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="smtpHost" required>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Port</p>
</div>
<div>
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="smtpPort" required>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Username</p>
</div>
<div>
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="smtpUserName" required>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Password</p>
</div>
<div>
<input type="password" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="smtpPassword"
required>
</div>
</div>
</div>
</div>
<div ng-hide="installationProgress" class="flex justify-center">
<button ng-click="saveSMTPHost()"
class="bg-orange-500 px-3 py-4 rounded-lg text-xl font-semibold text-white">
Save Host
</button>
</div>
<div ng-hide="currentRecords" class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
{# <div class="bg-gray-200 mt-6 w-full rounded-t-lg border-b-2 border-gray-400">#}
{# <p class="font-bold px-4 py-1">IMAP</p>#}
{# </div>#}
<thead>
<tr>
<th scope="col" class="px-6 py-3">
ID
</th>
<th scope="col" class="px-6 py-3">
Owner
</th>
<th scope="col" class="px-6 py-3">
Host
</th>
<th scope="col" class="px-6 py-3">
Port
</th>
<th scope="col" class="px-6 py-3">
Username
</th>
<th scope="col" class="px-6 py-3">
Actions
</th>
</tr>
</thead>
<tbody ng-repeat="record in records | filter:searchEmails"
class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td ng-bind="record.id" class="px-6 py-4">
</td>
<td ng-bind="record.owner" class="px-6 py-4">
</td>
<td ng-bind="record.host" class="px-6 py-4">
</td>
<td ng-bind="record.port" class="px-6 py-4">
</td>
<td ng-bind="record.userName" class="px-6 py-4">
</td>
<td class="px-6 py-4">
<button type="button" ng-click="smtpHostOperations('verify', record.id)"
class="btn ra-100 btn-purple">{% trans "Verify Host" %}</button>
<button type="button" ng-click="smtpHostOperations('delete', record.id)"
class="btn ra-100 btn-purple">{% trans "Delete" %}</button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="row">
<div class="col-sm-4 col-sm-offset-8">
<nav aria-label="Page navigation">
<ul class="pagination">
<li ng-click="fetchEmails(page)" ng-repeat="page in pagination"><a href="">{$ page $}</a></li>
</ul>
</nav>
</div>
</div>
{# <div ng-hide="installationProgress" class="form-group">#}
{##}
{# <div class="flex justify-center font-bold text-xl">#}
{# <h2>{$ currentStatus $}</h2>#}
{# </div>#}
{# <div class="w-full bg-gray-100 rounded-full mt-3">#}
{# <div id="installProgress"#}
{# class="bg-green-600 text-xs font-medium text-white text-center p-2 leading-none rounded-full"#}
{# style="width:0%">#}
{# </div>#}
{# </div>#}
{# </div>#}
{##}
{# <div ng-hide="installationProgress" class="flex justify-center mt-3">#}
{# <button ng-disabled="goBackDisable"#}
{# ng-click="goBack()"#}
{# class="bg-blue-500 px-3 py-2 rounded-lg text-xl font-semibold text-white">#}
{# Go Back#}
{# </button>#}
{# </div>#}
</div>
{% endblock %}

View File

@@ -1,5 +1,6 @@
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.emailMarketing, name='emailMarketing'),
url(r'^fetchUsers$', views.fetchUsers, name='fetchUsers'),
@@ -7,9 +8,11 @@ urlpatterns = [
url(r'^saveConfigureVerify$', views.saveConfigureVerify, name='saveConfigureVerify'),
url(r'^fetchVerifyLogs$', views.fetchVerifyLogs, name='fetchVerifyLogs'),
url(r'^(?P<domain>(.*))/emailLists$', views.createEmailList, name='createEmailList'),
url(r'^V2/(?P<domain>(.*))/emailListsV2$', views.createEmailListV2, name='createEmailListV2'),
url(r'^submitEmailList$', views.submitEmailList, name='submitEmailList'),
url(r'^(?P<domain>(.*))/manageLists$', views.manageLists, name='manageLists'),
url(r'^(?P<domain>(.*))/manageSMTP$', views.manageSMTP, name='manageSMTP'),
url(r'^V2/(?P<domain>(.*))/manageSMTPV2$', views.manageSMTPV2, name='manageSMTPV2'),
url(r'^(?P<domain>(.*))/configureVerify$', views.configureVerify, name='configureVerify'),
url(r'^fetchEmails$', views.fetchEmails, name='fetchEmails'),
url(r'^deleteList$', views.deleteList, name='deleteList'),
@@ -27,4 +30,4 @@ urlpatterns = [
url(r'^deleteTemplate$', views.deleteTemplate, name='deleteTemplate'),
url(r'^deleteJob$', views.deleteJob, name='deleteJob'),
url(r'^remove/(?P<listName>[-\w]+)/(?P<emailAddress>\w+@.+)$', views.remove, name='remove'),
]
]

View File

@@ -3,6 +3,8 @@
from django.shortcuts import redirect
from loginSystem.views import loadLoginPage
from .emailMarketingManager import EmailMarketingManager
# Create your views here.
@@ -14,6 +16,7 @@ def emailMarketing(request):
except KeyError:
return redirect(loadLoginPage)
def fetchUsers(request):
try:
userID = request.session['userID']
@@ -22,6 +25,7 @@ def fetchUsers(request):
except KeyError:
return redirect(loadLoginPage)
def enableDisableMarketing(request):
try:
userID = request.session['userID']
@@ -30,6 +34,7 @@ def enableDisableMarketing(request):
except KeyError:
return redirect(loadLoginPage)
def createEmailList(request, domain):
try:
userID = request.session['userID']
@@ -38,6 +43,16 @@ def createEmailList(request, domain):
except KeyError:
return redirect(loadLoginPage)
def createEmailListV2(request, domain):
try:
userID = request.session['userID']
emm = EmailMarketingManager(request, domain)
return emm.createEmailListV2()
except KeyError:
return redirect(loadLoginPage)
def submitEmailList(request):
try:
userID = request.session['userID']
@@ -46,6 +61,7 @@ def submitEmailList(request):
except KeyError:
return redirect(loadLoginPage)
def manageLists(request, domain):
try:
userID = request.session['userID']
@@ -54,6 +70,7 @@ def manageLists(request, domain):
except KeyError:
return redirect(loadLoginPage)
def configureVerify(request, domain):
try:
userID = request.session['userID']
@@ -62,6 +79,7 @@ def configureVerify(request, domain):
except KeyError:
return redirect(loadLoginPage)
def saveConfigureVerify(request):
try:
userID = request.session['userID']
@@ -70,6 +88,7 @@ def saveConfigureVerify(request):
except KeyError:
return redirect(loadLoginPage)
def fetchVerifyLogs(request):
try:
userID = request.session['userID']
@@ -78,6 +97,7 @@ def fetchVerifyLogs(request):
except KeyError:
return redirect(loadLoginPage)
def fetchEmails(request):
try:
userID = request.session['userID']
@@ -86,6 +106,7 @@ def fetchEmails(request):
except KeyError:
return redirect(loadLoginPage)
def deleteList(request):
try:
userID = request.session['userID']
@@ -94,6 +115,7 @@ def deleteList(request):
except KeyError:
return redirect(loadLoginPage)
def emailVerificationJob(request):
try:
userID = request.session['userID']
@@ -102,6 +124,7 @@ def emailVerificationJob(request):
except KeyError:
return redirect(loadLoginPage)
def deleteEmail(request):
try:
userID = request.session['userID']
@@ -110,6 +133,7 @@ def deleteEmail(request):
except KeyError:
return redirect(loadLoginPage)
def manageSMTP(request, domain):
try:
userID = request.session['userID']
@@ -118,6 +142,16 @@ def manageSMTP(request, domain):
except KeyError:
return redirect(loadLoginPage)
def manageSMTPV2(request, domain):
try:
userID = request.session['userID']
emm = EmailMarketingManager(request, domain)
return emm.manageSMTPV2()
except KeyError:
return redirect(loadLoginPage)
def saveSMTPHost(request):
try:
userID = request.session['userID']
@@ -126,6 +160,7 @@ def saveSMTPHost(request):
except KeyError:
return redirect(loadLoginPage)
def fetchSMTPHosts(request):
try:
userID = request.session['userID']
@@ -134,6 +169,7 @@ def fetchSMTPHosts(request):
except KeyError:
return redirect(loadLoginPage)
def smtpHostOperations(request):
try:
userID = request.session['userID']
@@ -142,6 +178,7 @@ def smtpHostOperations(request):
except KeyError:
return redirect(loadLoginPage)
def composeEmailMessage(request):
try:
userID = request.session['userID']
@@ -150,6 +187,7 @@ def composeEmailMessage(request):
except KeyError:
return redirect(loadLoginPage)
def saveEmailTemplate(request):
try:
userID = request.session['userID']
@@ -158,6 +196,7 @@ def saveEmailTemplate(request):
except KeyError:
return redirect(loadLoginPage)
def sendEmails(request):
try:
userID = request.session['userID']
@@ -166,6 +205,7 @@ def sendEmails(request):
except KeyError:
return redirect(loadLoginPage)
def templatePreview(request, templateName):
try:
userID = request.session['userID']
@@ -174,6 +214,7 @@ def templatePreview(request, templateName):
except KeyError:
return redirect(loadLoginPage)
def fetchJobs(request):
try:
userID = request.session['userID']
@@ -182,6 +223,7 @@ def fetchJobs(request):
except KeyError:
return redirect(loadLoginPage)
def startEmailJob(request):
try:
userID = request.session['userID']
@@ -190,6 +232,7 @@ def startEmailJob(request):
except KeyError:
return redirect(loadLoginPage)
def deleteTemplate(request):
try:
userID = request.session['userID']
@@ -198,6 +241,7 @@ def deleteTemplate(request):
except KeyError:
return redirect(loadLoginPage)
def deleteJob(request):
try:
userID = request.session['userID']
@@ -212,4 +256,4 @@ def remove(request, listName, emailAddress):
emm = EmailMarketingManager(request)
return emm.remove(listName, emailAddress)
except KeyError:
return redirect(loadLoginPage)
return redirect(loadLoginPage)

View File

@@ -12,7 +12,7 @@
account.</p>
</div>
<div>
<div class="py-4">
<div class="flex items-center py-4">
<p class="text-xl font-bold">Delete Email Account</p>
<img ng-hide="emailLoading"
src="{% static 'images/loading.gif' %}">

View File

@@ -17,7 +17,7 @@
</div>
</div>
<div>
<a class="bg-orange-500 text-white font-semibold px-2 py-1"
<a class="bg-orange-500 px-3 py-3 rounded-lg text-xl font-semibold text-white"
href="{% url "createEmailAccountV2" %}">{% trans "Create Email" %}</a>
</div>
</div>
@@ -25,7 +25,7 @@
them.</p>
</div>
<div>
<div class="py-4">
<div class="flex items-center py-4">
<p class="text-xl font-bold">List Email Accounts</p>
<img ng-hide="cyberpanelLoading"
src="{% static 'images/loading.gif' %}">

View File

@@ -0,0 +1,288 @@
newapp.controller('sslIssueCtrlV2', function ($scope, $http) {
$scope.sslIssueCtrl = true;
$scope.manageSSLLoading = true;
$scope.issueSSLBtn = true;
$scope.canNotIssue = true;
$scope.sslIssued = true;
$scope.couldNotConnect = true;
$scope.showbtn = function () {
$scope.issueSSLBtn = false;
};
$scope.issueSSL = function () {
$scope.manageSSLLoading = false;
var url = "/manageSSL/issueSSL";
var data = {
virtualHost: $scope.virtualHost,
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
if (response.data.SSL == 1) {
$scope.sslIssueCtrl = true;
$scope.manageSSLLoading = true;
$scope.issueSSLBtn = false;
$scope.canNotIssue = true;
$scope.sslIssued = false;
$scope.couldNotConnect = true;
$scope.sslDomain = $scope.virtualHost;
} else {
$scope.sslIssueCtrl = true;
$scope.manageSSLLoading = true;
$scope.issueSSLBtn = false;
$scope.canNotIssue = false;
$scope.sslIssued = true;
$scope.couldNotConnect = true;
$scope.errorMessage = response.data.error_message;
}
}
function cantLoadInitialDatas(response) {
$scope.sslIssueCtrl = true;
$scope.manageSSLLoading = true;
$scope.issueSSLBtn = false;
$scope.canNotIssue = true;
$scope.sslIssued = true;
$scope.couldNotConnect = false;
}
};
});
newapp.controller('sslIssueForHostNameCtrlV2', function ($scope, $http) {
$scope.sslIssueCtrl = true;
$scope.manageSSLLoading = true;
$scope.issueSSLBtn = true;
$scope.canNotIssue = true;
$scope.sslIssued = true;
$scope.couldNotConnect = true;
$scope.showbtn = function () {
$scope.issueSSLBtn = false;
};
$scope.issueSSL = function () {
$scope.manageSSLLoading = false;
var url = "/manageSSL/obtainHostNameSSL";
var data = {
virtualHost: $scope.virtualHost,
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
if (response.data.SSL == 1) {
$scope.sslIssueCtrl = true;
$scope.manageSSLLoading = true;
$scope.issueSSLBtn = false;
$scope.canNotIssue = true;
$scope.sslIssued = false;
$scope.couldNotConnect = true;
$scope.sslDomain = $scope.virtualHost;
} else {
$scope.sslIssueCtrl = true;
$scope.manageSSLLoading = true;
$scope.issueSSLBtn = false;
$scope.canNotIssue = false;
$scope.sslIssued = true;
$scope.couldNotConnect = true;
$scope.errorMessage = response.data.error_message;
}
}
function cantLoadInitialDatas(response) {
$scope.sslIssueCtrl = true;
$scope.manageSSLLoading = true;
$scope.issueSSLBtn = false;
$scope.canNotIssue = true;
$scope.sslIssued = true;
$scope.couldNotConnect = false;
}
};
});
newapp.controller('sslIssueForMailServerV2', function ($scope, $http) {
$scope.sslIssueCtrl = true;
$scope.manageSSLLoading = true;
$scope.issueSSLBtn = true;
$scope.canNotIssue = true;
$scope.sslIssued = true;
$scope.couldNotConnect = true;
$scope.showbtn = function () {
$scope.issueSSLBtn = false;
};
$scope.issueSSL = function () {
$scope.manageSSLLoading = false;
var url = "/manageSSL/obtainMailServerSSL";
var data = {
virtualHost: $scope.virtualHost,
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
if (response.data.SSL === 1) {
$scope.sslIssueCtrl = true;
$scope.manageSSLLoading = true;
$scope.issueSSLBtn = false;
$scope.canNotIssue = true;
$scope.sslIssued = false;
$scope.couldNotConnect = true;
$scope.sslDomain = $scope.virtualHost;
} else {
$scope.sslIssueCtrl = true;
$scope.manageSSLLoading = true;
$scope.issueSSLBtn = false;
$scope.canNotIssue = false;
$scope.sslIssued = true;
$scope.couldNotConnect = true;
$scope.errorMessage = response.data.error_message;
}
}
function cantLoadInitialDatas(response) {
$scope.sslIssueCtrl = true;
$scope.manageSSLLoading = true;
$scope.issueSSLBtn = false;
$scope.canNotIssue = true;
$scope.sslIssued = true;
$scope.couldNotConnect = false;
}
};
});
newapp.controller('sslIssueCtrlV2V2', function ($scope, $http) {
$scope.manageSSLLoading = true;
$scope.showbtn = function () {
$scope.issueSSLBtn = false;
};
$scope.issueSSL = function () {
$scope.manageSSLLoading = false;
var url = "/manageSSL/v2IssueSSL";
var data = {
virtualHost: $scope.virtualHost,
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
$scope.manageSSLLoading = true;
if (response.data.SSL === 1) {
$scope.sslStatus = 'Issued.';
$scope.sslLogs = response.data.sslLogs;
} else {
$scope.sslStatus = 'Failed.';
$scope.sslLogs = response.data.sslLogs;
}
}
function cantLoadInitialDatas(response) {
$scope.sslIssueCtrl = true;
$scope.manageSSLLoading = true;
$scope.issueSSLBtn = false;
$scope.canNotIssue = true;
$scope.sslIssued = true;
$scope.couldNotConnect = false;
}
};
});

View File

@@ -0,0 +1,64 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="sslIssueCtrlV2" class="p-8">
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
<div class="flex items-center">
<p class="text-4xl font-bold">Manage SSL -</p>
<a target="_blank" href="http://go.cyberpanel.net/ssl-docs"
style="height: 23px;line-height: 21px;"
class="bg-blue-200 px-2 font-bold mt-2 ml-3"
title=""><span>{% trans "SSL Docs" %}</span></a>
</div>
</div>
<p class="text-xs text-gray-600 py-2 font-semibold">This page can be used to issue Lets Encrypt SSL for
existing websites on server.
</p>
<div class="flex items-center py-4">
<p class="text-xl font-bold">Manage SSL</p>
<img ng-hide="manageSSLLoading" src="{% static 'images/loading.gif' %}">
</div>
<hr>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Select Website</p>
</div>
<div>
<select ng-change="showbtn()" ng-model="virtualHost" class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in websiteList %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div ng-hide="issueSSLBtn">
<div class="flex justify-center mt-6 mb-2">
<button ng-click="issueSSL()"
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
Issue SSL
</button>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-6">
<div ng-hide="canNotIssue"
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "Cannot issue SSL. Error message:" %} {$ errorMessage $}</p>
</div>
<div ng-hide="sslIssued" class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
<p>{% trans "SSL Issued for" %} <strong>{$ sslDomain $}</strong></p>
</div>
<div ng-hide="couldNotConnect"
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,65 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="sslIssueForHostNameCtrlV2" class="p-8">
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
<div class="flex items-center">
<p class="text-4xl font-bold">Issue SSL For Hostname -</p>
<a target="_blank" href="http://go.cyberpanel.net/hostname-ssl" style="height: 23px;line-height: 21px;"
class="bg-blue-200 px-2 font-bold mt-2 ml-3"
title=""><span>{% trans "SSL Docs" %}</span></a>
</div>
</div>
<p class="text-xs text-gray-600 py-2 font-semibold">Lets Encrypt SSL for hostname to access CyberPanel on
verified SSL.
</p>
<div class="flex items-center py-4">
<p class="text-xl font-bold">Issue SSL For Hostname</p>
<img ng-hide="manageSSLLoading" src="{% static 'images/loading.gif' %}">
</div>
<hr>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Select Website</p>
</div>
<div>
<select ng-change="showbtn()" ng-model="virtualHost" class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in websiteList %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div ng-hide="issueSSLBtn">
<div class="flex justify-center mt-6 mb-2">
<button ng-click="issueSSL()"
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
Issue SSL
</button>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-6">
<div ng-hide="canNotIssue"
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "Cannot issue SSL. Error message:" %} {$ errorMessage $}</p>
</div>
<div ng-hide="sslIssued" class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
<p>{% trans "SSL Issued. You can now access CyberPanel at:" %} <strong>https://{$ sslDomain
$}:8090</strong></p>
</div>
<div ng-hide="couldNotConnect"
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
<p>{% trans "SSL Issued. You can now access CyberPanel at:" %}
<strong>https://"domain":8090</strong></p>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,62 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="sslIssueForMailServerV2" class="p-8">
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
<div class="flex items-center">
<p class="text-4xl font-bold">Issue SSL For MailServer -</p>
<a target="_blank" href="http://go.cyberpanel.net/mailserver-ssl"
style="height: 23px;line-height: 21px;" class="bg-blue-200 px-2 font-bold mt-2 ml-3"
title=""><span>{% trans "SSL Docs" %}</span></a>
</div>
</div>
<p class="text-xs text-gray-600 py-2 font-semibold">Lets Encrypt SSL for MailServer (Postfix/Dovecot).
</p>
<div class="flex items-center py-4">
<p class="text-xl font-bold">Issue SSL For MailServer</p>
<img ng-hide="manageSSLLoading" src="{% static 'images/loading.gif' %}">
</div>
<hr>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Select Website</p>
</div>
<div>
<select ng-change="showbtn()" ng-model="virtualHost" class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in websiteList %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div ng-hide="issueSSLBtn">
<div class="flex justify-center mt-6 mb-2">
<button ng-click="issueSSL()"
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
Issue SSL
</button>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-6">
<div ng-hide="canNotIssue"
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "Cannot issue SSL. Error message:" %} {$ errorMessage $}</p>
</div>
<div ng-hide="sslIssued" class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
<p>{% trans "SSL Issued, your mail server now uses Lets Encrypt!" %}</p>
</div>
<div ng-hide="couldNotConnect"
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
<p>{% trans "Could not connect to server, please refresh this page." %}</p>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,167 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
{% if PremStat %}
<div ng-controller="sslIssueCtrlV2V2" class="p-8">
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
<div class="flex items-center">
<p class="text-4xl font-bold">SSL v2 -</p>
<a target="_blank" href="https://youtu.be/kDUANNvtOwE"
style="height: 23px;line-height: 21px;"
class="bg-blue-200 px-2 font-bold mt-2 ml-3"
title=""><span>{% trans "DNS Docs" %}</span></a>
</div>
</div>
<p class="text-xs text-gray-600 py-2 font-semibold">On this page, you have the option to configure DNS
providers that CyberPanel can utilize for issuing SSL certificates, providing enhanced flexibility and
ease of renewal.
</p>
<p align="center" style="margin-top: 2%; margin-bottom: 2%">
<iframe width="788.54" height="443" src="https://www.youtube.com/embed/kDUANNvtOwE"
title="YouTube video player" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowfullscreen></iframe>
</p>
<div class="flex items-center py-4">
<p class="text-xl font-bold">SSL v2</p>
</div>
<hr>
{% if SaveSuccess %}
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-6">
<div class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
<p>{% trans "Changes saved succesfully." %}</p>
</div>
</div>
</div>
{% endif %}
<ul class="flex py-2">
<li id="dns_tab_button"
class="hover:bg-orange-200 border-2 border-black rounded-l-3xl px-2 py-2 w-60 cursor-pointer active"
onclick="showTab1('issue_SSL')">
<a class="flex justify-center">
<p class="text-2xl font-bold">Issue SSL</p>
</a>
</li>
<li id="api_tab_button"
class="hover:bg-orange-200 border-2 border-black rounded-r-3xl px-2 py-2 w-60 cursor-pointer"
onclick="showTab1('api_settings')">
<a class="flex justify-center">
<p class="text-2xl font-bold">API Settings</p>
</a>
</li>
</ul>
<div id="issue_SSL" class="tab-content1">
<div class="flex mt-4 py-2 px-6 items-center">
<div>
<p class="font-semibold w-60">Select Domain</p>
</div>
<div>
<select ng-model="virtualHost"
class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in websiteList %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
<div class="flex ml-3">
<button ng-click="issueSSL()"
class="bg-orange-500 text-white font-semibold px-2 py-1">
Issue SSL
</button>
<img ng-hide="manageSSLLoading" src="{% static 'images/loading.gif' %}">
</div>
</div>
<div>
<h3 class="text-xl font-bold">SSL Status: {$ sslStatus $}</h3>
<div>
<textarea ng-model="sslLogs" class="w-full border"
rows="20"></textarea>
</div>
</div>
</div>
<div id="api_settings" class="tab-content1" style="display: none;">
<form method="post" action="{% url 'v2ManageSSLV2' %}">
{% csrf_token %}
<p class="text-xl font-bold">Cloudflare Settings</p>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">CloudFlare Email</p>
</div>
<div>
<input name="SAVED_CF_Email" type="text" class="w-80 bg-gray-100 rounded px-2 py-1"
value="{{ SAVED_CF_Email }}" required>
</div>
</div>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">API Token</p>
</div>
<div>
<input name="SAVED_CF_Key" type="text" class="w-80 bg-gray-100 rounded px-2 py-1"
value="{{ SAVED_CF_Key }}" required>
</div>
</div>
<div>
<div class="flex justify-center mt-6 mb-2">
<button type="submit"
class="bg-orange-500 text-white font-bold px-4 py-2 text-xl">
Save
</button>
</div>
</div>
</form>
</div>
</div>
{% else %}
<style>
.feturecard {
width: 30%;
padding: 46px;
margin: 15px
}
</style>
<div class="container">
<div id="page-title" align="center">
<h1 style="color: black"><strong>SSLv2 Comes with Full Automation + Wildcard SSLs! </strong></h1>
<p style="font-size: 15px; color: black; margin-top: 1%">Are you tired of the hassle that comes with
setting up SSL certificates for your website? Do you want a faster and easier way to secure your
website without the need for manual verification? <br><br>
Introducing CyberPanel's new feature, SSL v2! With SSL v2, you can automatically issue SSL
certificates using the ACME DNS verification method. This means that you no longer have to worry
about going through the manual process of verifying ownership of your domain. <br><br>
What's even better is that we've integrated two of the most popular domain registrars, Cloudflare
and Namecheap, so you can easily issue SSL certificates with just a few clicks. No more fiddling
around with complicated settings and DNS configurations! <br><br>
With SSL v2, you can rest easy knowing that your website is secure and your visitors' data is
protected. Don't wait any longer to upgrade your website's security - get SSL v2 today!<br></p>
</div>
<p align="center">
<iframe width="788.54" height="443" src="https://www.youtube.com/embed/kDUANNvtOwE"
title="YouTube video player" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowfullscreen></iframe>
</p>
<div style="margin-top: 2%">
<stripe-pricing-table pricing-table-id="prctbl_1MQtdYJMfY1fWGMszc4tx78j"
publishable-key="pk_live_51ITXBmJMfY1fWGMs2G0LAydJweIDMp2WaYocM0xyzdn03WaHUbMw6uxfVuktAkgpRyUql7tz7gF5OwdccEZLd6Ot00XX6tGoZx">
</stripe-pricing-table>
<stripe-pricing-table pricing-table-id="prctbl_1LpSqSJMfY1fWGMsxSNhPLsc"
publishable-key="pk_live_51ITXBmJMfY1fWGMs2G0LAydJweIDMp2WaYocM0xyzdn03WaHUbMw6uxfVuktAkgpRyUql7tz7gF5OwdccEZLd6Ot00XX6tGoZx">
</stripe-pricing-table>
<stripe-pricing-table pricing-table-id="prctbl_1M6WpCJMfY1fWGMsQXFlZWcW"
publishable-key="pk_live_51ITXBmJMfY1fWGMs2G0LAydJweIDMp2WaYocM0xyzdn03WaHUbMw6uxfVuktAkgpRyUql7tz7gF5OwdccEZLd6Ot00XX6tGoZx">
</stripe-pricing-table>
</div>
</div>
{% endif %}
{% endblock %}

View File

@@ -5,16 +5,20 @@ urlpatterns = [
url(r'^$', views.loadSSLHome, name='loadSSLHome'),
url(r'^manageSSL', views.manageSSL, name='manageSSL'),
url(r'^V2/manageSSLV2', views.manageSSLV2, name='manageSSLV2'),
url(r'^issueSSL', views.issueSSL, name='issueSSL'),
url(r'^sslForHostName', views.sslForHostName, name='sslForHostName'),
url(r'^V2/sslForHostNameV2', views.sslForHostNameV2, name='sslForHostNameV2'),
url(r'^obtainHostNameSSL$', views.obtainHostNameSSL, name='obtainHostNameSSL'),
url(r'^sslForMailServer', views.sslForMailServer, name='sslForMailServer'),
url(r'^V2/sslForMailServerV2', views.sslForMailServerV2, name='sslForMailServerV2'),
url(r'^obtainMailServerSSL', views.obtainMailServerSSL, name='obtainMailServerSSL'),
## v2 functions
url(r'^v2ManageSSL', views.v2ManageSSL, name='v2ManageSSL'),
url(r'^V2/v2ManageSSLV2', views.v2ManageSSLV2, name='v2ManageSSLV2'),
url(r'^v2IssueSSL', views.v2IssueSSL, name='v2IssueSSL'),
]
]

View File

@@ -9,6 +9,7 @@ import json
from plogical.acl import ACLManager
from plogical.processUtilities import ProcessUtilities
# Create your views here.
def loadSSLHome(request):
@@ -27,6 +28,16 @@ def manageSSL(request):
{'websiteList': websitesName}, 'manageSSL')
return proc.render()
def manageSSLV2(request):
userID = request.session['userID']
currentACL = ACLManager.loadedACL(userID)
websitesName = ACLManager.findAllSites(currentACL, userID)
proc = httpProc(request, 'manageSSL/manageSSLV2.html',
{'websiteList': websitesName}, 'manageSSL')
return proc.render()
def v2ManageSSL(request):
userID = request.session['userID']
currentACL = ACLManager.loadedACL(userID)
@@ -46,7 +57,6 @@ def v2ManageSSL(request):
DNS.ConfigureCloudflareInAcme(SAVED_CF_Key, SAVED_CF_Email)
data['SaveSuccess'] = 1
RetStatus, SAVED_CF_Key, SAVED_CF_Email = ACLManager.FetchCloudFlareAPIKeyFromAcme()
from plogical.dnsUtilities import DNS
DNS.ConfigurePowerDNSInAcme()
@@ -59,6 +69,39 @@ def v2ManageSSL(request):
data, 'manageSSL')
return proc.render()
def v2ManageSSLV2(request):
userID = request.session['userID']
currentACL = ACLManager.loadedACL(userID)
websitesName = ACLManager.findAllSites(currentACL, userID)
data = {}
if ACLManager.CheckForPremFeature('all'):
data['PremStat'] = 1
else:
data['PremStat'] = 0
if request.method == 'POST':
SAVED_CF_Key = request.POST.get('SAVED_CF_Key')
SAVED_CF_Email = request.POST.get('SAVED_CF_Email')
from plogical.dnsUtilities import DNS
DNS.ConfigureCloudflareInAcme(SAVED_CF_Key, SAVED_CF_Email)
data['SaveSuccess'] = 1
RetStatus, SAVED_CF_Key, SAVED_CF_Email = ACLManager.FetchCloudFlareAPIKeyFromAcme()
from plogical.dnsUtilities import DNS
DNS.ConfigurePowerDNSInAcme()
data['SAVED_CF_Key'] = SAVED_CF_Key
data['SAVED_CF_Email'] = SAVED_CF_Email
data['websiteList'] = websitesName
proc = httpProc(request, 'manageSSL/v2ManageSSLV2.html',
data, 'manageSSL')
return proc.render()
def v2IssueSSL(request):
try:
userID = request.session['userID']
@@ -202,6 +245,15 @@ def sslForHostName(request):
return proc.render()
def sslForHostNameV2(request):
userID = request.session['userID']
currentACL = ACLManager.loadedACL(userID)
websitesName = ACLManager.findAllSites(currentACL, userID, 1)
proc = httpProc(request, 'manageSSL/sslForHostNameV2.html',
{'websiteList': websitesName}, 'hostnameSSL')
return proc.render()
def obtainHostNameSSL(request):
try:
userID = request.session['userID']
@@ -277,6 +329,18 @@ def sslForMailServer(request):
return proc.render()
def sslForMailServerV2(request):
userID = request.session['userID']
currentACL = ACLManager.loadedACL(userID)
websitesName = ACLManager.findAllSites(currentACL, userID)
websitesName = websitesName + ACLManager.findChildDomains(websitesName)
proc = httpProc(request, 'manageSSL/sslForMailServerV2.html',
{'websiteList': websitesName}, 'mailServerSSL')
return proc.render()
def obtainMailServerSSL(request):
try:
userID = request.session['userID']

View File

@@ -95,13 +95,13 @@
<p class="font-semibold w-60">Additional Features</p>
</div>
<div>
<div class="checkbox">
<div>
<label>
<input ng-model="allowFullDomain" type="checkbox" value="">
Allow Creation of Fully Qualified Domain as Child-Domains
</label>
</div>
<div class="checkbox">
<div>
<label>
<input ng-model="enforceDiskLimits" type="checkbox" value="">
Enforce Disk Limits

View File

@@ -73,302 +73,296 @@
ng-hide="record.allowFullDomain">Disabled</span>
</td>
<td class="flex gap-1 px-6 py-4">
<button ng-click="editInitial(record.package, record.diskSpace, record.bandwidth,
record.emailAccounts, record.dataBases, record.ftpAccounts, record.allowedDomains, record.allowFullDomain, record.enforceDiskLimits)"
data-modal-target="EditListUser_{$$index$}"
data-modal-toggle="EditListUser_{$$index$}"
class="bg-orange-500 px-2 py-1 text-white"
type="button">
Edit
</button>
<div id="EditListUser_{$$index$}" tabindex="-1"
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
<div>
<div class="relative bg-white rounded-lg shadow dark:bg-gray-700">
<h2 class="px-4 py-4 font-bold text-xl">Edit Users</h2>
<button type="button" data-modal-toggle="EditListUser_{$$index$}"
class="absolute top-3 end-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white"
data-modal-hide="EditListUser">
<svg class="w-3 h-3" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
</svg>
<span class="sr-only">Close modal</span>
</button>
<div class="p-4">
<div ng-hide="installationDetailsForm" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Name</p>
</div>
<div>
<input name="name" type="text"
class="w-80 bg-gray-100 rounded px-2 py-1"
ng-model="name" readonly>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">New Owner</p>
</div>
<div>
<select ng-change="saveResellerChanges()"
ng-model="$parent.newOwner"
class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in resellerPrivUsers %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">Select ACL</p>
</div>
<div>
<select ng-change="changeACLFunc()"
ng-model="$parent.selectedACL"
class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in aclNames %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
</div>
</div>
</div>
</div>
<button ng-click="deletePackageFinal(record.package)"
data-modal-target="DeleteListUser_{$$index$}"
data-modal-toggle="DeleteListUser_{$$index$}"
class="bg-orange-500 px-2 py-1 text-white"
type="button">
Delete
</button>
<div id="DeleteListUser_{$$index$}" tabindex="-1"
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
<div class="relative p-4 w-full max-w-md max-h-full">
<div class="relative bg-white rounded-lg shadow dark:bg-gray-700">
<button type="button" data-modal-toggle="DeleteListUser"
class="absolute top-3 end-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white"
data-modal-hide="DeleteListUser">
<svg class="w-3 h-3" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
</svg>
<span class="sr-only">Close modal</span>
</button>
<div class="p-4 md:p-5 text-center">
<svg class="mx-auto mb-4 text-gray-400 w-12 h-12 dark:text-gray-200"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 20 20">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="M10 11V6m0 8h.01M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/>
</svg>
<h3 class="mb-5 text-lg font-normal text-gray-500 dark:text-gray-400">
Are you sure you want to
delete this user {$ UserToDelete $} ?</h3>
<button ng-click="deleteUserFinal()" data-modal-hide="DeleteListUser"
type="button"
data-modal-toggle="DeleteListUser"
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2">
Yes, I'm sure
</button>
<button data-modal-hide="DeleteListUser" type="button"
data-modal-toggle="DeleteListUser"
class="text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600">
No, cancel
</button>
</div>
</div>
</div>
</div>
<a ng-click="deletePackageFinal(record.package)"
class="bg-orange-500 px-2 py-1 text-white" href="#"
title=""><span>{% trans 'Delete' %}</span></a>
{# <a onclick="return false;"#}
{# ng-click="editInitial(record.name)"#}
{# class="bg-orange-500 px-2 py-1 text-white ml-1"#}
{# href="#" data-modal-target="edit" data-modal-toggle="edit"><i class="fa fa-folder"#}
{# aria-hidden="true"></i> {% trans "EDIT" %}#}
{# </a>#}
{# <div id="edit" tabindex="-1"#}
{# class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">#}
{# <div class="relative p-4 w-full max-w-4xl max-h-full">#}
{# <div class="relative bg-white shadow dark:bg-gray-700">#}
{# <div class="flex items-center bg-blue-400 px-4 py-4">#}
{# <p class="font-bold">Edit Package</p>#}
{# <button type="button" data-modal-toggle="edit"#}
{# class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"#}
{# data-modal-hide="edit">#}
{# <svg class="w-3 h-3" aria-hidden="true"#}
{# xmlns="http://www.w3.org/2000/svg" fill="none"#}
{# viewBox="0 0 14 14">#}
{# <path stroke="currentColor" stroke-linecap="round"#}
{# stroke-linejoin="round" stroke-width="2"#}
{# d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>#}
{# </svg>#}
{# <span class="sr-only">Close modal</span>#}
{# </button>#}
{# </div>#}
{# <div class="p-4 md:p-5">#}
{# <form name="containerSettingsForm" action="/" id="createPackages"#}
{# class="form-horizontal bordered-row panel-body">#}
{# <div ng-hide="installationDetailsForm" class="flex mt-4 py-2 px-6">#}
{# <div>#}
{# <p class="font-semibold w-60">Name</p>#}
{# </div>#}
{# <div>#}
{# <input name="name" type="text"#}
{# class="w-80 bg-gray-100 rounded px-2 py-1"#}
{# ng-model="name" readonly>#}
{# </div>#}
{# </div>#}
{# <div class="flex py-2 px-6">#}
{# <div>#}
{# <p class="font-semibold w-60">Domains</p>#}
{# </div>#}
{# <div>#}
{# <input type="number" class="w-80 bg-gray-100 rounded px-2 py-1"#}
{# ng-model="$parent.allowedDomains" required>#}
{# </div>#}
{# <div class="text-orange-500 font-semibold ml-3">#}
{# <p>{% trans "(0 = Unlimited)" %}</p>#}
{# </div>#}
{# </div>#}
{# <div class="flex py-2 px-6">#}
{# <div>#}
{# <p class="font-semibold w-60">Disk Space</p>#}
{# </div>#}
{# <div>#}
{# <input type="number" class="w-80 bg-gray-100 rounded px-2 py-1"#}
{# ng-model="$parent.diskSpace" required>#}
{# </div>#}
{# <div class="text-orange-500 font-semibold ml-3">#}
{# <p>{% trans "MB (0 = Unlimited)" %}</p>#}
{# </div>#}
{# </div>#}
{# <div class="flex py-2 px-6">#}
{# <div>#}
{# <p class="font-semibold w-60">Bandwidth</p>#}
{# </div>#}
{# <div>#}
{# <input type="number" class="w-80 bg-gray-100 rounded px-2 py-1"#}
{# ng-model="$parent.bandwidth" required>#}
{# </div>#}
{# <div class="text-orange-500 font-semibold ml-3">#}
{# <p>{% trans "MB (0 = Unlimited)" %}</p>#}
{# </div>#}
{# </div>#}
{# <div class="flex py-2 px-6">#}
{# <div>#}
{# <p class="font-semibold w-60">FTP Account</p>#}
{# </div>#}
{# <div>#}
{# <input type="number" class="w-80 bg-gray-100 rounded px-2 py-1"#}
{# ng-model="$parent.ftpAccounts" required>#}
{# </div>#}
{# </div>#}
{# <div class="flex py-2 px-6">#}
{# <div>#}
{# <p class="font-semibold w-60">Databases</p>#}
{# </div>#}
{# <div>#}
{# <input type="number" class="w-80 bg-gray-100 rounded px-2 py-1"#}
{# ng-model="$parent.dataBases" required>#}
{# </div>#}
{# </div>#}
{# <div class="flex py-2 px-6">#}
{# <div>#}
{# <p class="font-semibold w-60">Emails</p>#}
{# </div>#}
{# <div>#}
{# <input type="number" class="w-80 bg-gray-100 rounded px-2 py-1"#}
{# ng-model="$parent.emails" required>#}
{# </div>#}
{# </div>#}
{# <div ng-hide="installationDetailsForm">#}
{# <div class="flex py-2 px-6">#}
{# <div>#}
{# <p class="font-semibold w-60">Additional</p>#}
{# </div>#}
{# <div>#}
{# <div>#}
{# <label>#}
{# <input ng-model="$parent.allowFullDomain"#}
{# type="checkbox" value="">#}
{# Allow Creation of Fully Qualified Domain as#}
{# Child-Domains#}
{# </label>#}
{# </div>#}
{# <div>#}
{# <label>#}
{# <input ng-model="$parent.enforceDiskLimits"#}
{# type="checkbox" value="">#}
{# Enforce Disk Limits#}
{# </label>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </form>#}
{# <div class="flex justify-end mt-3">#}
{# <button ng-click="saveChanges()"#}
{# data-modal-toggle="edit"#}
{# data-modal-hide="edit"#}
{# class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">#}
{# Save#}
{# </button>#}
{# <button data-modal-toggle="edit"#}
{# data-modal-hide="edit"#}
{# class="ml-2 bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded">#}
{# Close#}
{# </button>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
</td>
</tr>
</tbody>
<button class="btn btn-danger" data-modal-target="habitetest" data-modal-toggle="habitetest">check
moda
</button>
<div id="habitetest" tabindex="-1"
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
<div class="relative p-4 w-full max-w-md max-h-full">
<div class="relative bg-white rounded-lg shadow dark:bg-gray-700">
<button type="button" data-modal-toggle="habitetest"
class="absolute top-3 end-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white"
data-modal-hide="habitetest">
<svg class="w-3 h-3" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
</svg>
<span class="sr-only">Close modal</span>
</button>
<div class="p-4 md:p-5 text-center">
<svg class="mx-auto mb-4 text-gray-400 w-12 h-12 dark:text-gray-200"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 20 20">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="M10 11V6m0 8h.01M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/>
</svg>
<h3 class="mb-5 text-lg font-normal text-gray-500 dark:text-gray-400">
Are you sure you want to
delete this user {$ UserToDelete $} ?</h3>
<button ng-click="deleteUserFinal()" data-modal-hide="DeleteListUser"
type="button"
data-modal-toggle="DeleteListUser"
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2">
Yes, I'm sure
</button>
<button data-modal-hide="DeleteListUser" type="button"
data-modal-toggle="DeleteListUser"
class="text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600">
No, cancel
</button>
</div>
</div>
</div>
</div>
</table>
</div>
</div>
{# <div>#}
{# <button ng-click="deleteUserInitial(record.name)" data-modal-target="DeleteListUser"#}
{# data-modal-toggle="DeleteListUser"#}
{# class="bg-orange-500 px-2 py-1 text-white"#}
{# type="button">#}
{# Delete#}
{# </button>#}
{##}
{# <div id="DeleteListUser" tabindex="-1"#}
{# class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">#}
{# <div class="relative p-4 w-full max-w-md max-h-full">#}
{# <div class="relative bg-white rounded-lg shadow dark:bg-gray-700">#}
{# <button type="button" data-modal-toggle="DeleteListUser"#}
{# class="absolute top-3 end-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white"#}
{# data-modal-hide="DeleteListUser">#}
{# <svg class="w-3 h-3" aria-hidden="true"#}
{# xmlns="http://www.w3.org/2000/svg" fill="none"#}
{# viewBox="0 0 14 14">#}
{# <path stroke="currentColor" stroke-linecap="round"#}
{# stroke-linejoin="round" stroke-width="2"#}
{# d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>#}
{# </svg>#}
{# <span class="sr-only">Close modal</span>#}
{# </button>#}
{# <div class="p-4 md:p-5 text-center">#}
{# <svg class="mx-auto mb-4 text-gray-400 w-12 h-12 dark:text-gray-200"#}
{# aria-hidden="true"#}
{# xmlns="http://www.w3.org/2000/svg" fill="none"#}
{# viewBox="0 0 20 20">#}
{# <path stroke="currentColor" stroke-linecap="round"#}
{# stroke-linejoin="round" stroke-width="2"#}
{# d="M10 11V6m0 8h.01M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/>#}
{# </svg>#}
{# <h3 class="mb-5 text-lg font-normal text-gray-500 dark:text-gray-400">#}
{# Are you sure you want to#}
{# delete this user {$ UserToDelete $} ?</h3>#}
{# <button ng-click="deleteUserFinal()" data-modal-hide="DeleteListUser" type="button"#}
{# data-modal-toggle="DeleteListUser"#}
{# class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2">#}
{# Yes, I'm sure#}
{# </button>#}
{# <button data-modal-hide="DeleteListUser" type="button"#}
{# data-modal-toggle="DeleteListUser"#}
{# class="text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600">#}
{# No, cancel#}
{# </button>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# <div>#}
{# <button ng-click="editInitial(record.name)" data-modal-target="EditListUser"#}
{# data-modal-toggle="EditListUser"#}
{# class="bg-orange-500 px-2 py-1 text-white"#}
{# type="button">#}
{# Edit#}
{# </button>#}
{##}
{# <div id="EditListUser" tabindex="-1"#}
{# class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">#}
{# <div>#}
{# <div class="relative bg-white rounded-lg shadow dark:bg-gray-700">#}
{# <h2 class="px-4 py-4 font-bold text-xl">Edit Users</h2>#}
{# <button type="button" data-modal-toggle="EditListUser"#}
{# class="absolute top-3 end-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white"#}
{# data-modal-hide="EditListUser">#}
{# <svg class="w-3 h-3" aria-hidden="true"#}
{# xmlns="http://www.w3.org/2000/svg" fill="none"#}
{# viewBox="0 0 14 14">#}
{# <path stroke="currentColor" stroke-linecap="round"#}
{# stroke-linejoin="round" stroke-width="2"#}
{# d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>#}
{# </svg>#}
{# <span class="sr-only">Close modal</span>#}
{# </button>#}
{# <div class="p-4">#}
{# <div ng-hide="installationDetailsForm" class="flex mt-4 py-2 px-6">#}
{# <div>#}
{# <p class="font-semibold w-60">Name</p>#}
{# </div>#}
{# <div>#}
{# <input name="name" type="text" class="w-80 bg-gray-100 rounded px-2 py-1"#}
{# ng-model="name" readonly>#}
{# </div>#}
{# </div>#}
{# <div class="flex py-2 px-6">#}
{# <div>#}
{# <p class="font-semibold w-60">New Owner</p>#}
{# </div>#}
{# <div>#}
{# <select ng-change="saveResellerChanges()"#}
{# ng-model="$parent.newOwner"#}
{# class="w-80 bg-gray-100 rounded px-2 py-1">#}
{# {% for items in resellerPrivUsers %}#}
{# <option>{{ items }}</option>#}
{# {% endfor %}#}
{# </select>#}
{# </div>#}
{# </div>#}
{# <div class="flex py-2 px-6">#}
{# <div>#}
{# <p class="font-semibold w-60">Select ACL</p>#}
{# </div>#}
{# <div>#}
{# <select ng-change="changeACLFunc()"#}
{# ng-model="$parent.selectedACL"#}
{# class="w-80 bg-gray-100 rounded px-2 py-1">#}
{# {% for items in aclNames %}#}
{# <option>{{ items }}</option>#}
{# {% endfor %}#}
{# </select>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
<a onclick="return false;"
ng-click="editInitial(record.name)"
class="bg-orange-500 px-2 py-1 text-white ml-1"
href="#" data-modal-target="edit" data-modal-toggle="edit"><i class="fa fa-folder"
aria-hidden="true"></i> {% trans "EDIT" %}
</a>
<div id="edit" tabindex="-1"
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
<div class="relative p-4 w-full max-w-4xl max-h-full">
<div class="relative bg-white shadow dark:bg-gray-700">
<div class="flex items-center bg-blue-400 px-4 py-4">
<p class="font-bold">Edit Package</p>
<button type="button" data-modal-toggle="edit"
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
data-modal-hide="edit">
<svg class="w-3 h-3" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
</svg>
<span class="sr-only">Close modal</span>
</button>
</div>
<div class="p-4 md:p-5">
<form name="containerSettingsForm" action="/" id="createPackages"
class="form-horizontal bordered-row panel-body">
<div ng-hide="installationDetailsForm" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Name</p>
</div>
<div>
<input name="name" type="text" class="w-80 bg-gray-100 rounded px-2 py-1"
ng-model="name" readonly>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">Domains</p>
</div>
<div>
<input type="number" class="w-80 bg-gray-100 rounded px-2 py-1"
ng-model="$parent.allowedDomains" required>
</div>
<div class="text-orange-500 font-semibold ml-3">
<p>{% trans "(0 = Unlimited)" %}</p>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">Disk Space</p>
</div>
<div>
<input type="number" class="w-80 bg-gray-100 rounded px-2 py-1"
ng-model="$parent.diskSpace" required>
</div>
<div class="text-orange-500 font-semibold ml-3"><p>{% trans "MB (0 = Unlimited)" %}</p>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">Bandwidth</p>
</div>
<div>
<input type="number" class="w-80 bg-gray-100 rounded px-2 py-1"
ng-model="$parent.bandwidth" required>
</div>
<div class="text-orange-500 font-semibold ml-3"><p>{% trans "MB (0 = Unlimited)" %}</p>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">FTP Account</p>
</div>
<div>
<input type="number" class="w-80 bg-gray-100 rounded px-2 py-1"
ng-model="$parent.ftpAccounts" required>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">Databases</p>
</div>
<div>
<input type="number" class="w-80 bg-gray-100 rounded px-2 py-1"
ng-model="$parent.dataBases" required>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">Emails</p>
</div>
<div>
<input type="number" class="w-80 bg-gray-100 rounded px-2 py-1"
ng-model="$parent.emails" required>
</div>
</div>
<div ng-hide="installationDetailsForm">
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">Additional</p>
</div>
<div>
<div>
<label>
<input ng-model="$parent.allowFullDomain"
type="checkbox" value="">
Allow Creation of Fully Qualified Domain as
Child-Domains
</label>
</div>
<div>
<label>
<input ng-model="$parent.enforceDiskLimits"
type="checkbox" value="">
Enforce Disk Limits
</label>
</div>
</div>
</div>
</div>
</form>
<div class="flex justify-end mt-3">
<button ng-click="saveChanges()"
data-modal-toggle="edit"
data-modal-hide="edit"
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
Save
</button>
<button data-modal-toggle="edit"
data-modal-hide="edit"
class="ml-2 bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded">
Close
</button>
</div>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -94,13 +94,13 @@
<p class="font-semibold w-60">Additional Features</p>
</div>
<div>
<div class="checkbox">
<div>
<label>
<input ng-model="allowFullDomain" type="checkbox" value="">
Allow Creation of Fully Qualified Domain as Child-Domains
</label>
</div>
<div class="checkbox">
<div>
<label>
<input ng-model="enforceDiskLimits" type="checkbox" value="">
Enforce Disk Limits

View File

@@ -1,3 +1,4 @@
{% extends "baseTemplate/index.html" %}
{% load i18n %}
{% block title %}{% trans "List Users - CyberPanel" %}{% endblock %}

View File

@@ -68,81 +68,31 @@
class="bg-orange-500 px-2 py-1 text-white" href="#"
ng-click="controlUserState(record.name, 'ACTIVATE')"
title=""><span>{% trans 'Activate' %}</span></a>
<button ng-click="deleteUserInitial(record.name)" data-modal-target="DeleteListUser"
data-modal-toggle="DeleteListUser"
class="bg-orange-500 px-2 py-1 text-white"
type="button">
Delete
</button>
<div id="DeleteListUser" tabindex="-1"
<a onclick="return false;"
ng-click="editInitial(record.name)"
class="bg-orange-500 px-2 py-1 text-white"
href="#" data-modal-target="editUser" data-modal-toggle="editUser">{% trans "EDIT" %}
</a>
<div id="editUser" tabindex="-1"
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
<div class="relative p-4 w-full max-w-md max-h-full">
<div class="relative bg-white rounded-lg shadow dark:bg-gray-700">
<button type="button" data-modal-toggle="DeleteListUser"
class="absolute top-3 end-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white"
data-modal-hide="DeleteListUser">
<svg class="w-3 h-3" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
</svg>
<span class="sr-only">Close modal</span>
</button>
<div class="p-4 md:p-5 text-center">
<svg class="mx-auto mb-4 text-gray-400 w-12 h-12 dark:text-gray-200"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 20 20">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="M10 11V6m0 8h.01M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/>
</svg>
<h3 class="mb-5 text-lg font-normal text-gray-500 dark:text-gray-400">
Are you sure you want to
delete this user {$ UserToDelete $} ?</h3>
<button ng-click="deleteUserFinal()" data-modal-hide="DeleteListUser"
type="button"
data-modal-toggle="DeleteListUser"
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2">
Yes, I'm sure
</button>
<button data-modal-hide="DeleteListUser" type="button"
data-modal-toggle="DeleteListUser"
class="text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600">
No, cancel
<div class="relative p-4 w-full max-w-2xl max-h-full">
<div class="relative bg-white shadow dark:bg-gray-700">
<div class="flex items-center bg-blue-400 px-4 py-4">
<p class="font-bold">Edit User</p>
<button type="button" data-modal-toggle="editUser"
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
data-modal-hide="editUser">
<svg class="w-3 h-3" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
</svg>
<span class="sr-only">Close modal</span>
</button>
</div>
</div>
</div>
</div>
<button ng-click="editInitial(record.name)" data-modal-target="EditListUser"
data-modal-toggle="EditListUser"
class="bg-orange-500 px-2 py-1 text-white"
type="button">
Edit
</button>
<div id="EditListUser" tabindex="-1"
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
<div>
<div class="relative bg-white rounded-lg shadow dark:bg-gray-700">
<h2 class="px-4 py-4 font-bold text-xl">Edit Users</h2>
<button type="button" data-modal-toggle="EditListUser"
class="absolute top-3 end-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white"
data-modal-hide="EditListUser">
<svg class="w-3 h-3" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
</svg>
<span class="sr-only">Close modal</span>
</button>
<div class="p-4">
<div class="p-4 md:p-5">
<div ng-hide="installationDetailsForm" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Name</p>
@@ -185,129 +135,179 @@
</div>
</div>
</div>
<a onclick="return false;"
ng-click="deleteUserInitial(record.name)"
class="bg-orange-500 px-2 py-1 text-white ml-1"
href="#" data-modal-target="DeleteListUser"
data-modal-toggle="DeleteListUser">{% trans "Delete" %}
</a>
<div id="DeleteListUser" tabindex="-1"
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
<div class="relative p-4 w-full max-w-2xl max-h-full">
<div class="relative bg-white shadow dark:bg-gray-700">
<div class="flex items-center bg-blue-400 px-4 py-4">
<p class="font-bold">Edit User</p>
<button type="button" data-modal-toggle="DeleteListUser"
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
data-modal-hide="DeleteListUser">
<svg class="w-3 h-3" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
</svg>
<span class="sr-only">Close modal</span>
</button>
</div>
<div class="p-4 md:p-5">
<svg class="mx-auto mb-4 text-gray-400 w-12 h-12 dark:text-gray-200"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 20 20">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="M10 11V6m0 8h.01M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/>
</svg>
<h3 class="mb-5 text-lg font-normal text-gray-500 dark:text-gray-400">
Are you sure you want to
delete this user {$ UserToDelete $} ?</h3>
<button ng-click="deleteUserFinal()" data-modal-hide="DeleteListUser"
type="button"
data-modal-toggle="DeleteListUser"
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2">
Yes, I'm sure
</button>
<button data-modal-hide="DeleteListUser" type="button"
data-modal-toggle="DeleteListUser"
class="text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600">
No, cancel
</button>
</div>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
{# <div>#}
{# <button ng-click="deleteUserInitial(record.name)" data-modal-target="DeleteListUser"#}
{# data-modal-toggle="DeleteListUser"#}
{# class="bg-orange-500 px-2 py-1 text-white"#}
{# type="button">#}
{# Delete#}
{# </button>#}
{##}
{# <div id="DeleteListUser" tabindex="-1"#}
{# class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">#}
{# <div class="relative p-4 w-full max-w-md max-h-full">#}
{# <div class="relative bg-white rounded-lg shadow dark:bg-gray-700">#}
{# <button type="button" data-modal-toggle="DeleteListUser"#}
{# class="absolute top-3 end-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white"#}
{# data-modal-hide="DeleteListUser">#}
{# <svg class="w-3 h-3" aria-hidden="true"#}
{# xmlns="http://www.w3.org/2000/svg" fill="none"#}
{# viewBox="0 0 14 14">#}
{# <path stroke="currentColor" stroke-linecap="round"#}
{# stroke-linejoin="round" stroke-width="2"#}
{# d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>#}
{# </svg>#}
{# <span class="sr-only">Close modal</span>#}
{# </button>#}
{# <div class="p-4 md:p-5 text-center">#}
{# <svg class="mx-auto mb-4 text-gray-400 w-12 h-12 dark:text-gray-200"#}
{# aria-hidden="true"#}
{# xmlns="http://www.w3.org/2000/svg" fill="none"#}
{# viewBox="0 0 20 20">#}
{# <path stroke="currentColor" stroke-linecap="round"#}
{# stroke-linejoin="round" stroke-width="2"#}
{# d="M10 11V6m0 8h.01M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/>#}
{# </svg>#}
{# <h3 class="mb-5 text-lg font-normal text-gray-500 dark:text-gray-400">#}
{# Are you sure you want to#}
{# delete this user {$ UserToDelete $} ?</h3>#}
{# <button ng-click="deleteUserFinal()" data-modal-hide="DeleteListUser" type="button"#}
{# data-modal-toggle="DeleteListUser"#}
{# class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2">#}
{# Yes, I'm sure#}
{# </button>#}
{# <button data-modal-hide="DeleteListUser" type="button"#}
{# data-modal-toggle="DeleteListUser"#}
{# class="text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600">#}
{# No, cancel#}
{# </button>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# <div>#}
{# <button ng-click="editInitial(record.name)" data-modal-target="EditListUser"#}
{# data-modal-toggle="EditListUser"#}
{# class="bg-orange-500 px-2 py-1 text-white"#}
{# type="button">#}
{# Edit#}
{# </button>#}
{##}
{# <div id="EditListUser" tabindex="-1"#}
{# class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">#}
{# <div>#}
{# <div class="relative bg-white rounded-lg shadow dark:bg-gray-700">#}
{# <h2 class="px-4 py-4 font-bold text-xl">Edit Users</h2>#}
{# <button type="button" data-modal-toggle="EditListUser"#}
{# class="absolute top-3 end-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white"#}
{# data-modal-hide="EditListUser">#}
{# <svg class="w-3 h-3" aria-hidden="true"#}
{# xmlns="http://www.w3.org/2000/svg" fill="none"#}
{# viewBox="0 0 14 14">#}
{# <path stroke="currentColor" stroke-linecap="round"#}
{# stroke-linejoin="round" stroke-width="2"#}
{# d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>#}
{# </svg>#}
{# <span class="sr-only">Close modal</span>#}
{# </button>#}
{# <div class="p-4">#}
{# <div ng-hide="installationDetailsForm" class="flex mt-4 py-2 px-6">#}
{# <div>#}
{# <p class="font-semibold w-60">Name</p>#}
{# </div>#}
{# <div>#}
{# <input name="name" type="text" class="w-80 bg-gray-100 rounded px-2 py-1"#}
{# ng-model="name" readonly>#}
{# </div>#}
{# </div>#}
{# <div class="flex py-2 px-6">#}
{# <div>#}
{# <p class="font-semibold w-60">New Owner</p>#}
{# </div>#}
{# <div>#}
{# <select ng-change="saveResellerChanges()"#}
{# ng-model="$parent.newOwner"#}
{# class="w-80 bg-gray-100 rounded px-2 py-1">#}
{# {% for items in resellerPrivUsers %}#}
{# <option>{{ items }}</option>#}
{# {% endfor %}#}
{# </select>#}
{# </div>#}
{# </div>#}
{# <div class="flex py-2 px-6">#}
{# <div>#}
{# <p class="font-semibold w-60">Select ACL</p>#}
{# </div>#}
{# <div>#}
{# <select ng-change="changeACLFunc()"#}
{# ng-model="$parent.selectedACL"#}
{# class="w-80 bg-gray-100 rounded px-2 py-1">#}
{# {% for items in aclNames %}#}
{# <option>{{ items }}</option>#}
{# {% endfor %}#}
{# </select>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
<li>
<a onclick="return false;"
ng-click="editInitial(record.name)"
class="bg-orange-500 px-2 py-1 text-white ml-1"
href="#" data-modal-target="edit" data-modal-toggle="edit"><i class="fa fa-folder"
aria-hidden="true"></i> {% trans "EDIT" %}
</a>
<div id="edit" tabindex="-1"
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
<div class="relative p-4 w-full max-w-2xl max-h-full">
<div class="relative bg-white shadow dark:bg-gray-700">
<div class="flex items-center bg-blue-400 px-4 py-4">
<p class="font-bold">Edit User</p>
<button type="button" data-modal-toggle="edit"
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
data-modal-hide="edit">
<svg class="w-3 h-3" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
</svg>
<span class="sr-only">Close modal</span>
</button>
</div>
<div class="p-4 md:p-5">
<div ng-hide="installationDetailsForm" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Name</p>
</div>
<div>
<input name="name" type="text"
class="w-80 bg-gray-100 rounded px-2 py-1"
ng-model="name" readonly>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">New Owner</p>
</div>
<div>
<select ng-change="saveResellerChanges()"
ng-model="$parent.newOwner"
class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in resellerPrivUsers %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">Select ACL</p>
</div>
<div>
<select ng-change="changeACLFunc()"
ng-model="$parent.selectedACL"
class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in aclNames %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
</div>
</div>
</div>
</div>
</li>
<li>
<a onclick="return false;"
ng-click="deleteUserInitial(record.name)"
class="bg-orange-500 px-2 py-1 text-white ml-1"
href="#" data-modal-target="delete" data-modal-toggle="delete"><i class="fa fa-folder"
aria-hidden="true"></i> {% trans "Delete" %}
</a>
<div id="delete" tabindex="-1"
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
<div class="relative p-4 w-full max-w-2xl max-h-full">
<div class="relative bg-white shadow dark:bg-gray-700">
<div class="flex items-center bg-blue-400 px-4 py-4">
<p class="font-bold">Deleting User {$ UserToDelete $}</p>
<img ng-hide="cyberpanelLoading"
src="{% static 'images/loading.gif' %}">
<button type="button" data-modal-toggle="delete"
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
data-modal-hide="delete">
<svg class="w-3 h-3" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
</svg>
<span class="sr-only">Close modal</span>
</button>
</div>
<div class="p-4 md:p-5">
<p style="color: red; font-size: larger">This will delete all sites
owned by this user and this
process can not be reversed.</p>
</div>
<div class="flex justify-end px-3 py-3">
<button ng-click="deleteUserFinal()"
class="bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded">
Delete Now
</button>
<button data-modal-hide="delete" data-modal-toggle="delete"
class="ml-2 bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded">
Close
</button>
</div>
</div>
</div>
</div>
</li>
{% endblock %}

View File

@@ -1,6 +1,5 @@
newapp.controller('createWebsiteV2', function ($scope, $http, $timeout, $window) {
alert('Create Website V2 loading')
$scope.webSiteCreationLoading = true;
$scope.installationDetailsForm = false;
$scope.installationProgress = true;
@@ -463,7 +462,7 @@ newapp.controller('websitePagesV2', function ($scope, $http, $timeout, $window)
$scope.hideLogs = true;
};
$scope.fileManagerURLV2 = "/filemanagerv2/" + $("#domainNamePageV2").text() ;
$scope.fileManagerURLV2 = "/filemanagerv2/" + $("#domainNamePageV2").text();
$scope.wordPressInstallURLV2 = $("#domainNamePageV2").text() + "/wordpressInstall";
$scope.joomlaInstallURLV2 = $("#domainNamePageV2").text() + "/joomlaInstall";
$scope.setupGitV2 = $("#domainNamePageV2").text() + "/setupGitV2";
@@ -2758,6 +2757,13 @@ newapp.controller('modifyWebsitesControllerV2', function ($scope, $http) {
};
});
$("#canNotModify").hide();
$("#webSiteDetailsToBeModified").hide();
$("#websiteModifyFailure").hide();
$("#websiteModifySuccess").hide();
$("#websiteSuccessfullyModified").hide();
$("#modifyWebsiteLoading").hide();
$("#modifyWebsiteButton").hide();
newapp.controller('suspendWebsiteControlV2', function ($scope, $http) {
@@ -6247,6 +6253,140 @@ function AppendToTable(table, markup) {
$(table).append(markup);
}
newapp.controller('RemoteBackupConfigV2', function ($scope, $http, $timeout, $window) {
$scope.RemoteBackupLoading = true;
$scope.SFTPBackUpdiv = true;
$scope.EndpointURLdiv = true;
$scope.Selectprovider = true;
$scope.S3keyNamediv = true;
$scope.Accesskeydiv = true;
$scope.SecretKeydiv = true;
$scope.SelectRemoteBackuptype = function () {
var val = $scope.RemoteBackuptype;
if (val == "SFTP") {
$scope.SFTPBackUpdiv = false;
$scope.EndpointURLdiv = true;
$scope.Selectprovider = true;
$scope.S3keyNamediv = true;
$scope.Accesskeydiv = true;
$scope.SecretKeydiv = true;
} else if (val == "S3") {
$scope.EndpointURLdiv = true;
$scope.Selectprovider = false;
$scope.S3keyNamediv = false;
$scope.Accesskeydiv = false;
$scope.SecretKeydiv = false;
$scope.SFTPBackUpdiv = true;
} else {
$scope.RemoteBackupLoading = true;
$scope.SFTPBackUpdiv = true;
$scope.EndpointURLdiv = true;
$scope.Selectprovider = true;
$scope.S3keyNamediv = true;
$scope.Accesskeydiv = true;
$scope.SecretKeydiv = true;
}
}
$scope.SelectProvidertype = function () {
$scope.EndpointURLdiv = true;
var provider = $scope.Providervalue
if (provider == 'Backblaze') {
$scope.EndpointURLdiv = false;
} else {
$scope.EndpointURLdiv = true;
}
}
$scope.SaveBackupConfig = function () {
$scope.RemoteBackupLoading = false;
var Hname = $scope.Hostname;
var Uname = $scope.Username;
var Passwd = $scope.Password;
var path = $scope.path;
var type = $scope.RemoteBackuptype;
var Providervalue = $scope.Providervalue;
var data;
if (type == "SFTP") {
data = {
Hname: Hname,
Uname: Uname,
Passwd: Passwd,
path: path,
type: type
}
} else if (type == "S3") {
if (Providervalue == "Backblaze") {
data = {
S3keyname: $scope.S3keyName,
Provider: Providervalue,
AccessKey: $scope.Accesskey,
SecertKey: $scope.SecretKey,
EndUrl: $scope.EndpointURL,
type: type
}
} else {
data = {
S3keyname: $scope.S3keyName,
Provider: Providervalue,
AccessKey: $scope.Accesskey,
SecertKey: $scope.SecretKey,
type: type
}
}
}
var url = "/websites/SaveBackupConfig";
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
$scope.RemoteBackupLoading = true;
if (response.data.status === 1) {
new PNotify({
title: 'Success!',
text: 'Successfully Saved!.',
type: 'success'
});
location.reload();
} else {
new PNotify({
title: 'Error!',
text: response.data.error_message,
type: 'error'
});
}
}
function cantLoadInitialDatas(response) {
$scope.RemoteBackupLoading = true;
new PNotify({
title: 'Operation Failed!',
text: response.data.error_message,
type: 'error'
});
}
}
});
newapp.controller('WPAddNewPluginV2', function ($scope, $http, $timeout, $window, $compile) {
$scope.webSiteCreationLoading = true;
@@ -6544,6 +6684,712 @@ function showTab(tabId, tabColour) {
}
}
newapp.controller('ApacheManagerV2', function ($scope, $http, $timeout) {
$scope.cyberpanelloading = true;
$scope.apacheOLS = true;
$scope.pureOLS = true;
$scope.lswsEnt = true;
var apache = 1, ols = 2, lsws = 3;
var statusFile;
$scope.getSwitchStatus = function () {
$scope.cyberpanelloading = false;
url = "/websites/getSwitchStatus";
var data = {
domainName: $("#domainNamePage").text()
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialData, cantLoadInitialData);
function ListInitialData(response) {
$scope.cyberpanelloading = true;
if (response.data.status === 1) {
if (response.data.server === apache) {
$scope.apacheOLS = false;
$scope.pureOLS = true;
$scope.lswsEnt = true;
$scope.configData = response.data.configData;
$scope.pmMaxChildren = response.data.pmMaxChildren;
$scope.pmStartServers = response.data.pmStartServers;
$scope.pmMinSpareServers = response.data.pmMinSpareServers;
$scope.pmMaxSpareServers = response.data.pmMaxSpareServers;
$scope.phpPath = response.data.phpPath;
} else if (response.data.server === ols) {
$scope.apacheOLS = true;
$scope.pureOLS = false;
$scope.lswsEnt = true;
} else {
$scope.apacheOLS = true;
$scope.pureOLS = true;
$scope.lswsEnt = false;
}
//$scope.records = JSON.parse(response.data.data);
} else {
new PNotify({
title: 'Operation Failed!',
text: response.data.error_message,
type: 'error'
});
}
}
function cantLoadInitialData(response) {
$scope.cyberpanelloading = true;
new PNotify({
title: 'Operation Failed!',
text: 'Could not connect to server, please refresh this page.',
type: 'error'
});
}
};
$scope.getSwitchStatus();
$scope.switchServer = function (server) {
$scope.cyberpanelloading = false;
$scope.functionProgress = {"width": "0%"};
$scope.functionStatus = 'Starting conversion..';
url = "/websites/switchServer";
var data = {
domainName: $("#domainNamePage").text(),
phpSelection: $scope.phpSelection,
server: server
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialData, cantLoadInitialData);
function ListInitialData(response) {
if (response.data.status === 1) {
statusFile = response.data.tempStatusPath;
statusFunc();
} else {
$scope.cyberpanelloading = true;
new PNotify({
title: 'Operation Failed!',
text: response.data.error_message,
type: 'error'
});
}
}
function cantLoadInitialData(response) {
$scope.cyberpanelloading = true;
new PNotify({
title: 'Operation Failed!',
text: 'Could not connect to server, please refresh this page.',
type: 'error'
});
}
};
function statusFunc() {
$scope.cyberpanelloading = false;
url = "/websites/statusFunc";
var data = {
statusFile: statusFile
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialData, cantLoadInitialData);
function ListInitialData(response) {
if (response.data.status === 1) {
if (response.data.abort === 1) {
$scope.functionProgress = {"width": "100%"};
$scope.functionStatus = response.data.currentStatus;
$scope.cyberpanelloading = true;
$timeout.cancel();
$scope.getSwitchStatus();
} else {
$scope.functionProgress = {"width": response.data.installationProgress + "%"};
$scope.functionStatus = response.data.currentStatus;
$timeout(statusFunc, 3000);
}
} else {
$scope.cyberpanelloading = true;
$scope.functionStatus = response.data.error_message;
$scope.functionProgress = {"width": response.data.installationProgress + "%"};
$timeout.cancel();
}
}
function cantLoadInitialData(response) {
$scope.functionProgress = {"width": response.data.installationProgress + "%"};
$scope.functionStatus = 'Could not connect to server, please refresh this page.';
$timeout.cancel();
}
}
$scope.tuneSettings = function () {
$scope.cyberpanelloading = false;
url = "/websites/tuneSettings";
var data = {
domainName: $("#domainNamePage").text(),
pmMaxChildren: $scope.pmMaxChildren,
pmStartServers: $scope.pmStartServers,
pmMinSpareServers: $scope.pmMinSpareServers,
pmMaxSpareServers: $scope.pmMaxSpareServers,
phpPath: $scope.phpPath
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialData, cantLoadInitialData);
function ListInitialData(response) {
$scope.cyberpanelloading = true;
if (response.data.status === 1) {
new PNotify({
title: 'Success',
text: 'Changes successfully applied.',
type: 'success'
});
} else {
$scope.cyberpanelloading = true;
new PNotify({
title: 'Operation Failed!',
text: response.data.error_message,
type: 'error'
});
}
}
function cantLoadInitialData(response) {
$scope.cyberpanelloading = true;
new PNotify({
title: 'Operation Failed!',
text: 'Could not connect to server, please refresh this page.',
type: 'error'
});
}
};
$scope.saveApacheConfig = function () {
$scope.cyberpanelloading = false;
url = "/websites/saveApacheConfigsToFile";
var data = {
domainName: $("#domainNamePage").text(),
configData: $scope.configData
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialData, cantLoadInitialData);
function ListInitialData(response) {
$scope.cyberpanelloading = true;
if (response.data.status === 1) {
new PNotify({
title: 'Success',
text: 'Changes successfully applied.',
type: 'success'
});
} else {
$scope.cyberpanelloading = true;
new PNotify({
title: 'Operation Failed!',
text: response.data.error_message,
type: 'error'
});
}
}
function cantLoadInitialData(response) {
$scope.cyberpanelloading = true;
new PNotify({
title: 'Operation Failed!',
text: 'Could not connect to server, please refresh this page.',
type: 'error'
});
}
};
});
function DeletePluginBuucket(url) {
DeletePluginURL = url;
}
function FinalDeletePluginBuucket() {
window.location.href = DeletePluginURL;
}
newapp.controller('RestoreWPBackupV2', function ($scope, $http, $timeout, $window) {
$scope.wordpresshomeloading = true;
$scope.stagingDetailsForm = false;
$scope.installationProgress = true;
$scope.errorMessageBox = true;
$scope.success = true;
$scope.couldNotConnect = true;
$scope.goBackDisable = true;
$scope.checkmethode = function () {
var val = $('#RestoreMethode').children("option:selected").val();
if (val == 1) {
$('#Newsitediv').show();
$('#exinstingsitediv').hide();
} else if (val == 0) {
$('#exinstingsitediv').show();
$('#Newsitediv').hide();
} else {
}
};
$scope.RestoreWPbackupNow = 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 = "Start Restoring WordPress..";
var Domain = $('#wprestoresubdirdomain').val()
var path = $('#wprestoresubdirpath').val();
var home = "1";
if (typeof path != 'undefined' || path != '') {
home = "0";
}
if (typeof path == 'undefined') {
path = "";
}
var backuptype = $('#backuptype').html();
var data;
if (backuptype == "DataBase Backup") {
data = {
backupid: $('#backupid').html(),
DesSite: $('#DesSite').children("option:selected").val(),
Domain: '',
path: path,
home: home,
}
} else {
data = {
backupid: $('#backupid').html(),
DesSite: $('#DesSite').children("option:selected").val(),
Domain: Domain,
path: path,
home: home,
}
}
var url = "/websites/RestoreWPbackupNow";
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
// console.log(data)
var d = $('#DesSite').children("option:selected").val();
var c = $("input[name=Newdomain]").val();
// if (d == -1 || c == "") {
// alert("Please Select Method of Backup Restore");
// } else {
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
// }
function ListInitialDatas(response) {
wordpresshomeloading = true;
$('#wordpresshomeloading').hide();
if (response.data.status === 1) {
new PNotify({
title: 'Success!',
text: 'Restoring process starts!.',
type: 'success'
});
statusFile = response.data.tempStatusPath;
getCreationStatus();
} else {
$('#wordpresshomeloading').hide();
$scope.wordpresshomeloading = true;
$scope.installationDetailsForm = true;
$scope.installationProgress = false;
$scope.errorMessageBox = false;
$scope.success = true;
$scope.couldNotConnect = true;
$scope.goBackDisable = false;
$scope.errorMessage = response.data.error_message;
}
}
function cantLoadInitialDatas(response) {
$('#wordpresshomeloading').hide();
new PNotify({
title: 'Operation Failed!',
text: response.data.error_message,
type: 'error'
});
}
}
function getCreationStatus() {
$('#wordpresshomeloading').show();
url = "/websites/installWordpressStatus";
var data = {
statusFile: statusFile
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
$('#wordpresshomeloading').hide();
if (response.data.abort === 1) {
if (response.data.installStatus === 1) {
$scope.wordpresshomeloading = true;
$scope.stagingDetailsForm = true;
$scope.installationProgress = false;
$scope.errorMessageBox = true;
$scope.success = false;
$scope.couldNotConnect = true;
$scope.goBackDisable = false;
$("#installProgress").css("width", "100%");
$("#installProgressbackup").css("width", "100%");
$scope.installPercentage = "100";
$scope.currentStatus = response.data.currentStatus;
$timeout.cancel();
} else {
$scope.wordpresshomeloading = true;
$scope.stagingDetailsForm = true;
$scope.installationProgress = false;
$scope.errorMessageBox = false;
$scope.success = true;
$scope.couldNotConnect = true;
$scope.goBackDisable = false;
$scope.errorMessage = response.data.error_message;
$("#installProgress").css("width", "0%");
$("#installProgressbackup").css("width", "0%");
$scope.installPercentage = "0";
$scope.goBackDisable = false;
}
} else {
$("#installProgress").css("width", response.data.installationProgress + "%");
$("#installProgressbackup").css("width", response.data.installationProgress + "%");
$scope.installPercentage = response.data.installationProgress;
$scope.currentStatus = response.data.currentStatus;
$timeout(getCreationStatus, 1000);
}
}
function cantLoadInitialDatas(response) {
$('#wordpresshomeloading').hide();
$scope.wordpresshomeloading = true;
$scope.stagingDetailsForm = true;
$scope.installationProgress = false;
$scope.errorMessageBox = true;
$scope.success = true;
$scope.couldNotConnect = false;
$scope.goBackDisable = false;
}
}
$scope.goBack = function () {
$('#wordpresshomeloading').hide();
$scope.wordpresshomeloading = true;
$scope.stagingDetailsForm = false;
$scope.installationProgress = true;
$scope.errorMessageBox = true;
$scope.success = true;
$scope.couldNotConnect = true;
$scope.goBackDisable = true;
$("#installProgress").css("width", "0%");
};
});
newapp.controller('BackupScheduleV2', function ($scope, $http, $timeout, $window) {
$scope.BackupScheduleLoading = true;
$scope.SaveBackupSchedule = function () {
$scope.RemoteBackupLoading = false;
var FileRetention = $scope.Fretention;
var Backfrequency = $scope.Bfrequency;
var data = {
FileRetention: FileRetention,
Backfrequency: Backfrequency,
ScheduleName: $scope.ScheduleName,
RemoteConfigID: $('#RemoteConfigID').html(),
BackupType: $scope.BackupType
}
var url = "/websites/SaveBackupSchedule";
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
$scope.RemoteBackupLoading = true;
if (response.data.status === 1) {
new PNotify({
title: 'Success!',
text: 'Successfully Saved!.',
type: 'success'
});
location.reload();
} else {
new PNotify({
title: 'Error!',
text: response.data.error_message,
type: 'error'
});
}
}
function cantLoadInitialDatas(response) {
$scope.RemoteBackupLoading = true;
new PNotify({
title: 'Operation Failed!',
text: response.data.error_message,
type: 'error'
});
}
};
$scope.getupdateid = function (ID) {
UpdatescheduleID = ID;
}
$scope.UpdateRemoteschedules = function () {
$scope.RemoteBackupLoading = false;
var Frequency = $scope.RemoteFrequency;
var fretention = $scope.RemoteFileretention;
var data = {
ScheduleID: UpdatescheduleID,
Frequency: Frequency,
FileRetention: fretention
}
var url = "/websites/UpdateRemoteschedules";
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
$scope.RemoteBackupLoading = true;
if (response.data.status === 1) {
new PNotify({
title: 'Success!',
text: 'Successfully Updated!.',
type: 'success'
});
location.reload();
} else {
new PNotify({
title: 'Error!',
text: response.data.error_message,
type: 'error'
});
}
}
function cantLoadInitialDatas(response) {
$scope.RemoteBackupLoading = true;
new PNotify({
title: 'Operation Failed!',
text: response.data.error_message,
type: 'error'
});
}
};
$scope.AddWPsiteforRemoteBackup = function () {
$scope.RemoteBackupLoading = false;
var data = {
WpsiteID: $('#Wpsite').val(),
RemoteScheduleID: $('#RemoteScheduleID').html()
}
var url = "/websites/AddWPsiteforRemoteBackup";
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
$scope.RemoteBackupLoading = true;
if (response.data.status === 1) {
new PNotify({
title: 'Success!',
text: 'Successfully Saved!.',
type: 'success'
});
location.reload();
} else {
new PNotify({
title: 'Error!',
text: response.data.error_message,
type: 'error'
});
}
}
function cantLoadInitialDatas(response) {
$scope.RemoteBackupLoading = true;
new PNotify({
title: 'Operation Failed!',
text: response.data.error_message,
type: 'error'
});
}
};
});
function DeleteBackupConfigNow(url) {
window.location.href = url;
}
function DeleteRemoteBackupsiteNow(url) {
window.location.href = url;
}
function DeleteBackupfileConfigNow(url) {
window.location.href = url;
}

View File

@@ -33,7 +33,6 @@
{% for i in WPsites %}
<option value="{{ i.id }}">{{ i.title }}</option>
{% endfor %}
</select>
</div>
</div>

View File

@@ -0,0 +1,82 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="BackupScheduleV2" class="p-8">
<div>
<p class="text-4xl font-bold">Backup Sites Configurations</p>
</div>
<div class="py-4">
<p class="text-xl font-bold">Add WordPress Sites for Remote Backup</p>
<img ng-hide="BackupScheduleLoading"
src="{% static 'images/loading.gif' %}">
</div>
<hr>
<form name="websiteCreationForm" action="/" id="createPackages">
<span style="display: none" id="RemoteScheduleID"> {{ RemoteScheduleID }}</span>
<div ng-hide="installationDetailsForm" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-48">Selecte WordPress Site</p>
</div>
<div>
<select ng-model="Wpsite" id="Wpsite"
class="w-80 bg-gray-100 rounded px-2 py-1">
{% for i in WPsites %}
<option value="{{ i.id }}">{{ i.title }}</option>
{% endfor %}
</select>
</div>
</div>
<div ng-hide="installationDetailsForm" class="flex justify-center mt-3">
<button ng-click="AddWPsiteforRemoteBackup()"
class="bg-orange-500 px-3 py-2 rounded-lg text-xl font-semibold text-white">
Save Backup Schedule
</button>
</div>
</form>
<div class="py-4">
<p class="text-xl font-bold">Saved Sites For Remote Backup</p>
</div>
<div class="relative py-8 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr>
<th scope="col" class="px-6 py-3">
ID
</th>
<th scope="col" class="px-6 py-3">
WordPress Title
</th>
<th scope="col" class="px-6 py-3">
Action
</th>
</tr>
</thead>
{% for sub in RemoteBackupsites %}
<tbody class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td class="px-6 py-4 font-bold">
{{ sub.id }}
</td>
<td class="px-6 py-4">
{{ sub.Title }}
</td>
<td class="px-6 py-4">
<button aria-label=""
onclick="DeleteRemoteBackupsiteNow('{% url 'AddRemoteBackupsiteV2' %}?ID={{ RemoteScheduleID }}&DeleteID={{ sub.id }}')"
type="button"
class="bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded">
Delete
</button>
</td>
</tr>
</tbody>
{% endfor %}
</table>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,347 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
{% if apachemanager %}
<div ng-controller="ApacheManagerV2" class="p-8">
<div>
<p class="text-4xl font-bold">Apache Manager</p>
<p class="text-xs text-gray-600 py-2 font-semibold">Switch between Apache (as reverse proxy) and
OpenLiteSpeed.</p>
</div>
<div>
<div class="flex items-center py-4">
<p id="domainNamePage" class="text-xl font-bold">{{ domainName }}</p>
<img ng-hide="cyberpanelloading"
src="{% static 'images/loading.gif' %}">
</div>
<div ng-hide="apacheOLS" class="flex items-center py-4">
<p id="domainNamePage" class="text-gray-500 font-bold">
<span class="text-red-500">{{ domainName }}</span> is currently using Apache as
Reverse
Proxy to
OpenLiteSpeed.</p>
<img style="height: 25px" ng-hide="cyberpanelloading"
src="{% static 'images/loading.gif' %}">
</div>
<hr>
<div>
<div ng-hide="apacheOLS" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">PHP</p>
</div>
<div>
<select ng-model="phpSelection" class="w-80 bg-gray-100 rounded px-2 py-1"
id="example-select">
{% for php in phps %}
<option>{{ php }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="mt-3 py-2 px-6">
<a onclick="return false;"
ng-hide="apacheOLS"
ng-click="switchServer(2)"
class="bg-orange-500 px-3 py-1 font-semibold text-white"
href="#" data-modal-target="switchToPure" data-modal-toggle="switchToPure">
Switch to pure OpenLiteSpeed.
</a>
<div id="switchToPure" tabindex="-1"
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
<div class="relative p-4 w-full max-w-2xl max-h-full">
<div class="relative bg-white shadow dark:bg-gray-700">
<div class="flex items-center bg-blue-400 px-4 py-4">
<p id="myLargeModalLabel" class="font-bold">{$ functionStatus $} <img
ng-hide="cyberpanelloading"
src="{% static 'images/loading.gif' %}"></p>
<button type="button" data-modal-toggle="switchToPure"
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
data-modal-hide="switchToPure">
<svg class="w-3 h-3" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
</svg>
<span class="sr-only">Close modal</span>
</button>
</div>
<div class="p-4 md:p-5">
<div class="w-full bg-gray-100 rounded-full mt-3">
<div ng-style="functionProgress" id="installProgress"
class="bg-green-600 text-xs font-medium text-white text-center p-2 leading-none rounded-full"
style="width:0%">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div ng-hide="apacheOLS">
<div class="py-2 px-6">
<div ng-hide="apacheOLS">
<p class="font-semibold w-60 text-xl">Apache Configurations</p>
</div>
<div>
<textarea ng-model="configData" rows="20" class="w-full border"></textarea>
</div>
<div ng-hide="saveConfigBtn" class="mt-2">
<button ng-click="saveApacheConfig()"
class="bg-orange-500 px-3 py-1 font-semibold text-white">
Save Apache Configurations
</button>
</div>
</div>
<div ng-hide="apacheOLS" class="flex items-center py-4">
<p class="text-xl font-bold">PHP-FPM Configurations</p>
<img style="height: 25px" ng-hide="cyberpanelloading"
src="{% static 'images/loading.gif' %}">
</div>
<div ng-hide="apacheOLS">
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">pm.max_children</p>
</div>
<div>
<input class="w-80 bg-gray-100 rounded px-2 py-1" type="text"
ng-model="pmMaxChildren"/>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">pm.start_servers</p>
</div>
<div>
<input class="w-80 bg-gray-100 rounded px-2 py-1" type="text"
ng-model="pmStartServers"/>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">pm.min_spare_servers</p>
</div>
<div>
<input class="w-80 bg-gray-100 rounded px-2 py-1" type="text"
ng-model="pmMinSpareServers"/>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">pm.max_spare_servers</p>
</div>
<div>
<input class="w-80 bg-gray-100 rounded px-2 py-1" type="text"
ng-model="pmMaxSpareServers"/>
</div>
</div>
</div>
<div class="py-2 px-6 mt-2">
<a ng-hide="apacheOLS" ng-click="tuneSettings()"
href="#" class="bg-orange-500 px-3 py-1 font-semibold text-white">Tune
PHP-FPM Settings.</a>
<p ng-hide="pureOLS" class="px-2 mt-2">
<span class="text-red-500 font-bold">{{ domainName }}</span> is currently using pure
OpenLiteSpeed, PHP-FPM is
not used with OpenLiteSpeed, thus tuning is disabled.</p>
<!-- Using OpenLiteSpeed -->
<p ng-hide="lswsEnt" class="px-2"><span
class="text-red-500 font-bold">{{ domainName }}</span> is
using LiteSpeed Enterprise.
PHP-FPM is not
used
with LiteSpeed
Enterprise.</p>
</div>
</div>
<div ng-hide="pureOLS" class="py-4">
<p class="text-gray-500 font-bold"><span
class="text-red-500 font-bold">{{ domainName }}</span> is currently using pure
OpenLiteSpeed.</p>
</div>
<hr>
<div ng-hide="pureOLS" class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">PHP</p>
</div>
<div>
<select ng-model="phpSelection" class="w-80 bg-gray-100 rounded px-2 py-1"
id="example-select">
{% for php in phps %}
<option>{{ php }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="mt-2 py-2 px-6">
<a onclick="return false;"
ng-hide="pureOLS"
ng-click="switchServer(1)"
class="bg-orange-500 px-3 py-1 font-semibold text-white"
href="#" data-modal-target="switchToOpenLiteSpeed" data-modal-toggle="switchToOpenLiteSpeed">
Switch to OpenLiteSpeed + Apache as reverse proxy.
</a>
<div id="switchToOpenLiteSpeed" tabindex="-1"
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
<div class="relative p-4 w-full max-w-2xl max-h-full">
<div class="relative bg-white shadow dark:bg-gray-700">
<div class="flex items-center bg-blue-400 px-4 py-4">
<p id="myLargeModalLabel" class="font-bold">{$ functionStatus $} <img
style="height: 25px"
ng-hide="cyberpanelloading"
src="{% static 'images/loading.gif' %}"></p>
<button type="button" data-modal-toggle="switchToOpenLiteSpeed"
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
data-modal-hide="switchToOpenLiteSpeed">
<svg class="w-3 h-3" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
</svg>
<span class="sr-only">Close modal</span>
</button>
</div>
<div class="p-4 md:p-5">
<div class="w-full bg-gray-100 rounded-full mt-3">
<div ng-style="functionProgress" id="installProgress"
class="bg-green-600 text-xs font-medium text-white text-center p-2 leading-none rounded-full"
style="width:0%">
</div>
</div>
</div>
</div>
</div>
</div>
<p ng-hide="lswsEnt" class="mt-2">
<span class="text-red-500 font-bold">{{ domainName }}</span>
is using LiteSpeed Enterprise. When LiteSpeed
Enterprise is active switching is not required.</p>
</div>
</div>
</div>
</div>
{% else %}
<style>
h1 {
color: #333;
margin-bottom: 15px;
}
h2 {
color: #555;
margin-bottom: 10px;
}
h3 {
color: #777;
margin-bottom: 5px;
}
p {
color: #444;
margin: 1%;
}
ol {
color: #444;
margin: 1%;
}
</style>
<div class="container">
<div id="page-title" align="center">
<h1><strong>OpenLiteSpeed + Apache as Backend </strong></h1>
<h1>Introducing CyberPanel's Revolutionary Hybrid Web Server: OpenLiteSpeed + Apache!</h1>
<p>
Are you seeking the ultimate web hosting solution that combines blazing-fast performance with
unparalleled feature versatility? Look no further! CyberPanel is proud to present its groundbreaking
new feature: the OpenLiteSpeed + Apache hybrid web server. This cutting-edge innovation is designed
to take your website's performance and functionality to unprecedented heights, offering the best of
both worlds in a single, seamless package.
</p>
<h2>Unmatched Speed with OpenLiteSpeed:</h2>
<p>
Harness the raw power of OpenLiteSpeed, the industry-leading, high-performance web server that
ensures lightning-fast response times and unparalleled efficiency. OpenLiteSpeed is renowned for its
remarkable performance capabilities, enabling your websites to handle a massive influx of traffic
without compromising on speed or reliability. Experience near-instantaneous page loads and swift
data transfers, providing an unbeatable user experience that keeps visitors engaged and coming back
for more.
</p>
<h2>Unrivaled Features with Apache:</h2>
<p>
While OpenLiteSpeed excels in speed and efficiency, we understand that Apache is favored by many web
developers for its extensive feature set and compatibility. CyberPanel's innovative hybrid approach
allows you to harness the full potential of Apache as a backend, granting access to an impressive
array of modules, scripts, and configurations. Enjoy the freedom to leverage the vast Apache
ecosystem, ensuring seamless integration with a wide range of applications and platforms.
</p>
<h2>The Perfect Fusion:</h2>
<p>
By merging OpenLiteSpeed and Apache, CyberPanel has created a truly game-changing web server
solution that combines the unparalleled speed of OpenLiteSpeed with the feature-rich environment of
Apache. The result is a synergistic combination that sets new industry standards, empowering you to
elevate your web hosting to unprecedented levels of performance and functionality.
</p>
<h3>Key Features and Benefits:</h3>
<ol>
<li>Lightning-Fast Performance: Experience unrivaled speed and responsiveness, ensuring your
websites load at blazing speeds, delighting visitors and improving search engine rankings.
</li>
<li>Versatile Feature Set: Harness the extensive features of Apache while benefiting from the speed
and efficiency of OpenLiteSpeed, providing unmatched flexibility and compatibility.
</li>
<li>Enhanced Security: CyberPanel's OpenLiteSpeed + Apache configuration includes robust security
measures to safeguard your websites and data against potential threats.
</li>
<li>Scalability and Stability: Enjoy the ability to handle high traffic loads effortlessly, ensuring
your websites remain stable and responsive under any circumstances.
</li>
<li>Easy Management: CyberPanel's user-friendly interface makes it simple to manage and configure
the OpenLiteSpeed + Apache hybrid web server, even for less experienced users.
</li>
<li>Cost-Effective Solution: Optimize your web hosting infrastructure with CyberPanel's innovative
hybrid web server, eliminating the need for costly hardware upgrades while boosting overall
performance.
</li>
</ol>
<p>
Unleash the true potential of your websites with CyberPanel's OpenLiteSpeed + Apache hybrid web
server. Experience unparalleled speed, efficiency, and versatility in one unified solution. Upgrade
your web hosting experience today and revolutionize the way you deliver content to your audience.
Embrace the future of web hosting with CyberPanel's groundbreaking innovation!
</p>
</div>
<p align="center">
<iframe width="788.54" height="443" src="https://www.youtube.com/embed/ts5wR9G2FsE"
title="YouTube video player" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowfullscreen></iframe>
</p>
<div style="margin-top: 2%">
<stripe-pricing-table pricing-table-id="prctbl_1MQtdYJMfY1fWGMszc4tx78j"
publishable-key="pk_live_51ITXBmJMfY1fWGMs2G0LAydJweIDMp2WaYocM0xyzdn03WaHUbMw6uxfVuktAkgpRyUql7tz7gF5OwdccEZLd6Ot00XX6tGoZx">
</stripe-pricing-table>
<stripe-pricing-table pricing-table-id="prctbl_1LpSqSJMfY1fWGMsxSNhPLsc"
publishable-key="pk_live_51ITXBmJMfY1fWGMs2G0LAydJweIDMp2WaYocM0xyzdn03WaHUbMw6uxfVuktAkgpRyUql7tz7gF5OwdccEZLd6Ot00XX6tGoZx">
</stripe-pricing-table>
<stripe-pricing-table pricing-table-id="prctbl_1M6WpCJMfY1fWGMsQXFlZWcW"
publishable-key="pk_live_51ITXBmJMfY1fWGMs2G0LAydJweIDMp2WaYocM0xyzdn03WaHUbMw6uxfVuktAkgpRyUql7tz7gF5OwdccEZLd6Ot00XX6tGoZx">
</stripe-pricing-table>
</div>
</div>
{% endif %}
{% endblock %}

View File

@@ -66,7 +66,6 @@
<option>Only DataBase</option>
<option>Only Website</option>
<option>Website and Database Both</option>
</select>
</div>
</div>

View File

@@ -0,0 +1,229 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="BackupScheduleV2" class="p-8">
<div>
<p class="text-4xl font-bold">Backup File Configurations</p>
</div>
<div class="py-4">
<p class="text-xl font-bold">Schedule Backups</p>
<img ng-hide="BackupScheduleLoading"
src="{% static 'images/loading.gif' %}">
</div>
<hr>
<form name="websiteCreationForm" action="/" id="createPackages">
<div ng-hide="installationDetailsForm" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-48">Schedule Name</p>
</div>
<div>
<input name="Hostname" type="text" class="w-80 bg-gray-100 rounded px-2 py-1"
ng-model="ScheduleName"
required>
</div>
</div>
<span style="display: none" id="RemoteConfigID"> {{ RemoteConfigID }}</span>
<div ng-hide="installationDetailsForm" class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Backup Frequency</p>
</div>
<div>
<select ng-model="Bfrequency"
class="w-80 bg-gray-100 rounded px-2 py-1">
<option>30 Minutes</option>
<option>1 Hour</option>
<option>6 Hours</option>
<option>12 Hours</option>
<option>1 Day</option>
<option>3 Days</option>
<option>1 Week</option>
</select>
</div>
</div>
<div ng-hide="installationDetailsForm" class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Backup File Retention</p>
</div>
<div>
<select ng-model="Fretention"
class="w-80 bg-gray-100 rounded px-2 py-1">
<option>3 Days</option>
<option>1 Week</option>
<option>3 Weeks</option>
<option>1 Month</option>
</select>
</div>
</div>
<div ng-hide="installationDetailsForm" class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Backup Type</p>
</div>
<div>
<select ng-model="BackupType"
class="w-80 bg-gray-100 rounded px-2 py-1">
<option>Only DataBase</option>
<option>Only Website</option>
<option>Website and Database Both</option>
</select>
</div>
</div>
<div ng-hide="installationDetailsForm" class="flex justify-center mt-3">
<button ng-click="SaveBackupSchedule()"
class="bg-orange-500 px-3 py-2 rounded-lg text-xl font-semibold text-white">
Save Backup Schedule
</button>
</div>
</form>
<div class="py-4">
<p class="text-xl font-bold">Configure Backup Schedules</p>
</div>
<div class="relative py-8 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr>
<th scope="col" class="px-6 py-3">
ID
</th>
<th scope="col" class="px-6 py-3">
Schedule Name
</th>
<th scope="col" class="px-6 py-3">
Backup Frequency
</th>
<th scope="col" class="px-6 py-3">
Backup File Retention
</th>
<th scope="col" class="px-6 py-3">
Last Run
</th>
<th scope="col" class="px-6 py-3">
Remote Configuration
</th>
<th scope="col" class="px-6 py-3">
Action
</th>
</tr>
</thead>
{% for sub in Backupschedule %}
<tbody class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td class="px-6 py-4 font-bold">
{{ sub.id }}
</td>
<td class="px-6 py-4">
{{ sub.Name }}
</td>
<td class="px-6 py-4">
{{ sub.Frequency }}
</td>
<td class="px-6 py-4">
{{ sub.Retention }}
</td>
<td class="px-6 py-4">
{{ sub.LastRun }}
</td>
<td class="px-6 py-4">
{{ sub.RemoteConfiguration }}
</td>
<td class="px-6 py-4">
<button onclick="return false;"
ng-click="getupdateid({{ sub.id }})"
class="bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded"
href="#" data-modal-target="edit" data-modal-toggle="edit">{% trans "EDIT" %}
</button>
<div id="edit" tabindex="-1"
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
<div class="relative p-4 w-full max-w-2xl max-h-full">
<div class="relative bg-white shadow dark:bg-gray-700">
<div class="flex items-center bg-blue-400 px-4 py-4">
<p class="font-bold">Update Remote Backup Schedules</p>
<img id="containerSettingLoading" src="/static/images/loading.gif"
style="display: none;">
<button type="button" data-modal-toggle="edit"
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
data-modal-hide="edit">
<svg class="w-3 h-3" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
</svg>
<span class="sr-only">Close modal</span>
</button>
</div>
<div class="p-4 md:p-5">
<form name="containerSettingsForm" action="/">
<div ng-hide="installationDetailsForm" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Backup Frequency</p>
</div>
<div>
<select ng-model="RemoteFrequency"
class="w-80 bg-gray-100 rounded px-2 py-1">
<option>30 Minutes</option>
<option>1 Hour</option>
<option>6 Hours</option>
<option>12 Hours</option>
<option>1 Day</option>
<option>3 Days</option>
<option>1 Week</option>
</select>
</div>
</div>
<div ng-hide="installationDetailsForm" class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">Backup File Retention</p>
</div>
<div>
<select ng-model="RemoteFileretention"
class="w-80 bg-gray-100 rounded px-2 py-1">
<option>3 Days</option>
<option>1 Week</option>
<option>3 Weeks</option>
<option>1 Month</option>
</select>
</div>
</div>
</form>
<div class="flex justify-end gap-2 px-2 py-2">
<button type="button" ng-disabled="savingSettings"
class="bg-orange-500 font-bold px-2 py-2 text-white"
ng-click="UpdateRemoteschedules()">Save
</button>
<button type="button" ng-disabled="savingSettings"
class="bg-gray-200 font-bold px-2 py-2"
data-modal-toggle="edit"
data-modal-hide="edit">
Close
</button>
</div>
</div>
</div>
</div>
</div>
<button aria-label=""
onclick="DeleteBackupfileConfigNow('{% url 'BackupfileConfigV2' %}?ID={{ RemoteConfigID }}&DeleteID={{ sub.id }}')"
type="button"
class="bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded">
Delete
</button>
<a href="{% url 'AddRemoteBackupsiteV2' %}?ID={{ sub.id }}"
aria-label=""
type="button"
class="mt-1 bg-orange-500 hover:bg-orange-700 text-white font-bold py-2 px-4 rounded">
Add WordPress Sites
</a>
</td>
</tr>
</tbody>
{% endfor %}
</table>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,232 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="RemoteBackupConfigV2" class="p-8">
<div>
<p class="text-4xl font-bold">Remote Backup Configurations</p>
</div>
<div class="py-4">
<p class="text-xl font-bold">Configure Remote Backups</p>
<img ng-hide="RemoteBackupLoading"
src="{% static 'images/loading.gif' %}">
</div>
<hr>
<form name="websiteCreationForm" action="/" id="createPackages">
<div ng-hide="installationDetailsForm" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-48">Select Remote Backup Type</p>
</div>
<div>
<select ng-model="RemoteBackuptype" ng-change="SelectRemoteBackuptype()"
class="w-80 bg-gray-100 rounded px-2 py-1">
<option>SFTP</option>
<option>S3</option>
</select>
</div>
</div>
<div ng-hide="SFTPBackUpdiv" class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Hostname</p>
</div>
<div>
<input name="Hostname" type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="Hostname"
required>
</div>
</div>
<div ng-hide="SFTPBackUpdiv" class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Username</p>
</div>
<div>
<input name="Username" type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="Username"
required>
</div>
</div>
<div ng-hide="SFTPBackUpdiv" class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Password</p>
</div>
<div>
<input name="Password" type="password" class="w-80 bg-gray-100 rounded px-2 py-1"
ng-model="Password"
required>
</div>
</div>
<div ng-hide="SFTPBackUpdiv" class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">path</p>
</div>
<div>
<input name="path" type="path" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="path"
required>
</div>
</div>
<div ng-hide="Selectprovider" class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Choose Provider</p>
</div>
<div>
<select ng-model="Providervalue" ng-change="SelectProvidertype()"
class="w-80 bg-gray-100 rounded px-2 py-1">
<option selected="selected">Amazon</option>
<option>Wasabi</option>
<option>Backblaze</option>
</select>
</div>
</div>
<div ng-hide="S3keyNamediv" class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Name</p>
</div>
<div>
<input name="S3keyName" type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="S3keyName"
required>
</div>
</div>
<div ng-hide="EndpointURLdiv" class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Endpoint URL</p>
</div>
<div>
<input name="EndpointURL" type="text" class="w-80 bg-gray-100 rounded px-2 py-1"
ng-model="EndpointURL"
required>
</div>
</div>
<div ng-hide="Accesskeydiv" class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Access Key</p>
</div>
<div>
<input name="Accesskey" type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="Accesskey"
required>
</div>
</div>
<div ng-hide="SecretKeydiv" class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Secret Key</p>
</div>
<div>
<input name="SecretKey" type="password" class="w-80 bg-gray-100 rounded px-2 py-1"
ng-model="SecretKey"
required>
</div>
</div>
<div ng-hide="installationDetailsForm" class="flex justify-center mt-3">
<button ng-click="SaveBackupConfig()"
class="bg-orange-500 px-3 py-2 rounded-lg text-xl font-semibold text-white">
Save Configurations
</button>
</div>
</form>
<div class="py-4">
<p class="text-xl font-bold">Saved Remote Configuration</p>
</div>
<div class="relative py-8 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr>
<th scope="col" class="px-6 py-3">
Backup Type
</th>
<th scope="col" class="px-6 py-3">
HostName
</th>
<th scope="col" class="px-6 py-3">
Path / Key Name
</th>
<th scope="col" class="px-6 py-3">
Action
</th>
</tr>
</thead>
{% for sub in backupconfigs %}
<tbody class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td class="px-6 py-4 font-bold">
{{ sub.Type }}
</td>
<td class="px-6 py-4">
{{ sub.HostName }}
</td>
<td class="px-6 py-4">
{{ sub.Path }}
</td>
<td class="px-6 py-4">
<a href="{% url 'BackupfileConfigV2' %}?ID={{ sub.id }}"
aria-label=""
type="button"
class="bg-orange-500 hover:bg-orange-700 text-white font-bold py-2 px-4 rounded">
Schedule Backups
</a>
<button
aria-label=""
onclick="DeleteBackupConfigNow('{% url 'RemoteBackupConfig' %}?DeleteID={{ sub.id }}')"
type="button"
class="bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded">
Delete
</button>
{# <a>#}
{# <button data-modal-target="Deletewpsite" data-modal-toggle="Deletewpsite"#}
{# class="bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded"#}
{# type="button"#}
{# onclick="DeleteBackupConfigNow('{% url 'RemoteBackupConfig' %}?DeleteID={{ sub.id }}')">#}
{# Delete#}
{# </button>#}
{# <div id="Deletewpsite" tabindex="-1"#}
{# class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">#}
{# <div class="relative p-4 w-full max-w-md max-h-full">#}
{# <div class="relative bg-white rounded-lg shadow dark:bg-gray-700">#}
{# <button type="button" data-modal-toggle="Deletewpsite"#}
{# class="absolute top-3 end-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white"#}
{# data-modal-hide="Deletewpsite">#}
{# <svg class="w-3 h-3" aria-hidden="true"#}
{# xmlns="http://www.w3.org/2000/svg" fill="none"#}
{# viewBox="0 0 14 14">#}
{# <path stroke="currentColor" stroke-linecap="round"#}
{# stroke-linejoin="round" stroke-width="2"#}
{# d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>#}
{# </svg>#}
{# <span class="sr-only">Close modal</span>#}
{# </button>#}
{# <div class="p-4 md:p-5 text-center">#}
{# <svg class="mx-auto mb-4 text-gray-400 w-12 h-12 dark:text-gray-200"#}
{# aria-hidden="true"#}
{# xmlns="http://www.w3.org/2000/svg" fill="none"#}
{# viewBox="0 0 20 20">#}
{# <path stroke="currentColor" stroke-linecap="round"#}
{# stroke-linejoin="round" stroke-width="2"#}
{# d="M10 11V6m0 8h.01M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/>#}
{# </svg>#}
{# <h3 class="mb-5 text-lg font-normal text-gray-500 dark:text-gray-400">#}
{# Are you sure you want to#}
{# delete this site?</h3>#}
{# <button data-modal-hide="Deletewpsite" type="button"#}
{# data-modal-toggle="Deletewpsite"#}
{# onclick="FinalDeleteWPNow()"#}
{# class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2">#}
{# Yes, I'm sure#}
{# </button>#}
{# <button data-modal-hide="Deletewpsite" type="button"#}
{# data-modal-toggle="Deletewpsite"#}
{# class="text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600">#}
{# No, cancel#}
{# </button>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </a>#}
</td>
</tr>
</tbody>
{% endfor %}
</table>
</div>
</div>
{% endblock %}

View File

@@ -7,35 +7,116 @@
<div ng-controller="listWebsitesV2" class="p-8">
<div>
<p class="text-4xl font-bold">Restore Backups</p>
<p class="text-xs text-gray-600 py-2 font-semibold">On this page you can restore,list,modify and
delete backup wordpress sites
from your server</p>
<p id="domainNamePage" class="text-4xl font-bold">List Backups</p>
<p class="text-xs text-gray-600 py-2 font-semibold">On this page you can Restore, list, modify and delete
Backups Wordpress Sites from your server.</p>
</div>
<div>
<div class="py-4">
{# <p class="text-xl font-bold">Website Details</p>#}
<div class="flex py-4">
<p class="text-xl font-bold">List Backups</p>
<img ng-hide="cyberPanelLoading" src="{% static 'images/loading.gif' %}">
</div>
<hr>
<div>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Choose Restoring Method</p>
</div>
<div>
<select ng-model="packageForWebsite" class="form-control w-80 bg-gray-100 rounded px-2 py-1">
{% for items in packageList %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="relative py-8 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr>
<th scope="col" class="px-6 py-3">
ID
</th>
<th scope="col" class="px-6 py-3">
Website
</th>
<th scope="col" class="px-6 py-3">
Type
</th>
<th scope="col" class="px-6 py-3">
Backup Destination
</th>
<th scope="col" class="px-6 py-3">
Action
</th>
</tr>
</thead>
{% for sub in job %}
<tbody class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td class="px-6 py-4 font-bold">
{{ sub.id }}
</td>
<td class="px-6 py-4">
{{ sub.title }}
</td>
<td class="px-6 py-4">
{{ sub.Backuptype }}
</td>
<td class="px-6 py-4">
{{ sub.BackupDestination }}
</td>
<td class="px-6 py-4">
<a href="{% url 'RestoreHomeV2' %}?BackupID={{ sub.id }}"
aria-label=""
type="button"
class="bg-orange-500 hover:bg-orange-700 text-white font-bold py-2 px-4 rounded">
Restore
</a>
<a>
<button data-modal-target="Deletewpsite" data-modal-toggle="Deletewpsite"
class="bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded"
type="button"
onclick="DeleteWPNow('{% url 'RestoreBackupsV2' %}?DeleteID={{ sub.id }}')">
Delete
</button>
<div id="Deletewpsite" tabindex="-1"
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
<div class="relative p-4 w-full max-w-md max-h-full">
<div class="relative bg-white rounded-lg shadow dark:bg-gray-700">
<button type="button" data-modal-toggle="Deletewpsite"
class="absolute top-3 end-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white"
data-modal-hide="Deletewpsite">
<svg class="w-3 h-3" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
</svg>
<span class="sr-only">Close modal</span>
</button>
<div class="p-4 md:p-5 text-center">
<svg class="mx-auto mb-4 text-gray-400 w-12 h-12 dark:text-gray-200"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 20 20">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="M10 11V6m0 8h.01M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/>
</svg>
<h3 class="mb-5 text-lg font-normal text-gray-500 dark:text-gray-400">
Are you sure you want to
delete this site?</h3>
<button data-modal-hide="Deletewpsite" type="button"
data-modal-toggle="Deletewpsite"
onclick="FinalDeleteWPNow()"
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2">
Yes, I'm sure
</button>
<button data-modal-hide="Deletewpsite" type="button"
data-modal-toggle="Deletewpsite"
class="text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600">
No, cancel
</button>
</div>
</div>
</div>
</div>
</a>
</td>
</tr>
</tbody>
{% endfor %}
</table>
</div>
</div>
<div class="flex justify-center mt-3">
<button ng-click="goBack()" class="bg-orange-500 px-3 py-4 rounded-lg text-xl font-semibold text-white">
Restore Backup Now
</button>
</div>
</div>
{% endblock %}

View File

@@ -5,10 +5,10 @@
{% load static %}
<div class="p-8">
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
<div ng-controller="listTableUsersV2" class="p-8">
<div class="lg:flex justify-between items-center sm:flex-row">
<div>
<p class="text-4xl font-bold">Configure Plugin</p>
<p id="domainNamePage" class="text-4xl font-bold">Configure Plugin</p>
<p class="text-xs text-gray-600 py-2 font-semibold">You can configure list of plugins that will
automatically get installed while deploying WordPress.</p>
</div>
@@ -23,8 +23,10 @@
</div>
<div>
<div class="py-4">
<div class="flex py-4">
<p class="text-xl font-bold">Plugin Buckets</p>
<img ng-hide="cyberpanelLoading"
src="{% static 'images/loading.gif' %}">
</div>
<hr>
</div>
@@ -40,8 +42,62 @@
<div class="w-80 px-4 py-1">{{ sub.id }}</div>
<div class="w-80 px-4 py-1">{{ sub.Name }}</div>
<div class="w-80 px-4 py-1">
<a href="{% url 'EidtPluginV2' %}?ID={{ sub.id }}"><button class="bg-orange-500 hover:bg-orange-700 text-white font-bold py-1 px-4 rounded">EDIT</button></a>
<button onclick="DeletePluginBuucket('{% url 'ConfigurePlugins' %}?delete={{ sub.id }}')" class="bg-red-500 hover:bg-red-700 text-white font-bold py-1 px-4 rounded">DELETE</button>
<a href="{% url 'EidtPluginV2' %}?ID={{ sub.id }}">
<button class="bg-orange-500 hover:bg-orange-700 text-white font-bold py-1 px-4 rounded">
EDIT
</button>
</a>
<a>
<button data-modal-target="Deletewpsite" data-modal-toggle="Deletewpsite"
class="bg-red-500 hover:bg-red-700 text-white font-bold py-1 px-4 rounded"
type="button"
onclick="DeletePluginBuucket('{% url 'ConfigurePluginsV2' %}?delete={{ sub.id }}')">
Delete
</button>
<div id="Deletewpsite" tabindex="-1"
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
<div class="relative p-4 w-full max-w-md max-h-full">
<div class="relative bg-white rounded-lg shadow dark:bg-gray-700">
<button type="button" data-modal-toggle="Deletewpsite"
class="absolute top-3 end-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white"
data-modal-hide="Deletewpsite">
<svg class="w-3 h-3" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
</svg>
<span class="sr-only">Close modal</span>
</button>
<div class="p-4 md:p-5 text-center">
<svg class="mx-auto mb-4 text-gray-400 w-12 h-12 dark:text-gray-200"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 20 20">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="M10 11V6m0 8h.01M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/>
</svg>
<h3 class="mb-5 text-lg font-normal text-gray-500 dark:text-gray-400">
Are you sure you want to
delete this WordPress site?</h3>
<button data-modal-hide="Deletewpsite" type="button"
data-modal-toggle="Deletewpsite"
onclick="FinalDeletePluginBuucket()"
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2">
Yes, I'm sure
</button>
<button data-modal-hide="Deletewpsite" type="button"
data-modal-toggle="Deletewpsite"
class="text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600">
No, cancel
</button>
</div>
</div>
</div>
</div>
</a>
</div>
</div>
{% endfor %}

View File

@@ -178,7 +178,7 @@
</div>
<div ng-hide="installationDetailsForm" class="flex justify-center mt-3">
<button ng-click="createWordPresssite()"
class="bg-orange-500 px-3 py-4 rounded-lg text-xl font-semibold text-white">
class="bg-orange-500 px-3 py-2 rounded-lg text-xl font-semibold text-white">
Create Website
</button>
</div>

View File

@@ -7,7 +7,7 @@
<div class="p-4">
<span id="pluginbID" style="display: none">{{ pluginbID }}</span>
<div ng-controller="WPAddNewPlugin" class="panel">
<div ng-controller="WPAddNewPluginV2" class="panel">
<div>
<div>
<h2 class="font-bold text-xl">{{ BucketName }}</h2>

View File

@@ -37,7 +37,6 @@
{% for i in WPsites %}
<option value="{{ i.id }}">{{ i.FinalURL }}</option>
{% endfor %}
</select>
</div>
@@ -63,7 +62,6 @@
{% for i in WPsites %}
<option value="{{ i.id }}">{{ i.FinalURL }}</option>
{% endfor %}
</select>
</div>

View File

@@ -0,0 +1,127 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="RestoreWPBackupV2" class="p-8">
<div>
<p id="domainNamePage" class="text-4xl font-bold">Restore Backups</p>
<p class="text-xs text-gray-600 py-2 font-semibold">On this page you can Restore, list, modify and delete
Backups Wordpress Sites from your server.</p>
</div>
<div class="flex gap-3 py-4 items-center">
<p id="backupid" class="text-xl font-bold text-white px-1 bg-orange-500">{{ backupobj.id }}</p>
<p id="backuptype" class="text-xl font-bold">{{ Backuptype }}</p>
</div>
<hr>
<div class="flex py-4 items-center">
<p class="text-xl font-bold"> {{ FileName }} </p>
<img id="wordpresshomeloading" style="display: none"
src="{% static 'images/loading.gif' %}">
</div>
<hr>
<form name="websiteCreationForm" action="/" id="createPackages">
{% if Backuptype == "DataBase Backup" %}
<div id="exinstingsitedivDB" ng-hide="installationDetailsForm" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Choose WPsite Restore Destination</p>
</div>
<div>
<select id="DesSite" class="w-80 bg-gray-100 rounded px-2 py-1" required>
<option value="-1">Select WordPress Site</option>
{% for i in WPsites %}
<option value="{{ i.id }}">{{ i.FinalURL }}</option>
{% endfor %}
</select>
</div>
</div>
{% else %}
<div ng-hide="installationDetailsForm" class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">Choose Restoring Method</p>
</div>
<div>
<select ng-click="checkmethode()" id="RestoreMethode" class="w-80 bg-gray-100 rounded px-2 py-1"
required>
<option value="-1">Select Method</option>
<option value="1">Restore to New Site</option>
<option value="0">Restore to Existing Site</option>
</select>
</div>
</div>
<div id="exinstingsitediv" ng-hide="installationDetailsForm" style="display: none"
class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">Choose WPsite Restore Destination</p>
</div>
<div>
<select id="DesSite" class="w-80 bg-gray-100 rounded px-2 py-1" required>
<option value="-1">Select WordPress Site</option>
{% for i in WPsites %}
<option value="{{ i.id }}">{{ i.FinalURL }}</option>
{% endfor %}
</select>
</div>
</div>
<div id="Newsitediv" ng-hide="installationDetailsForm" style="display: none" class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">Domain Name</p>
</div>
<div>
<input ng-model="domainNameCreate" id="wprestoresubdirdomain"
class="w-80 bg-gray-100 rounded px-2 py-1"
type="text" value="55"
name="wprestoresubdirdomain"
style="display: block;"
placeholder="{% trans "Do not enter WWW, it will be auto created!" %}">
<input id="wprestoresubdirpath" class="w-80 bg-gray-100 rounded px-2 py-1 mt-2"
placeholder="{% trans "Leave empty for default" %}"
type="text" value="Leave empty for default"
name="wprestoresubdirpath" ng-model="installPath"
style="display: block;">
</div>
</div>
{% endif %}
<div ng-model="installationDetailsForm" class="flex justify-center mt-3">
<button id="RestoreWPbackupNow"
ng-click="RestoreWPbackupNow()"
class="bg-orange-500 px-3 py-2 rounded-lg text-xl font-semibold text-white">
Restore Backup Now
</button>
</div>
<div ng-hide="installationProgress" class="form-group">
<div class="flex justify-center font-bold text-xl">
<h2>{$ currentStatus $}</h2>
</div>
<div class="w-full bg-gray-100 rounded-full mt-3">
<div id="installProgressbackup"
class="bg-green-600 text-xs font-medium text-white text-center p-2 leading-none rounded-full"
style="width:0%">
</div>
</div>
<div ng-hide="errorMessageBox"
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "Error message:" %} {$ errorMessage $}</p>
</div>
<div ng-hide="success" class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
<p>{% trans "Backup succesfully created." %}</p>
</div>
<div ng-hide="couldNotConnect"
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
</div>
</div>
<div ng-hide="installationProgress" class="flex justify-center mt-3">
<button ng-disabled="goBackDisable"
ng-click="goBack()"
class="bg-blue-500 px-3 py-2 rounded-lg text-xl font-semibold text-white">
Go Back
</button>
</div>
</form>
</div>
{% endblock %}

View File

@@ -14,128 +14,250 @@
from your server</p>
</div>
</div>
<div class="py-8 overflow-x-auto">
<div class="px-5">
<table>
<thead>
<div>
<tr>
<th class="w-72 text-xl">Wordpress Site Title</th>
<th class="w-52 text-xl">Login</th>
<th class="w-52 text-xl">Domain</th>
<th class="w-52 text-xl">Action</th>
</tr>
</div>
</thead>
</table>
</div>
<div class="rounded-lg px-3 mt-5">
<div class="px-2">
{% for sub in wpsite %}
<div class="border shadow-lg py-3 mb-3 rounded-b-lg">
<table>
<tbody>
<tr>
<th class="w-72 pt-2 font-semibold text-sm"><a
href="{% url 'WPHomeV2' %}?ID={{ sub.id }}">
<p style="font-weight: bold; text-transform: uppercase; ">{{ sub.title }}</p>
</a>
</th>
<th class="w-52 pt-2 font-semibold text-sm flex justify-center">
<a title="Auto Login"
style="margin-right: 2%; margin-left: 10px;"
target="_blank"
href="{% url 'AutoLogin' %}?id={{ sub.id }}">
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img"
width="20"
style="margin: 3px;" height="20"
preserveAspectRatio="xMidYMid meet"
viewBox="0 0 16 16">
<g fill="#006600">
<path d="M12.633 7.653c0-.848-.305-1.435-.566-1.892l-.08-.13c-.317-.51-.594-.958-.594-1.48c0-.63.478-1.218 1.152-1.218c.02 0 .039.002.058.003l.031.003A6.838 6.838 0 0 0 8 1.137A6.855 6.855 0 0 0 2.266 4.23c.16.005.313.009.442.009c.717 0 1.828-.087 1.828-.087c.37-.022.414.521.044.565c0 0-.371.044-.785.065l2.5 7.434l1.5-4.506l-1.07-2.929c-.369-.022-.719-.065-.719-.065c-.37-.022-.326-.588.043-.566c0 0 1.134.087 1.808.087c.718 0 1.83-.087 1.83-.087c.37-.022.413.522.043.566c0 0-.372.043-.785.065l2.48 7.377l.684-2.287l.054-.173c.27-.86.469-1.495.469-2.046zM1.137 8a6.864 6.864 0 0 0 3.868 6.176L1.73 5.206A6.837 6.837 0 0 0 1.137 8z"></path>
<path d="M6.061 14.583L8.121 8.6l2.109 5.78c.014.033.03.064.049.094a6.854 6.854 0 0 1-4.218.109zm7.96-9.876c.03.219.047.453.047.706c0 .696-.13 1.479-.522 2.458l-2.096 6.06a6.86 6.86 0 0 0 2.572-9.224z"></path>
<path fill-rule="evenodd"
d="M0 8c0-4.411 3.589-8 8-8c4.41 0 8 3.589 8 8s-3.59 8-8 8c-4.411 0-8-3.589-8-8zm.367 0c0 4.209 3.424 7.633 7.633 7.633c4.208 0 7.632-3.424 7.632-7.633C15.632 3.79 12.208.367 8 .367C3.79.367.367 3.79.367 8z"></path>
</g>
</svg>
</a>
</th>
<th class="w-52 pt-2 font-semibold text-sm"><a target="_blank"
style="color: #6aa7ff"
href="http://{{ sub.url }}">Visit
<i class="glyph-icon icon-external-link-square"
title="{{ sub.url }}"></i></a>
</th>
<th class="w-52 pt-2 font-semibold text-sm">
<div class="flex items-center justify-center">
<button data-modal-target="Deletewpsite" data-modal-toggle="Deletewpsite"
class="block text-white bg-orange-500 hover:bg-orange-700 font-medium rounded-lg text-sm px-5 py-2.5 text-center"
type="button"
onclick="DeleteWPNowV2('{% url 'ListWPSitesV2' %}?DeleteID={{ sub.id }}')">
Delete
</button>
<div id="Deletewpsite" tabindex="-1"
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
<div class="relative p-4 w-full max-w-md max-h-full">
<div class="relative bg-white rounded-lg shadow dark:bg-gray-700">
<button type="button" data-modal-toggle="Deletewpsite"
class="absolute top-3 end-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white"
data-modal-hide="Deletewpsite">
<svg class="w-3 h-3" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
</svg>
<span class="sr-only">Close modal</span>
</button>
<div class="p-4 md:p-5 text-center">
<svg class="mx-auto mb-4 text-gray-400 w-12 h-12 dark:text-gray-200"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 20 20">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="M10 11V6m0 8h.01M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/>
</svg>
<h3 class="mb-5 text-lg font-normal text-gray-500 dark:text-gray-400">
Are you sure you want to
delete this WordPress site?</h3>
<button data-modal-hide="Deletewpsite" type="button"
data-modal-toggle="Deletewpsite"
onclick="FinalDeleteWPNowV2()"
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2">
Yes, I'm sure
</button>
<button data-modal-hide="Deletewpsite" type="button"
data-modal-toggle="Deletewpsite"
class="text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600">
No, cancel
</button>
</div>
</div>
</div>
</div>
</div>
</th>
</tr>
</tbody>
</table>
<div class="relative py-8 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
<tr>
<th scope="col" class="px-6 py-3 text-xl w-52">
<div class="flex justify-center">
Wordpress Site Title
</div>
{% endfor %}
</div>
</div>
</th>
<th scope="col" class="px-6 py-3 text-xl w-52">
<div class="flex justify-center">
Login
</div>
</th>
<th scope="col" class="px-6 py-3 text-xl w-52">
<div class="flex justify-center">
Domain
</div>
</th>
<th scope="col" class="px-6 py-3 text-xl w-52">
<div class="flex justify-center">
Action
</div>
</th>
</tr>
</thead>
{% for sub in wpsite %}
<tbody class="border shadow-lg py-3 px-6 rounded-b-lg">
<tr>
<td class="px-6 py-4 w-72">
<div class="flex justify-center">
<a style="font-weight: bold; text-transform: uppercase;"
href="{% url 'WPHomeV2' %}?ID={{ sub.id }}">
<p>{{ sub.title }}</p>
</a>
</div>
</td>
<td class="px-6 py-4 w-52">
<div class="flex justify-center">
<a title="Auto Login"
target="_blank"
href="{% url 'AutoLogin' %}?id={{ sub.id }}">
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img"
width="20"
style="margin: 3px;" height="20"
preserveAspectRatio="xMidYMid meet"
viewBox="0 0 16 16">
<g fill="#006600">
<path d="M12.633 7.653c0-.848-.305-1.435-.566-1.892l-.08-.13c-.317-.51-.594-.958-.594-1.48c0-.63.478-1.218 1.152-1.218c.02 0 .039.002.058.003l.031.003A6.838 6.838 0 0 0 8 1.137A6.855 6.855 0 0 0 2.266 4.23c.16.005.313.009.442.009c.717 0 1.828-.087 1.828-.087c.37-.022.414.521.044.565c0 0-.371.044-.785.065l2.5 7.434l1.5-4.506l-1.07-2.929c-.369-.022-.719-.065-.719-.065c-.37-.022-.326-.588.043-.566c0 0 1.134.087 1.808.087c.718 0 1.83-.087 1.83-.087c.37-.022.413.522.043.566c0 0-.372.043-.785.065l2.48 7.377l.684-2.287l.054-.173c.27-.86.469-1.495.469-2.046zM1.137 8a6.864 6.864 0 0 0 3.868 6.176L1.73 5.206A6.837 6.837 0 0 0 1.137 8z"></path>
<path d="M6.061 14.583L8.121 8.6l2.109 5.78c.014.033.03.064.049.094a6.854 6.854 0 0 1-4.218.109zm7.96-9.876c.03.219.047.453.047.706c0 .696-.13 1.479-.522 2.458l-2.096 6.06a6.86 6.86 0 0 0 2.572-9.224z"></path>
<path fill-rule="evenodd"
d="M0 8c0-4.411 3.589-8 8-8c4.41 0 8 3.589 8 8s-3.59 8-8 8c-4.411 0-8-3.589-8-8zm.367 0c0 4.209 3.424 7.633 7.633 7.633c4.208 0 7.632-3.424 7.632-7.633C15.632 3.79 12.208.367 8 .367C3.79.367.367 3.79.367 8z"></path>
</g>
</svg>
</a>
</div>
</td>
<td class="px-6 py-4 w-52">
<div class="flex justify-center">
<a style="color: #6aa7ff; font-weight: bold;" target="_blank"
href="http://{{ sub.url }}">Visit
</a>
</div>
</td>
<td class="px-6 py-4 w-52">
<div class="flex items-center justify-center">
<button data-modal-target="Deletewpsite" data-modal-toggle="Deletewpsite"
class="block text-white bg-orange-500 hover:bg-orange-700 font-medium rounded-lg text-sm px-5 py-2.5 text-center"
type="button"
onclick="DeleteWPNowV2('{% url 'ListWPSitesV2' %}?DeleteID={{ sub.id }}')">
Delete
</button>
<div id="Deletewpsite" tabindex="-1"
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
<div class="relative p-4 w-full max-w-md max-h-full">
<div class="relative bg-white rounded-lg shadow dark:bg-gray-700">
<button type="button" data-modal-toggle="Deletewpsite"
class="absolute top-3 end-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white"
data-modal-hide="Deletewpsite">
<svg class="w-3 h-3" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
</svg>
<span class="sr-only">Close modal</span>
</button>
<div class="p-4 md:p-5 text-center">
<svg class="mx-auto mb-4 text-gray-400 w-12 h-12 dark:text-gray-200"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 20 20">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="M10 11V6m0 8h.01M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/>
</svg>
<h3 class="mb-5 text-lg font-normal text-gray-500 dark:text-gray-400">
Are you sure you want to
delete this WordPress site?</h3>
<button data-modal-hide="Deletewpsite" type="button"
data-modal-toggle="Deletewpsite"
onclick="FinalDeleteWPNowV2()"
class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2">
Yes, I'm sure
</button>
<button data-modal-hide="Deletewpsite" type="button"
data-modal-toggle="Deletewpsite"
class="text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600">
No, cancel
</button>
</div>
</div>
</div>
</div>
</div>
</td>
</tr>
</tbody>
{% endfor %}
</table>
</div>
{# <div class="py-8 overflow-x-auto">#}
{# <div class="px-5">#}
{# <table>#}
{# <thead>#}
{# <div>#}
{# <tr>#}
{# <th class="w-72 text-xl">Wordpress Site Title</th>#}
{# <th class="w-52 text-xl">Login</th>#}
{# <th class="w-52 text-xl">Domain</th>#}
{# <th class="w-52 text-xl">Action</th>#}
{# </tr>#}
{# </div>#}
{# </thead>#}
{# </table>#}
{# </div>#}
{##}
{# <div class="rounded-lg px-3 mt-5">#}
{# <div class="px-2">#}
{# {% for sub in wpsite %}#}
{# <div class="border shadow-lg py-3 mb-3 rounded-b-lg">#}
{# <table>#}
{# <tbody>#}
{##}
{# <tr>#}
{# <th class="w-72 pt-2 font-semibold text-sm"><a#}
{# href="{% url 'WPHomeV2' %}?ID={{ sub.id }}">#}
{# <p style="font-weight: bold; text-transform: uppercase; ">{{ sub.title }}</p>#}
{# </a>#}
{# </th>#}
{# <th class="w-52 pt-2 font-semibold text-sm flex justify-center">#}
{# <a title="Auto Login"#}
{# style="margin-right: 2%; margin-left: 10px;"#}
{# target="_blank"#}
{# href="{% url 'AutoLogin' %}?id={{ sub.id }}">#}
{# <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img"#}
{# width="20"#}
{# style="margin: 3px;" height="20"#}
{# preserveAspectRatio="xMidYMid meet"#}
{# viewBox="0 0 16 16">#}
{# <g fill="#006600">#}
{# <path d="M12.633 7.653c0-.848-.305-1.435-.566-1.892l-.08-.13c-.317-.51-.594-.958-.594-1.48c0-.63.478-1.218 1.152-1.218c.02 0 .039.002.058.003l.031.003A6.838 6.838 0 0 0 8 1.137A6.855 6.855 0 0 0 2.266 4.23c.16.005.313.009.442.009c.717 0 1.828-.087 1.828-.087c.37-.022.414.521.044.565c0 0-.371.044-.785.065l2.5 7.434l1.5-4.506l-1.07-2.929c-.369-.022-.719-.065-.719-.065c-.37-.022-.326-.588.043-.566c0 0 1.134.087 1.808.087c.718 0 1.83-.087 1.83-.087c.37-.022.413.522.043.566c0 0-.372.043-.785.065l2.48 7.377l.684-2.287l.054-.173c.27-.86.469-1.495.469-2.046zM1.137 8a6.864 6.864 0 0 0 3.868 6.176L1.73 5.206A6.837 6.837 0 0 0 1.137 8z"></path>#}
{# <path d="M6.061 14.583L8.121 8.6l2.109 5.78c.014.033.03.064.049.094a6.854 6.854 0 0 1-4.218.109zm7.96-9.876c.03.219.047.453.047.706c0 .696-.13 1.479-.522 2.458l-2.096 6.06a6.86 6.86 0 0 0 2.572-9.224z"></path>#}
{# <path fill-rule="evenodd"#}
{# d="M0 8c0-4.411 3.589-8 8-8c4.41 0 8 3.589 8 8s-3.59 8-8 8c-4.411 0-8-3.589-8-8zm.367 0c0 4.209 3.424 7.633 7.633 7.633c4.208 0 7.632-3.424 7.632-7.633C15.632 3.79 12.208.367 8 .367C3.79.367.367 3.79.367 8z"></path>#}
{# </g>#}
{# </svg>#}
{# </a>#}
{# </th>#}
{# <th class="w-52 pt-2 font-semibold text-sm"><a target="_blank"#}
{# style="color: #6aa7ff"#}
{# href="http://{{ sub.url }}">Visit#}
{# <i class="glyph-icon icon-external-link-square"#}
{# title="{{ sub.url }}"></i></a>#}
{# </th>#}
{# <th class="w-52 pt-2 font-semibold text-sm">#}
{# <div class="flex items-center justify-center">#}
{##}
{# <button data-modal-target="Deletewpsite" data-modal-toggle="Deletewpsite"#}
{# class="block text-white bg-orange-500 hover:bg-orange-700 font-medium rounded-lg text-sm px-5 py-2.5 text-center"#}
{# type="button"#}
{# onclick="DeleteWPNowV2('{% url 'ListWPSitesV2' %}?DeleteID={{ sub.id }}')">#}
{# Delete#}
{# </button>#}
{##}
{# <div id="Deletewpsite" tabindex="-1"#}
{# class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">#}
{# <div class="relative p-4 w-full max-w-md max-h-full">#}
{# <div class="relative bg-white rounded-lg shadow dark:bg-gray-700">#}
{# <button type="button" data-modal-toggle="Deletewpsite"#}
{# class="absolute top-3 end-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white"#}
{# data-modal-hide="Deletewpsite">#}
{# <svg class="w-3 h-3" aria-hidden="true"#}
{# xmlns="http://www.w3.org/2000/svg" fill="none"#}
{# viewBox="0 0 14 14">#}
{# <path stroke="currentColor" stroke-linecap="round"#}
{# stroke-linejoin="round" stroke-width="2"#}
{# d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>#}
{# </svg>#}
{# <span class="sr-only">Close modal</span>#}
{# </button>#}
{# <div class="p-4 md:p-5 text-center">#}
{# <svg class="mx-auto mb-4 text-gray-400 w-12 h-12 dark:text-gray-200"#}
{# aria-hidden="true"#}
{# xmlns="http://www.w3.org/2000/svg" fill="none"#}
{# viewBox="0 0 20 20">#}
{# <path stroke="currentColor" stroke-linecap="round"#}
{# stroke-linejoin="round" stroke-width="2"#}
{# d="M10 11V6m0 8h.01M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/>#}
{# </svg>#}
{# <h3 class="mb-5 text-lg font-normal text-gray-500 dark:text-gray-400">#}
{# Are you sure you want to#}
{# delete this WordPress site?</h3>#}
{# <button data-modal-hide="Deletewpsite" type="button"#}
{# data-modal-toggle="Deletewpsite"#}
{# onclick="FinalDeleteWPNowV2()"#}
{# class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2">#}
{# Yes, I'm sure#}
{# </button>#}
{# <button data-modal-hide="Deletewpsite" type="button"#}
{# data-modal-toggle="Deletewpsite"#}
{# class="text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600">#}
{# No, cancel#}
{# </button>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
{##}
{# </div>#}
{##}
{# </th>#}
{##}
{# </tr>#}
{##}
{# </tbody>#}
{# </table>#}
{# </div>#}
{# {% endfor %}#}
{# </div>#}
{##}
{# </div>#}
{# </div>#}
</div>
{% endblock %}

View File

@@ -12,8 +12,10 @@
master website</p>
</div>
<div>
<div class="py-4">
<div class="flex items-center py-4">
<p class="text-xl font-bold">Details</p>
<img ng-hide="domainLoading"
src="{% static 'images/loading.gif' %}">
</div>
<hr>
<div>
@@ -42,12 +44,13 @@
</div>
<div ng-hide="DomainCreateForm" class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">Path: /home{$ masterDomain
<p class="font-semibold w-60">Path: /home/{$ masterDomain
$}/</p>
</div>
<div>
<input type="email" name="email" class="form-control w-80 bg-gray-100 rounded px-2 py-1"
ng-model="docRootPath" required>
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="docRootPath" required>
<div ng-show="websiteCreationForm.dom.$error.pattern"
class="current-pack">{% trans "Invalid Domain (Note: You don't need to add 'http' or 'https')" %}</div>
</div>
</div>
<div ng-hide="DomainCreateForm" class="flex py-2 px-6">
@@ -67,35 +70,32 @@
<p class="font-semibold w-48">Additional Features</p></label>
</div>
<div class="text-gray-500 font-semibold">
<div class="col-sm-9">
<div class="checkbox">
<div>
<div>
<label>
<input ng-model="sslCheck" type="checkbox" value="">
SSL
</label>
</div>
</div>
<label class="col-sm-3 control-label"></label>
<div class="col-sm-9">
<div class="checkbox">
<div>
<div>
<label>
<input ng-model="apacheBackend" type="checkbox" value="">
Apache as Reverse Proxy (Beta, for Ubuntu 22 and AlmaLinux 8)
</label>
</div>
</div>
<label class="col-sm-3 control-label"></label>
<div class="col-sm-9">
<div class="checkbox">
<div>
<div>
<label>
<input ng-model="dkimCheck" type="checkbox" value="">
DKIM Support
</label>
</div>
</div>
<label class="col-sm-3 control-label"></label>
<div class="col-sm-9">
<div class="checkbox">
<div>
<div>
<label>
<input ng-model="openBasedir" type="checkbox" value="">
open_basedir Protection
@@ -108,9 +108,40 @@
</div>
<div ng-hide="DomainCreateForm" class="flex justify-center mt-4">
<button ng-click="createDomain()"
class="bg-orange-500 px-3 py-4 rounded-lg text-xl font-semibold text-white">
class="bg-orange-500 px-3 py-2 rounded-lg text-xl font-semibold text-white">
Create Domain
</button>
</div>
<div ng-hide="installationProgress" class="form-group">
<div class="flex justify-center font-bold text-xl">
<h2>{$ currentStatus $}</h2>
</div>
<div class="w-full bg-gray-100 rounded-full mt-3">
<div id="installProgress"
class="bg-green-600 text-xs font-medium text-white text-center p-2 leading-none rounded-full"
style="width:0%">
</div>
</div>
<div ng-hide="errorMessageBox"
class="flex justify-center mt-2 bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "Error message:" %} {$ errorMessage $}</p>
</div>
<div ng-hide="success" class="flex justify-center mt-2 bg-green-500 px-2 rounded-lg py-1 font-semibold">
<p>{% trans "Website succesfully created." %}</p>
</div>
<div ng-hide="couldNotConnect"
class="flex justify-center mt-2 bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
</div>
</div>
<div ng-hide="installationProgress" class="flex justify-center mt-3">
<button ng-disabled="goBackDisable"
ng-click="goBack()"
class="bg-blue-500 px-3 py-2 rounded-lg text-xl font-semibold text-white">
Go Back
</button>
</div>
</div>
{% endblock %}

View File

@@ -78,17 +78,16 @@
<p class="font-semibold w-48">Additional Features</p></label>
</div>
<div class="text-gray-500 font-semibold">
<div class="col-sm-9">
<div class="checkbox">
<div>
<div>
<label>
<input ng-model="sslCheck" type="checkbox" value="">
SSL
</label>
</div>
</div>
<label class="col-sm-3 control-label"></label>
<div class="col-sm-9">
<div class="checkbox">
<div>
<div>
<label>
{% if test_domain_data %}
<input ng-model="apacheBackend" type="checkbox" value="">
@@ -103,27 +102,24 @@
</label>
</div>
</div>
<label class="col-sm-3 control-label"></label>
<div class="col-sm-9">
<div class="checkbox">
<div>
<div>
<label>
<input ng-model="dkimCheck" type="checkbox" value="">
DKIM Support
</label>
</div>
</div>
<label class="col-sm-3 control-label"></label>
<div class="col-sm-9">
<div class="checkbox">
<div>
<div>
<label>
<input ng-model="openBasedir" type="checkbox" value="">
open_basedir Protection
</label>
</div>
</div>
<label class="col-sm-3 control-label"></label>
<div class="col-sm-9">
<div class="checkbox">
<div>
<div>
<label>
<input ng-model="mailDomain" type="checkbox" value="">
Create Mail Domain
@@ -137,7 +133,7 @@
<div ng-hide="installationDetailsForm" class="flex justify-center">
<button ng-disabled="websiteCreationForm.dom.$error.required || websiteCreationForm.email.$invalid"
ng-click="createWebsite()"
class="bg-orange-500 px-3 py-4 rounded-lg text-xl font-semibold text-white">
class="bg-orange-500 px-3 py-2 rounded-lg text-xl font-semibold text-white">
Create Website
</button>
</div>
@@ -152,17 +148,17 @@
style="width:0%">
</div>
</div>
<div ng-hide="errorMessageBox" class="flex justify-center font-bold text-xl mt-3">
<div ng-hide="errorMessageBox"
class="flex justify-center mt-2 bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<h2>{$ errorMessage $}</h2>
</div>
<div ng-hide="success" class="flex justify-center font-bold text-xl mt-3">
<div ng-hide="success" class="flex justify-center mt-2 bg-green-500 px-2 rounded-lg py-1 font-semibold">
<h2>Website succesfully created.</h2>
</div>
<div ng-hide="couldNotConnect" class="flex justify-center font-bold text-xl mt-3">
<div ng-hide="couldNotConnect"
class="flex justify-center mt-2 bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<h2>Could not connect to server. Please refresh this page.</h2>
</div>
</div>
<div ng-hide="installationProgress" class="flex justify-center mt-3">

View File

@@ -35,7 +35,7 @@
</div>
<div class="flex justify-center mt-4">
<button ng-click="deleteWebsite()"
class="bg-orange-500 px-3 py-4 rounded-lg text-xl font-semibold text-white">
class="bg-orange-500 px-3 py-2 rounded-lg text-xl font-semibold text-white">
Delete Website
</button>
@@ -53,11 +53,13 @@
</div>
<div>
<div class="flex justify-center mt-4">
<div id="websiteDeleteFailure" class="text-red-500 font-semibold">
<div id="websiteDeleteFailure"
class="flex justify-center w-full mt-2 bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "Cannot delete website, Error message: " %} {$ errorMessage $}</p>
</div>
<br>
<div id="websiteDeleteSuccess" class="text-green-500 font-semibold">
<div id="websiteDeleteSuccess"
class="flex justify-center w-full mt-2 bg-green-500 px-2 rounded-lg py-1 font-semibold">
<p>{% trans "Website" %} <strong>{$ deletedWebsite $}</strong> {% trans "Successfully Deleted." %}
</p>
</div>

View File

@@ -6,13 +6,15 @@
{% load static %}
<div ng-controller="listChildDomainsMainV2" class="p-8">
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
<div>
<div>
<div class="flex items-center">
<p class="text-4xl font-bold">List Child Domains</p>
<p class="text-xs text-gray-600 py-2 font-semibold">On this page you can launch,list,modify and
child domains
from your server</p>
<img ng-hide="cyberPanelLoading"
src="{% static 'images/loading.gif' %}">
</div>
<p class="text-xs text-gray-600 py-2 font-semibold">On this page you can launch,list,modify and
child domains
from your server</p>
</div>
<!-- Search Bar -->
<div class="flex justify-between py-1 mt-4">
@@ -45,8 +47,11 @@
<div class="py-8">
<div class="border shadow-lg rounded-lg px-3">
<div ng-repeat="web in WebSitesList track by $index" class="px-2">
<div class="bg-gray-200 mt-6 w-full rounded-t-lg border-b-2 border-gray-400">
<div class="flex items-center bg-gray-200 mt-6 w-full rounded-t-lg border-b-2 border-gray-400">
<p class="font-bold px-4 py-1" ng-bind="web.domain"></p>
<a class="text-blue-600 font-semibold" target="_blank"
href="/filemanagerv2/{$ web.masterDomain $}" title="Open File Manager">
- File Manager</a>
</div>
<div class="py-3 mb-3 rounded-b-lg border-b-2 border-gray-400 overflow-x-auto">
<table>
@@ -54,7 +59,7 @@
<div>
<tr>
<th class="w-32 pt-2">
<a href="/websites/{$ web.masterDomain $}/{$ web.domain $}"
<a href="/v2Websites/{$ web.masterDomain $}/{$ web.domain $}"
class="flex items-center ml-3">
<svg width="20" height="20" viewBox="0 0 30 30" fill="none"
xmlns="http://www.w3.org/2000/svg">
@@ -72,37 +77,42 @@
<p class="ml-2 text-blue-600 font-semibold">Manage</p>
</a>
</th>
<th ng-click="initConvert(web.domain)"
class="w-36 pt-2 font-semibold text-green-700 text-sm">
<div class="col-md-4 content-box-header">
<i class="p fa fa-arrows-h btn-icon text-muted" data-toggle="tooltip"
data-placement="right" title="Convert to Website">&emsp;</i>
<span>
<a onclick="openModal()" href="#" style="text-transform: none">Convert to Website</a>
</span>
<!-- Modal -->
<div id="modal"
class="fixed inset-0 overflow-auto bg-black bg-opacity-50 hidden flex items-center justify-center">
<div class="bg-white p-8 rounded shadow-lg w-full md:w-1/2">
<button onclick="closeModal()"
class="absolute top-4 right-4 text-gray-700 hover:text-gray-900">
<i class="fa fa-times"></i>
</button>
<h1 class="text-2xl font-bold mb-4 text-black">Convert Child Domain
to Normal
Website
</h1>
<form name="containerSettingsForm" action="/" class="mb-4">
<div>
<th class="w-36 pt-2">
<a onclick="return false;"
ng-click="initConvert(web.domain)"
class="font-semibold text-green-700 text-sm"
href="#" data-modal-target="edit"
data-modal-toggle="edit">{% trans "Convert To Website" %}
</a>
<div id="edit" tabindex="-1"
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
<div class="relative p-4 w-full max-w-2xl max-h-full">
<div class="relative bg-white shadow dark:bg-gray-700">
<div class="flex items-center bg-blue-400 px-4 py-4">
<p class="font-bold">Convert Child Domain to Normal Website</p>
<button type="button" data-modal-toggle="edit"
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
data-modal-hide="edit">
<svg class="w-3 h-3" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
</svg>
<span class="sr-only">Close modal</span>
</button>
</div>
<div class="p-4 md:p-5">
<form name="containerSettingsForm">
<div ng-hide="installationDetailsForm"
class="flex py-2 px-6">
class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-48">Domain Name</p>
<p class="font-semibold w-60">Domain Name</p>
</div>
<div>
<input name="dom" type="text"
class="form-control w-80 bg-gray-100 rounded px-2 py-1"
class="w-80 bg-gray-100 rounded px-2 py-1"
ng-model="domainName"
placeholder="{% trans "Do not enter WWW, it will be auto created!" %}"
readonly>
@@ -111,11 +121,11 @@
<div ng-hide="installationDetailsForm"
class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Select Owner</p>
<p class="font-semibold w-60">Select Owner</p>
</div>
<div>
<select ng-model="$parent.websiteOwner"
class="form-control w-80 bg-gray-100 rounded px-2 py-1">
class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in owernList %}
<option>{{ items }}</option>
{% endfor %}
@@ -123,9 +133,9 @@
</div>
</div>
<div ng-hide="installationDetailsForm"
class="flex mt-4 py-2 px-6">
class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Select Package</p>
<p class="font-semibold w-60">Select Package</p>
</div>
<div>
<select ng-model="$parent.packageForWebsite"
@@ -139,43 +149,44 @@
<div ng-hide="installationDetailsForm"
class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Email</p>
<p class="font-semibold w-60">Email</p>
</div>
<div>
<input type="email" name="email"
class="form-control w-80 bg-gray-100 rounded px-2 py-1"
class="w-80 bg-gray-100 rounded px-2 py-1"
ng-model="$parent.adminEmail" required>
</div>
</div>
</div>
<div ng-hide="installationDetailsForm" class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Select PHP</p>
<div ng-hide="installationDetailsForm"
class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">Select PHP</p>
</div>
<div>
<select ng-model="$parent.phpSelection"
class="w-80 bg-gray-100 rounded px-2 py-1">
{% for php in phps %}
<option>{{ php }}</option>
{% endfor %}
</select>
</div>
</div>
<div>
<select ng-model="$parent.phpSelection"
class="form-control w-80 bg-gray-100 rounded px-2 py-1">
{% for php in phps %}
<option>{{ php }}</option>
{% endfor %}
</select>
</div>
</div>
</form>
<div class="flex justify-end mt-3">
<button ng-click="convert()"
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
Convert
</button>
<button onclick="closeModal()"
<button data-modal-toggle="edit"
data-modal-hide="edit"
class="ml-2 bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded">
Close
</button>
</div>
</form>
</div>
</div>
</div>
</div>
</th>
<th class="w-32 pt-2 font-semibold text-sm"><span ng-bind="web.admin"
style="text-transform: none"></span>
@@ -189,45 +200,57 @@
href=""
style="text-transform: none">Issue SSL</a></span>
</th>
<th class="w-32 pt-2 font-semibold text-red-700 text-sm">
<div class="col-md-4 content-box-header">
<i class="p fa fa-arrows-h btn-icon text-muted" data-toggle="tooltip"
data-placement="right" title="Delete">&emsp;</i>
<span><a onclick="openModal()" href="#"
style="text-transform: none">Delete</a>
<!-- Modal -->
<div id="modal"
class="fixed inset-0 z-50 hidden overflow-auto bg-black bg-opacity-50">
<div class="flex items-center justify-center h-full">
<div class="bg-white p-8 rounded shadow-lg">
<button onclick="closeModal()"
class="absolute top-4 right-4 text-gray-700 hover:text-gray-900">
<i class="fa fa-times"></i>
</button>
<h1 class="text-2xl font-bold mb-4">Delete Child Domain</h1>
<form class="mb-4">
<!-- Your form content here -->
<div class="mb-4">
<input type="checkbox" id="deleteDocRoot"
name="deleteDocRoot" class="mr-2">
<label for="deleteDocRoot">Delete Document Root</label>
<th class="w-32 pt-2">
<a onclick="return false;"
ng-click="deleteUserInitial(record.name)"
class="bg-red-500 hover:bg-red-700 text-white font-bold py-1 px-2 rounded"
href="#" data-modal-target="delete"
data-modal-toggle="delete">{% trans "Delete" %}
</a>
<div id="delete" tabindex="-1"
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
<div class="relative p-4 w-full max-w-2xl max-h-full">
<div class="relative bg-white shadow dark:bg-gray-700">
<div class="flex items-center bg-blue-400 px-4 py-4">
<p class="font-bold">Delete Child Domain</p>
<img ng-hide="cyberpanelLoading"
src="{% static 'images/loading.gif' %}">
<button type="button" data-modal-toggle="delete"
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
data-modal-hide="delete">
<svg class="w-3 h-3" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
</svg>
<span class="sr-only">Close modal</span>
</button>
</div>
<div class="p-4 md:p-5">
<form class="mb-4">
<!-- Your form content here -->
<div class="mb-4">
<input type="checkbox" id="deleteDocRoot"
name="deleteDocRoot" class="mr-2">
<label for="deleteDocRoot">Delete Document Root</label>
</div>
</form>
<div class="flex justify-end">
<button ng-click="deleteChildDomain()"
class="bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded">
Delete Now
</button>
<button data-modal-hide="delete" data-modal-toggle="delete"
class="ml-2 bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded">
Close
</button>
</div>
</form>
<div class="flex justify-end">
<button ng-click="deleteChildDomain()"
class="bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded">
Delete Now
</button>
<button onclick="closeModal()"
class="ml-2 bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded">
Close
</button>
</div>
</div>
</div>
</div>
</div>
</th>
</tr>
</div>
@@ -245,7 +268,163 @@
<option ng-repeat="page in pagination">{$ $index + 1 $}</option>
</select>
</div>
</div>
</div>
<th class="w-36 pt-2">
<a onclick="return false;"
ng-click="initConvert(web.domain)"
class="font-semibold text-green-700 text-sm"
href="#" data-modal-target="edit"
data-modal-toggle="edit">{% trans "Convert To Website" %}
</a>
<div id="edit" tabindex="-1"
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
<div class="relative p-4 w-full max-w-2xl max-h-full">
<div class="relative bg-white shadow dark:bg-gray-700">
<div class="flex items-center bg-blue-400 px-4 py-4">
<p class="font-bold">Convert Child Domain to Normal Website</p>
<button type="button" data-modal-toggle="edit"
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
data-modal-hide="edit">
<svg class="w-3 h-3" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
</svg>
<span class="sr-only">Close modal</span>
</button>
</div>
<div class="p-4 md:p-5">
<form name="containerSettingsForm">
<div ng-hide="installationDetailsForm"
class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Domain Name</p>
</div>
<div>
<input name="dom" type="text"
class="w-80 bg-gray-100 rounded px-2 py-1"
ng-model="domainName"
placeholder="{% trans "Do not enter WWW, it will be auto created!" %}"
readonly>
</div>
</div>
<div ng-hide="installationDetailsForm" class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">Select Owner</p>
</div>
<div>
<select ng-model="$parent.websiteOwner"
class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in owernList %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div ng-hide="installationDetailsForm" class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">Select Package</p>
</div>
<div>
<select ng-model="$parent.packageForWebsite"
class="form-control w-80 bg-gray-100 rounded px-2 py-1">
{% for items in packageList %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div ng-hide="installationDetailsForm" class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">Email</p>
</div>
<div>
<input type="email" name="email"
class="w-80 bg-gray-100 rounded px-2 py-1"
ng-model="$parent.adminEmail" required>
</div>
</div>
<div ng-hide="installationDetailsForm" class="flex py-2 px-6">
<div>
<p class="font-semibold w-60">Select PHP</p>
</div>
<div>
<select ng-model="$parent.phpSelection"
class="w-80 bg-gray-100 rounded px-2 py-1">
{% for php in phps %}
<option>{{ php }}</option>
{% endfor %}
</select>
</div>
</div>
</form>
<div class="flex justify-end mt-3">
<button ng-click="convert()"
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
Convert
</button>
<button data-modal-toggle="edit"
data-modal-hide="edit"
class="ml-2 bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded">
Close
</button>
</div>
</div>
</div>
</div>
</div>
</th>
<th class="w-32 pt-2">
<a onclick="return false;"
ng-click="deleteUserInitial(record.name)"
class="bg-red-500 hover:bg-red-700 text-white font-bold py-1 px-2 rounded"
href="#" data-modal-target="delete" data-modal-toggle="delete">{% trans "Delete" %}
</a>
<div id="delete" tabindex="-1"
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
<div class="relative p-4 w-full max-w-2xl max-h-full">
<div class="relative bg-white shadow dark:bg-gray-700">
<div class="flex items-center bg-blue-400 px-4 py-4">
<p class="font-bold">Delete Child Domain</p>
<img ng-hide="cyberpanelLoading"
src="{% static 'images/loading.gif' %}">
<button type="button" data-modal-toggle="delete"
class="absolute top-2 end-1 text-black bg-transparent hover:text-black rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
data-modal-hide="delete">
<svg class="w-3 h-3" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
</svg>
<span class="sr-only">Close modal</span>
</button>
</div>
<div class="p-4 md:p-5">
<form class="mb-4">
<!-- Your form content here -->
<div class="mb-4">
<input type="checkbox" id="deleteDocRoot"
name="deleteDocRoot" class="mr-2">
<label for="deleteDocRoot">Delete Document Root</label>
</div>
</form>
<div class="flex justify-end">
<button ng-click="deleteChildDomain()"
class="bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded">
Delete Now
</button>
<button data-modal-hide="delete" data-modal-toggle="delete"
class="ml-2 bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded">
Close
</button>
</div>
</div>
</div>
</div>
</div>
</th>
{% endblock %}

View File

@@ -6,7 +6,7 @@
{% load static %}
<div ng-controller="listWebsitesV2" class="p-8">
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
<div class="lg:flex justify-between items-center sm:flex-row">
<div>
<p class="text-4xl font-bold">List Website</p>
<p class="text-xs text-gray-600 py-2 font-semibold">On this page you can launch,list,modify and

View File

@@ -12,8 +12,9 @@
add package before creating a website.</p>
</div>
<div>
<div class="py-4">
<div class="flex items-center py-4">
<p class="text-xl font-bold">Modify Website</p>
<img id="modifyWebsiteLoading" src="{% static 'images/loading.gif' %}">
</div>
<hr>
<div>
@@ -40,6 +41,9 @@
<option ng-repeat="pack in webpacks">{$ pack.pack $}</option>
</select>
</div>
<div class="ml-2 text-orange-500 font-semibold">{% trans "Current Package:" %} {$ currentPack
$}
</div>
</div>
<div class="flex py-2 px-6">
<div>
@@ -50,6 +54,9 @@
<option ng-repeat="admins in adminNames">{$ admins.adminNames $}</option>
</select>
</div>
<div class="ml-2 text-orange-500 font-semibold">{% trans "Current Owner:" %} {$ currentAdmin
$}
</div>
</div>
<div class="flex py-2 px-6">
<div>
@@ -77,9 +84,29 @@
</div>
<div class="flex justify-center mt-4">
<button id="modifyWebsiteButton" ng-click="modifyWebsiteFunc()"
class="bg-orange-500 px-3 py-4 rounded-lg text-xl font-semibold text-white">
class="bg-orange-500 px-3 py-2 rounded-lg text-xl font-semibold text-white">
Modify Website
</button>
</div>
<div class="mt-2">
<div class="col-sm-4">
<div id="websiteModifyFailure"
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "Cannot fetch website details. Error message:" %} {$ errorMessage $}</p>
</div>
<div id="canNotModify"
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "Cannot modify website. Error message:" %} {$ errMessage $}</p>
</div>
<div id="websiteModifySuccess"
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
<p>{% trans "Website Details Successfully fetched" %}</p>
</div>
<div id="websiteSuccessfullyModified"
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
<strong>{$ websiteModified $}</strong> Successfully Modified</p>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -11,8 +11,9 @@
<p class="text-xs text-gray-600 py-2 font-semibold">This page can be used to suspend/unsuspend website</p>
</div>
<div>
<div class="py-4">
<div class="flex items-center py-4">
<p class="text-xl font-bold">Suspend/Unsuspend Website</p>
<img ng-hide="suspendLoading" src="{% static 'images/loading.gif' %}">
</div>
<hr>
<div>
@@ -22,19 +23,19 @@
</div>
<div>
<select ng-change="showSuspendUnsuspend()" ng-model="websiteToBeSuspended"
class="form-control w-80 bg-gray-100 rounded px-2 py-1">
class="w-80 bg-gray-100 rounded px-2 py-1">
{% for items in websiteList %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="flex mt-4 py-2 px-6">
<div ng-hide="stateView" class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-60">Suspend/Unsuspend Website</p>
</div>
<div>
<select ng-model="state" class="form-control w-80 bg-gray-100 rounded px-2 py-1">
<select ng-model="state" class="w-80 bg-gray-100 rounded px-2 py-1">
<option>{% trans "Suspend" %}</option>
<option>{% trans "Un-Suspend" %}</option>
</select>
@@ -44,9 +45,30 @@
</div>
<div class="flex justify-center mt-4">
<button ng-click="save()"
class="bg-orange-500 px-3 py-4 rounded-lg text-xl font-semibold text-white">
class="bg-orange-500 px-3 py-2 rounded-lg text-xl font-semibold text-white">
Save
</button>
</div>
<div class="mt-2">
<div>
<div ng-hide="websiteSuspendFailure"
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "Cannot suspend website, Error message: " %}{$ errorMessage $}</p>
</div>
<div ng-hide="websiteUnsuspendFailure"
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "Cannot unsuspend website. Error message:" %} {$ errorMessage $}</p>
</div>
<div ng-hide="websiteSuccess"
class="flex justify-center bg-green-500 px-2 rounded-lg py-1 font-semibold">
<p>{% trans "Website " %}<strong>{$ websiteStatus
$}</strong> {% trans "Successfully " %}{$ finalStatus $}.</p>
</div>
<div ng-hide="couldNotConnect"
class="flex justify-center bg-red-500 rounded-lg text-white px-2 py-1 font-semibold">
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -470,7 +470,7 @@
</div>
<div>
<ul class="flex w-full grid lg:grid-cols-4">
<li class="px-3 py-3">
<a href="{% url 'ApacheManagerV2' domain=domain %}" class="px-3 py-3">
<div class="flex items-center">
<div>
<svg width="20" height="20" viewBox="0 0 40 40" fill="none"
@@ -487,7 +487,7 @@
<p class="px-2 font-bold" style="font-size: 70%;">Apache Manager</p>
</div>
</div>
</li>
</a>
<li ng-click="fetchConfigurations()" class="px-3 py-3 cursor-pointer">
<div class="flex items-center">
<div>
@@ -836,7 +836,7 @@
</div>
</li>
<li class="px-3 py-3">
<div class="flex items-center">
<a href="{% url 'createFTPAccountV2' %}" class="flex items-center">
<div>
<svg width="20" height="20" viewBox="0 0 40 40" fill="none"
xmlns="http://www.w3.org/2000/svg">
@@ -855,12 +855,11 @@
<div>
<p class="px-2 font-bold" style="font-size: 70%;">Create FTP Account</p>
</div>
</div>
</a>
</li>
<li class="px-3 py-3">
<div class="flex items-center">
<a href="{% url 'deleteFTPAccountV2' %}" class="flex items-center">
<div>
<svg width="20" height="20" viewBox="0 0 40 40" fill="none"
xmlns="http://www.w3.org/2000/svg">
<path d="M38.3333 12.5L29.4999 21.6667L24.8333 17" stroke="#FF9A00"
@@ -876,7 +875,7 @@
<div>
<p class="px-2 font-bold" style="font-size: 70%;">Delete FTP Account</p>
</div>
</div>
</a>
</li>
</ul>
{# open_basedir HTML#}
@@ -943,7 +942,7 @@
</div>
<div>
<ul class="flex w-full grid lg:grid-cols-4">
<li class="px-3 py-3">
<a id="emailListsV2" target="_self" title="{% trans 'Create Lists' %}" class="px-3 py-3">
<div class="flex items-center">
<div>
<svg width="20" height="20" viewBox="0 0 40 40" fill="none"
@@ -956,11 +955,11 @@
fill="#FF9A00"/>
</svg>
</div>
<div>
<div id="emailListsChildV2">
<p class="px-2 font-bold" style="font-size: 70%;">Create Lists</p>
</div>
</div>
</li>
</a>
<li class="px-3 py-3">
<div class="flex items-center">
<div>

View File

@@ -36,6 +36,7 @@ urlpatterns = [
url(r'^RestoreHome$', views.RestoreHome, name='RestoreHome'),
url(r'^AutoLogin$', views.AutoLogin, name='AutoLogin'),
url(r'^RemoteBackupConfig$', views.RemoteBackupConfig, name='RemoteBackupConfig'),
url(r'^RemoteBackupConfigV2$', views.RemoteBackupConfigV2, name='RemoteBackupConfigV2'),
url(r'^BackupfileConfig$', views.BackupfileConfig, name='BackupfileConfig'),
url(r'^AddRemoteBackupsite$', views.AddRemoteBackupsite, name='AddRemoteBackupsite'),
url(r'^pricing$', views.WordpressPricing, name='pricing'),
@@ -155,7 +156,6 @@ urlpatterns = [
url(r'^prestaShopInstall$', views.prestaShopInstall, name='prestaShopInstall'),
url(r'^(?P<domain>(.*))/installPrestaShop$', views.installPrestaShop, name='installPrestaShop'),
## magento
url(r'^(?P<domain>(.*))/installMagento$', views.installMagento, name='installMagento'),

View File

@@ -114,6 +114,17 @@ def RestoreHome(request):
return redirect(loadLoginPage)
def RestoreHomeV2(request):
try:
userID = request.session['userID']
BackupID = request.GET.get('BackupID')
wm = WebsiteManager()
return wm.RestoreHomeV2(request, userID, BackupID)
except KeyError:
return redirect(loadLoginPage)
def RemoteBackupConfig(request):
try:
userID = request.session['userID']
@@ -125,6 +136,17 @@ def RemoteBackupConfig(request):
return redirect(loadLoginPage)
def RemoteBackupConfigV2(request):
try:
userID = request.session['userID']
DeleteID = request.GET.get('DeleteID')
wm = WebsiteManager()
return wm.RemoteBackupConfigV2(request, userID, DeleteID)
except KeyError:
return redirect(loadLoginPage)
def BackupfileConfig(request):
try:
userID = request.session['userID']
@@ -137,6 +159,18 @@ def BackupfileConfig(request):
return redirect(loadLoginPage)
def BackupfileConfigV2(request):
try:
userID = request.session['userID']
ID = request.GET.get('ID')
DeleteID = request.GET.get('DeleteID')
wm = WebsiteManager()
return wm.BackupfileConfigV2(request, userID, ID, DeleteID)
except KeyError:
return redirect(loadLoginPage)
def AddRemoteBackupsite(request):
try:
userID = request.session['userID']
@@ -149,6 +183,18 @@ def AddRemoteBackupsite(request):
return redirect(loadLoginPage)
def AddRemoteBackupsiteV2(request):
try:
userID = request.session['userID']
ID = request.GET.get('ID')
DeleteSiteID = request.GET.get('DeleteID')
wm = WebsiteManager()
return wm.AddRemoteBackupsiteV2(request, userID, ID, DeleteSiteID)
except KeyError:
return redirect(loadLoginPage)
def WordpressPricing(request):
try:
userID = request.session['userID']
@@ -2025,6 +2071,15 @@ def ApacheManager(request, domain):
return redirect(loadLoginPage)
def ApacheManagerV2(request, domain):
try:
userID = request.session['userID']
wm = WebsiteManager(domain)
return wm.ApacheManagerV2(request, userID)
except KeyError:
return redirect(loadLoginPage)
def getSwitchStatus(request):
try:
userID = request.session['userID']

View File

@@ -398,6 +398,83 @@ class WebsiteManager:
from django.shortcuts import reverse
return redirect(reverse('pricing'))
def RestoreHomeV2(self, request=None, userID=None, BackupID=None):
Data = {}
currentACL = ACLManager.loadedACL(userID)
admin = Administrator.objects.get(pk=userID)
if ACLManager.CheckForPremFeature('wp-manager'):
Data['backupobj'] = WPSitesBackup.objects.get(pk=BackupID)
if ACLManager.CheckIPBackupObjectOwner(currentACL, Data['backupobj'], admin) == 1:
pass
else:
return ACLManager.loadError()
config = json.loads(Data['backupobj'].config)
Data['FileName'] = config['name']
try:
Data['Backuptype'] = config['Backuptype']
except:
Data['Backuptype'] = None
Data['WPsites'] = ACLManager.GetALLWPObjects(currentACL, userID)
proc = httpProc(request, 'websiteFunctions/WPRestoreHomeV2.html',
Data, 'createWebsite')
return proc.render()
else:
from django.shortcuts import reverse
return redirect(reverse('pricing'))
def RemoteBackupConfigV2(self, request=None, userID=None, DeleteID=None):
Data = {}
currentACL = ACLManager.loadedACL(userID)
admin = Administrator.objects.get(pk=userID)
try:
if DeleteID != None:
BackupconfigDelete = RemoteBackupConfig.objects.get(pk=DeleteID)
BackupconfigDelete.delete()
except:
pass
if ACLManager.CheckForPremFeature('wp-manager'):
Data['WPsites'] = ACLManager.GetALLWPObjects(currentACL, userID)
allcon = RemoteBackupConfig.objects.all()
Data['backupconfigs'] = []
for i in allcon:
configr = json.loads(i.config)
if i.configtype == "SFTP":
Data['backupconfigs'].append({
'id': i.pk,
'Type': i.configtype,
'HostName': configr['Hostname'],
'Path': configr['Path']
})
elif i.configtype == "S3":
Provider = configr['Provider']
if Provider == "Backblaze":
Data['backupconfigs'].append({
'id': i.pk,
'Type': i.configtype,
'HostName': Provider,
'Path': configr['S3keyname']
})
else:
Data['backupconfigs'].append({
'id': i.pk,
'Type': i.configtype,
'HostName': Provider,
'Path': configr['S3keyname']
})
proc = httpProc(request, 'websiteFunctions/RemoteBackupConfigV2.html',
Data, 'createWebsite')
return proc.render()
else:
from django.shortcuts import reverse
return redirect(reverse('pricing'))
def RemoteBackupConfig(self, request=None, userID=None, DeleteID=None):
Data = {}
currentACL = ACLManager.loadedACL(userID)
@@ -483,6 +560,42 @@ class WebsiteManager:
from django.shortcuts import reverse
return redirect(reverse('pricing'))
def BackupfileConfigV2(self, request=None, userID=None, RemoteConfigID=None, DeleteID=None):
Data = {}
currentACL = ACLManager.loadedACL(userID)
admin = Administrator.objects.get(pk=userID)
Data['RemoteConfigID'] = RemoteConfigID
RemoteConfigobj = RemoteBackupConfig.objects.get(pk=RemoteConfigID)
try:
if DeleteID != None:
RemoteBackupConfigDelete = RemoteBackupSchedule.objects.get(pk=DeleteID)
RemoteBackupConfigDelete.delete()
except:
pass
if ACLManager.CheckForPremFeature('wp-manager'):
Data['WPsites'] = ACLManager.GetALLWPObjects(currentACL, userID)
allsechedule = RemoteBackupSchedule.objects.filter(RemoteBackupConfig=RemoteConfigobj)
Data['Backupschedule'] = []
for i in allsechedule:
lastrun = i.lastrun
LastRun = time.strftime('%Y-%m-%d', time.localtime(float(lastrun)))
Data['Backupschedule'].append({
'id': i.pk,
'Name': i.Name,
'RemoteConfiguration': i.RemoteBackupConfig.configtype,
'Retention': i.fileretention,
'Frequency': i.timeintervel,
'LastRun': LastRun
})
proc = httpProc(request, 'websiteFunctions/BackupfileConfigV2.html',
Data, 'createWebsite')
return proc.render()
else:
from django.shortcuts import reverse
return redirect(reverse('pricing'))
def AddRemoteBackupsite(self, request=None, userID=None, RemoteScheduleID=None, DeleteSiteID=None):
Data = {}
currentACL = ACLManager.loadedACL(userID)
@@ -518,6 +631,41 @@ class WebsiteManager:
from django.shortcuts import reverse
return redirect(reverse('pricing'))
def AddRemoteBackupsiteV2(self, request=None, userID=None, RemoteScheduleID=None, DeleteSiteID=None):
Data = {}
currentACL = ACLManager.loadedACL(userID)
admin = Administrator.objects.get(pk=userID)
Data['RemoteScheduleID'] = RemoteScheduleID
RemoteBackupScheduleobj = RemoteBackupSchedule.objects.get(pk=RemoteScheduleID)
try:
if DeleteSiteID != None:
RemoteBackupsitesDelete = RemoteBackupsites.objects.get(pk=DeleteSiteID)
RemoteBackupsitesDelete.delete()
except:
pass
if ACLManager.CheckForPremFeature('wp-manager'):
Data['WPsites'] = ACLManager.GetALLWPObjects(currentACL, userID)
allRemoteBackupsites = RemoteBackupsites.objects.filter(owner=RemoteBackupScheduleobj)
Data['RemoteBackupsites'] = []
for i in allRemoteBackupsites:
try:
wpsite = WPSites.objects.get(pk=i.WPsites)
Data['RemoteBackupsites'].append({
'id': i.pk,
'Title': wpsite.title,
})
except:
pass
proc = httpProc(request, 'websiteFunctions/AddRemoteBackupSiteV2.html',
Data, 'createWebsite')
return proc.render()
else:
from django.shortcuts import reverse
return redirect(reverse('pricing'))
def WordpressPricing(self, request=None, userID=None, ):
Data = {}
proc = httpProc(request, 'websiteFunctions/CyberpanelPricing.html', Data, 'createWebsite')
@@ -7003,6 +7151,26 @@ StrictHostKeyChecking no
{'domainName': self.domain, 'phps': phps, 'apachemanager': apachemanager})
return proc.render()
def ApacheManagerV2(self, request=None, userID=None, data=None):
currentACL = ACLManager.loadedACL(userID)
admin = Administrator.objects.get(pk=userID)
if ACLManager.checkOwnership(self.domain, admin, currentACL) == 1:
pass
else:
return ACLManager.loadError()
phps = PHPManager.findPHPVersions()
if ACLManager.CheckForPremFeature('all'):
apachemanager = 1
else:
apachemanager = 0
proc = httpProc(request, 'websiteFunctions/ApacheManagerV2.html',
{'domainName': self.domain, 'phps': phps, 'apachemanager': apachemanager})
return proc.render()
def saveApacheConfigsToFile(self, userID=None, data=None):
currentACL = ACLManager.loadedACL(userID)

View File

@@ -8,7 +8,6 @@ urlpatterns = [
url(r'^createWebsiteV2$', views.createWebsiteV2, name='createWebsiteV2'),
url(r'^listWebsitesV2$', views.listWebsitesV2, name='listWebsitesV2'),
url(r'^CreateNewDomainV2$', views.CreateNewDomainV2, name='CreateNewDomainV2'),
### WordPress
@@ -60,6 +59,10 @@ urlpatterns = [
url(r'^AddnewpluginV2$', views.AddnewpluginV2, name='AddnewpluginV2'),
url(r'^EidtPlugin$', views.EidtPlugin, name='EidtPlugin'),
url(r'^EidtPluginV2$', views.EidtPluginV2, name='EidtPluginV2'),
url(r'^RemoteBackupConfigV2$', views.RemoteBackupConfigV2, name='RemoteBackupConfigV2'),
url(r'^RestoreHomeV2$', views.RestoreHomeV2, name='RestoreHomeV2'),
url(r'^BackupfileConfigV2$', views.BackupfileConfigV2, name='BackupfileConfigV2'),
url(r'^AddRemoteBackupsiteV2$', views.AddRemoteBackupsiteV2, name='AddRemoteBackupsiteV2'),
## AddPlugin Ajax
url(r'^SearchOnkeyupPlugin$', views.SearchOnkeyupPlugin, name='SearchOnkeyupPlugin'),
@@ -203,6 +206,7 @@ urlpatterns = [
### Apache Manager
url(r'^V2/ApacheManagerV2/(?P<domain>(.*))$', views.ApacheManagerV2, name='ApacheManagerV2'),
url(r'^getSwitchStatus$', views.getSwitchStatus, name='getSwitchStatus'),
url(r'^switchServer$', views.switchServer, name='switchServer'),
url(r'^statusFunc$', views.statusFunc, name='statusFunc'),