mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 22:06:05 +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);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -104,12 +104,35 @@
|
|||||||
{% trans "Details" %} <img ng-hide="domainLoading"
|
{% trans "Details" %} <img ng-hide="domainLoading"
|
||||||
src="{% static 'images/loading.gif' %}">
|
src="{% static 'images/loading.gif' %}">
|
||||||
</h3>
|
</h3>
|
||||||
|
{% if defaultSite == 'NONE' %}
|
||||||
|
<div class="example-box-wrapper">
|
||||||
|
<div class="alert alert-danger">
|
||||||
|
<p>{% trans "You need to create website before creating Sub/Addon domains." %} </p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% else %}
|
||||||
<div class="example-box-wrapper">
|
<div class="example-box-wrapper">
|
||||||
|
|
||||||
<form name="websiteCreationForm" action="/" id="createPackages"
|
<form name="websiteCreationForm" action="/" id="createPackages"
|
||||||
class="form-horizontal bordered-row panel-body">
|
class="form-horizontal bordered-row panel-body">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Domain Type" %} </label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<select ng-change="WebsiteType()" ng-model="websitetype" class="form-control">
|
||||||
|
|
||||||
|
<option>Sub Domain</option>
|
||||||
|
<option>Addon Domain</option>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<span style="display: none" id="defaultSite">{{ defaultSite }}</span>
|
||||||
|
|
||||||
|
<div class="form-group" ng-hide="webselection">
|
||||||
<label class="col-sm-3 control-label">{% trans "Select Website" %} </label>
|
<label class="col-sm-3 control-label">{% trans "Select Website" %} </label>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<select ng-change="WebsiteSelection()" ng-model="masterDomain" class="form-control">
|
<select ng-change="WebsiteSelection()" ng-model="masterDomain" class="form-control">
|
||||||
@@ -190,7 +213,8 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
<input ng-model="apacheBackend" type="checkbox" value="" disabled>
|
<input ng-model="apacheBackend" type="checkbox" value="" disabled>
|
||||||
OpenLiteSpeed + Apache (Backend) (For Ubuntu 22 and AlmaLinux 8) -
|
OpenLiteSpeed + Apache (Backend) (For Ubuntu 22 and AlmaLinux 8) -
|
||||||
<strong><a href="https://go.cyberpanel.net/ApacheRev">Premium Feature</a> <i
|
<strong><a href="https://go.cyberpanel.net/ApacheRev">Premium
|
||||||
|
Feature</a> <i
|
||||||
class="p fa fa-external-link btn-icon"> </i></strong>
|
class="p fa fa-external-link btn-icon"> </i></strong>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</label>
|
</label>
|
||||||
@@ -226,6 +250,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div ng-hide="installationProgress" class="form-group">
|
<div ng-hide="installationProgress" class="form-group">
|
||||||
<label class="col-sm-2 control-label"></label>
|
<label class="col-sm-2 control-label"></label>
|
||||||
<div class="col-sm-7">
|
<div class="col-sm-7">
|
||||||
@@ -270,6 +295,7 @@
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</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