mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 13:56:01 +01:00
added addon domain in CP
This commit is contained in:
@@ -4521,6 +4521,21 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
|||||||
|
|
||||||
var statusFile;
|
var statusFile;
|
||||||
|
|
||||||
|
|
||||||
|
$scope.webselection = true;
|
||||||
|
$scope.WebsiteType = function () {
|
||||||
|
var type = $scope.websitetype;
|
||||||
|
if (type == 'Sub Domain') {
|
||||||
|
$scope.webselection = false;
|
||||||
|
$scope.DomainCreateForm = true;
|
||||||
|
|
||||||
|
} else if (type == 'Addon Domain') {
|
||||||
|
$scope.DomainCreateForm = false;
|
||||||
|
$scope.webselection = true;
|
||||||
|
$scope.masterDomain = $('#defaultSite').html()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
$scope.WebsiteSelection = function () {
|
$scope.WebsiteSelection = function () {
|
||||||
$scope.DomainCreateForm = false;
|
$scope.DomainCreateForm = false;
|
||||||
};
|
};
|
||||||
@@ -4584,8 +4599,11 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
|||||||
//
|
//
|
||||||
// var domainName = $scope.own_domainNameCreate;
|
// var domainName = $scope.own_domainNameCreate;
|
||||||
// }
|
// }
|
||||||
|
var type = $scope.websitetype;
|
||||||
|
|
||||||
var domainName = $scope.domainNameCreate;
|
var domainName = $scope.domainNameCreate;
|
||||||
|
|
||||||
|
|
||||||
var data = {
|
var data = {
|
||||||
domainName: domainName,
|
domainName: domainName,
|
||||||
phpSelection: phpSelection,
|
phpSelection: phpSelection,
|
||||||
@@ -4603,6 +4621,8 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// console.log(data)
|
||||||
|
|
||||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||||
|
|
||||||
|
|
||||||
@@ -10759,7 +10779,7 @@ app.controller('ListDockersitecontainer', function ($scope, $http) {
|
|||||||
|
|
||||||
|
|
||||||
$scope.refreshStatus = function () {
|
$scope.refreshStatus = function () {
|
||||||
$('#actionLoading').show();
|
$('#actionLoading').show();
|
||||||
url = "/docker/getContainerStatus";
|
url = "/docker/getContainerStatus";
|
||||||
var data = {name: $scope.cName};
|
var data = {name: $scope.cName};
|
||||||
var config = {
|
var config = {
|
||||||
@@ -10771,7 +10791,7 @@ app.controller('ListDockersitecontainer', function ($scope, $http) {
|
|||||||
$http.post(url, data, config).then(ListInitialData, cantLoadInitialData);
|
$http.post(url, data, config).then(ListInitialData, cantLoadInitialData);
|
||||||
|
|
||||||
function ListInitialData(response) {
|
function ListInitialData(response) {
|
||||||
$('#actionLoading').hide();
|
$('#actionLoading').hide();
|
||||||
if (response.data.containerStatus === 1) {
|
if (response.data.containerStatus === 1) {
|
||||||
console.log(response.data.status);
|
console.log(response.data.status);
|
||||||
$scope.status = response.data.status;
|
$scope.status = response.data.status;
|
||||||
@@ -10786,7 +10806,7 @@ app.controller('ListDockersitecontainer', function ($scope, $http) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cantLoadInitialData(response) {
|
function cantLoadInitialData(response) {
|
||||||
$('#actionLoading').hide();
|
$('#actionLoading').hide();
|
||||||
PNotify.error({
|
PNotify.error({
|
||||||
title: 'Unable to complete request',
|
title: 'Unable to complete request',
|
||||||
text: "Problem in connecting to server"
|
text: "Problem in connecting to server"
|
||||||
@@ -10796,7 +10816,7 @@ app.controller('ListDockersitecontainer', function ($scope, $http) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.restarthStatus = function () {
|
$scope.restarthStatus = function () {
|
||||||
$('#actionLoading').show();
|
$('#actionLoading').show();
|
||||||
url = "/docker/RestartContainerAPP";
|
url = "/docker/RestartContainerAPP";
|
||||||
var data = {
|
var data = {
|
||||||
name: $scope.cName,
|
name: $scope.cName,
|
||||||
@@ -10811,7 +10831,7 @@ app.controller('ListDockersitecontainer', function ($scope, $http) {
|
|||||||
$http.post(url, data, config).then(ListInitialData, cantLoadInitialData);
|
$http.post(url, data, config).then(ListInitialData, cantLoadInitialData);
|
||||||
|
|
||||||
function ListInitialData(response) {
|
function ListInitialData(response) {
|
||||||
$('#actionLoading').hide();
|
$('#actionLoading').hide();
|
||||||
if (response.data.status === 1) {
|
if (response.data.status === 1) {
|
||||||
if (response.data.data[0] === 1) {
|
if (response.data.data[0] === 1) {
|
||||||
new PNotify({
|
new PNotify({
|
||||||
@@ -10838,7 +10858,7 @@ app.controller('ListDockersitecontainer', function ($scope, $http) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cantLoadInitialData(response) {
|
function cantLoadInitialData(response) {
|
||||||
$('#actionLoading').hide();
|
$('#actionLoading').hide();
|
||||||
PNotify.error({
|
PNotify.error({
|
||||||
title: 'Unable to complete request',
|
title: 'Unable to complete request',
|
||||||
text: "Problem in connecting to server"
|
text: "Problem in connecting to server"
|
||||||
|
|||||||
@@ -104,172 +104,198 @@
|
|||||||
{% trans "Details" %} <img ng-hide="domainLoading"
|
{% trans "Details" %} <img ng-hide="domainLoading"
|
||||||
src="{% static 'images/loading.gif' %}">
|
src="{% static 'images/loading.gif' %}">
|
||||||
</h3>
|
</h3>
|
||||||
<div class="example-box-wrapper">
|
{% if defaultSite == 'NONE' %}
|
||||||
|
<div class="example-box-wrapper">
|
||||||
<form name="websiteCreationForm" action="/" id="createPackages"
|
<div class="alert alert-danger">
|
||||||
class="form-horizontal bordered-row panel-body">
|
<p>{% trans "You need to create website before creating Sub/Addon domains." %} </p>
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">{% trans "Select Website" %} </label>
|
|
||||||
<div class="col-sm-6">
|
|
||||||
<select ng-change="WebsiteSelection()" ng-model="masterDomain" class="form-control">
|
|
||||||
{% for items in websiteList %}
|
|
||||||
<option>{{ items }}</option>
|
|
||||||
{% endfor %}
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{# <div ng-hide="DomainCreateForm" class="form-group">#}
|
{% else %}
|
||||||
{# <label class="col-sm-3 control-label">{% trans "Domain Name" %}</label>#}
|
<div class="example-box-wrapper">
|
||||||
{# <div class="col-sm-6">#}
|
|
||||||
{# <input name="dom" type="text" class="form-control"#}
|
|
||||||
{# ng-model="domainNameCreate" required>#}
|
|
||||||
{# </div>#}
|
|
||||||
{# </div>#}
|
|
||||||
{##}
|
|
||||||
{# <div ng-hide="DomainCreateForm" class="form-group">#}
|
|
||||||
{# <label class="col-sm-3 control-label">{% trans "Path" %}: /home/{$ masterDomain $}/ </label>#}
|
|
||||||
{# <div class="col-sm-6">#}
|
|
||||||
{# <input type="text" class="form-control" ng-model="docRootPath" required>#}
|
|
||||||
{# </div>#}
|
|
||||||
{# <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>#}
|
|
||||||
|
|
||||||
{# My Work . #}
|
<form name="websiteCreationForm" action="/" id="createPackages"
|
||||||
|
class="form-horizontal bordered-row panel-body">
|
||||||
|
|
||||||
<div ng-hide="DomainCreateForm" class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">{% trans "Domain Name" %}</label>
|
<label class="col-sm-3 control-label">{% trans "Domain Type" %} </label>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input name="dom" type="text" class="form-control"
|
<select ng-change="WebsiteType()" ng-model="websitetype" class="form-control">
|
||||||
ng-model="domainNameCreate" required>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div ng-hide="DomainCreateForm" class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">{% trans "Path" %}: /home/{$ masterDomain
|
|
||||||
$}/ </label>
|
|
||||||
<div class="col-sm-6">
|
|
||||||
<input type="text" class="form-control" ng-model="docRootPath" required>
|
|
||||||
</div>
|
|
||||||
<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>
|
|
||||||
|
|
||||||
{# My Work End #}
|
<option>Sub Domain</option>
|
||||||
|
<option>Addon Domain</option>
|
||||||
|
|
||||||
<div ng-hide="DomainCreateForm" class="form-group">
|
</select>
|
||||||
<label class="col-sm-3 control-label">{% trans "Select PHP" %}</label>
|
|
||||||
<div class="col-sm-6">
|
|
||||||
<select ng-model="phpSelection" class="form-control">
|
|
||||||
{% for php in phps %}
|
|
||||||
<option>{{ php }}</option>
|
|
||||||
{% endfor %}
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div ng-hide="DomainCreateForm" ng-hide="installationDetailsForm"
|
|
||||||
class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">{% trans "Additional Features" %}</label>
|
|
||||||
<div class="col-sm-9">
|
|
||||||
<div class="checkbox">
|
|
||||||
<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">
|
|
||||||
<label>
|
|
||||||
{% if test_domain_data %}
|
|
||||||
<input ng-model="apacheBackend" type="checkbox" value="">
|
|
||||||
Apache as Reverse Proxy (Beta, for Ubuntu 22 and AlmaLinux 8)
|
|
||||||
{% else %}
|
|
||||||
<input ng-model="apacheBackend" type="checkbox" value="" disabled>
|
|
||||||
OpenLiteSpeed + Apache (Backend) (For Ubuntu 22 and AlmaLinux 8) -
|
|
||||||
<strong><a href="https://go.cyberpanel.net/ApacheRev">Premium Feature</a> <i
|
|
||||||
class="p fa fa-external-link btn-icon"> </i></strong>
|
|
||||||
{% endif %}
|
|
||||||
</label>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label class="col-sm-3 control-label"></label>
|
|
||||||
<div class="col-sm-9">
|
<span style="display: none" id="defaultSite">{{ defaultSite }}</span>
|
||||||
<div class="checkbox">
|
|
||||||
<label>
|
<div class="form-group" ng-hide="webselection">
|
||||||
<input ng-model="dkimCheck" type="checkbox" value="">
|
<label class="col-sm-3 control-label">{% trans "Select Website" %} </label>
|
||||||
DKIM Support
|
<div class="col-sm-6">
|
||||||
</label>
|
<select ng-change="WebsiteSelection()" ng-model="masterDomain" class="form-control">
|
||||||
|
{% for items in websiteList %}
|
||||||
|
<option>{{ items }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<label class="col-sm-3 control-label"></label>
|
|
||||||
<div class="col-sm-9">
|
{# <div ng-hide="DomainCreateForm" class="form-group">#}
|
||||||
<div class="checkbox">
|
{# <label class="col-sm-3 control-label">{% trans "Domain Name" %}</label>#}
|
||||||
<label>
|
{# <div class="col-sm-6">#}
|
||||||
<input ng-model="openBasedir" type="checkbox" value="">
|
{# <input name="dom" type="text" class="form-control"#}
|
||||||
open_basedir Protection
|
{# ng-model="domainNameCreate" required>#}
|
||||||
</label>
|
{# </div>#}
|
||||||
|
{# </div>#}
|
||||||
|
{##}
|
||||||
|
{# <div ng-hide="DomainCreateForm" class="form-group">#}
|
||||||
|
{# <label class="col-sm-3 control-label">{% trans "Path" %}: /home/{$ masterDomain $}/ </label>#}
|
||||||
|
{# <div class="col-sm-6">#}
|
||||||
|
{# <input type="text" class="form-control" ng-model="docRootPath" required>#}
|
||||||
|
{# </div>#}
|
||||||
|
{# <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>#}
|
||||||
|
|
||||||
|
{# My Work . #}
|
||||||
|
|
||||||
|
<div ng-hide="DomainCreateForm" class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Domain Name" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input name="dom" type="text" class="form-control"
|
||||||
|
ng-model="domainNameCreate" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div ng-hide="DomainCreateForm" class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Path" %}: /home/{$ masterDomain
|
||||||
<div ng-hide="DomainCreateForm" class="form-group">
|
$}/ </label>
|
||||||
<label class="col-sm-3 control-label"></label>
|
<div class="col-sm-6">
|
||||||
<div class="col-sm-4">
|
<input type="text" class="form-control" ng-model="docRootPath" required>
|
||||||
<button type="button" ng-click="createDomain()"
|
|
||||||
class="btn btn-primary btn-lg">{% trans "Create Domain" %}</button>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div ng-hide="installationProgress" class="form-group">
|
|
||||||
<label class="col-sm-2 control-label"></label>
|
|
||||||
<div class="col-sm-7">
|
|
||||||
|
|
||||||
<div class="alert alert-success text-center">
|
|
||||||
<h2>{$ currentStatus $}</h2>
|
|
||||||
</div>
|
</div>
|
||||||
|
<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 class="progress">
|
{# My Work End #}
|
||||||
<div id="installProgress" class="progress-bar" role="progressbar"
|
|
||||||
aria-valuenow="70" aria-valuemin="0" aria-valuemax="100"
|
<div ng-hide="DomainCreateForm" class="form-group">
|
||||||
style="width:0%">
|
<label class="col-sm-3 control-label">{% trans "Select PHP" %}</label>
|
||||||
<span class="sr-only">70% Complete</span>
|
<div class="col-sm-6">
|
||||||
|
<select ng-model="phpSelection" class="form-control">
|
||||||
|
{% for php in phps %}
|
||||||
|
<option>{{ php }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-hide="DomainCreateForm" ng-hide="installationDetailsForm"
|
||||||
|
class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Additional Features" %}</label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<div class="checkbox">
|
||||||
|
<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">
|
||||||
|
<label>
|
||||||
|
{% if test_domain_data %}
|
||||||
|
<input ng-model="apacheBackend" type="checkbox" value="">
|
||||||
|
Apache as Reverse Proxy (Beta, for Ubuntu 22 and AlmaLinux 8)
|
||||||
|
{% else %}
|
||||||
|
<input ng-model="apacheBackend" type="checkbox" value="" disabled>
|
||||||
|
OpenLiteSpeed + Apache (Backend) (For Ubuntu 22 and AlmaLinux 8) -
|
||||||
|
<strong><a href="https://go.cyberpanel.net/ApacheRev">Premium
|
||||||
|
Feature</a> <i
|
||||||
|
class="p fa fa-external-link btn-icon"> </i></strong>
|
||||||
|
{% endif %}
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div ng-hide="errorMessageBox" class="alert alert-danger">
|
<label class="col-sm-3 control-label"></label>
|
||||||
<p>{% trans "Error message:" %} {$ errorMessage $}</p>
|
<div class="col-sm-9">
|
||||||
|
<div class="checkbox">
|
||||||
|
<label>
|
||||||
|
<input ng-model="dkimCheck" type="checkbox" value="">
|
||||||
|
DKIM Support
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<label class="col-sm-3 control-label"></label>
|
||||||
<div ng-hide="success" class="alert alert-success">
|
<div class="col-sm-9">
|
||||||
<p>{% trans "Website succesfully created." %}</p>
|
<div class="checkbox">
|
||||||
|
<label>
|
||||||
|
<input ng-model="openBasedir" type="checkbox" value="">
|
||||||
|
open_basedir Protection
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div ng-hide="couldNotConnect" class="alert alert-danger">
|
|
||||||
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div ng-hide="installationProgress" class="form-group">
|
<div ng-hide="DomainCreateForm" class="form-group">
|
||||||
<label class="col-sm-3 control-label"></label>
|
<label class="col-sm-3 control-label"></label>
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
<button type="button" ng-disabled="goBackDisable" ng-click="goBack()"
|
<button type="button" ng-click="createDomain()"
|
||||||
class="btn btn-primary btn-lg">{% trans "Go Back" %}</button>
|
class="btn btn-primary btn-lg">{% trans "Create Domain" %}</button>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
|
|
||||||
</div>
|
<div ng-hide="installationProgress" class="form-group">
|
||||||
|
<label class="col-sm-2 control-label"></label>
|
||||||
|
<div class="col-sm-7">
|
||||||
|
|
||||||
|
<div class="alert alert-success text-center">
|
||||||
|
<h2>{$ currentStatus $}</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="progress">
|
||||||
|
<div id="installProgress" class="progress-bar" role="progressbar"
|
||||||
|
aria-valuenow="70" aria-valuemin="0" aria-valuemax="100"
|
||||||
|
style="width:0%">
|
||||||
|
<span class="sr-only">70% Complete</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-hide="errorMessageBox" class="alert alert-danger">
|
||||||
|
<p>{% trans "Error message:" %} {$ errorMessage $}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-hide="success" class="alert alert-success">
|
||||||
|
<p>{% trans "Website succesfully created." %}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div ng-hide="couldNotConnect" class="alert alert-danger">
|
||||||
|
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-hide="installationProgress" class="form-group">
|
||||||
|
<label class="col-sm-3 control-label"></label>
|
||||||
|
<div class="col-sm-4">
|
||||||
|
<button type="button" ng-disabled="goBackDisable" ng-click="goBack()"
|
||||||
|
class="btn btn-primary btn-lg">{% trans "Go Back" %}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -705,12 +705,18 @@ class WebsiteManager:
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
admin = Administrator.objects.get(pk=userID)
|
admin = Administrator.objects.get(pk=userID)
|
||||||
defaultDomain = Websites.objects.get(pk=admin.defaultSite).domain
|
defaultDomain = Websites.objects.get(pk=admin.defaultSite).domain
|
||||||
except:
|
except:
|
||||||
defaultDomain = 'NONE'
|
try:
|
||||||
|
admin = Administrator.objects.get(pk=userID)
|
||||||
|
websites = ACLManager.findWebsiteObjects(currentACL, userID)
|
||||||
|
admin.defaultSite = websites[0].id
|
||||||
|
admin.save()
|
||||||
|
defaultDomain = websites[0].domain
|
||||||
|
except:
|
||||||
|
defaultDomain='NONE'
|
||||||
|
|
||||||
url = "https://platform.cyberpersons.com/CyberpanelAdOns/Adonpermission"
|
url = "https://platform.cyberpersons.com/CyberpanelAdOns/Adonpermission"
|
||||||
data = {
|
data = {
|
||||||
|
|||||||
Reference in New Issue
Block a user