diff --git a/baseTemplate/templates/baseTemplate/index.html b/baseTemplate/templates/baseTemplate/index.html index 70f655dfb..896d74081 100755 --- a/baseTemplate/templates/baseTemplate/index.html +++ b/baseTemplate/templates/baseTemplate/index.html @@ -428,6 +428,9 @@
  • {% trans "List Websites" %}
  • +
  • {% trans "Create New Domain" %} +
  • {% trans "List Child Domains" %}
  • diff --git a/serverStatus/serverStatusUtil.py b/serverStatus/serverStatusUtil.py index ae8862793..3ed9410d9 100755 --- a/serverStatus/serverStatusUtil.py +++ b/serverStatus/serverStatusUtil.py @@ -14,7 +14,7 @@ from websiteFunctions.models import Websites from plogical.virtualHostUtilities import virtualHostUtilities from plogical.sslUtilities import sslUtilities from plogical.vhost import vhost -from shutil import copytree, ignore_patterns +from shutil import ignore_patterns class ServerStatusUtil: diff --git a/static/admin/css/changelists.css b/static/admin/css/changelists.css index 1bda965e5..a16425403 100644 --- a/static/admin/css/changelists.css +++ b/static/admin/css/changelists.css @@ -89,7 +89,7 @@ color: #333; } -#searchbar { +#toolbar #searchbar { height: 19px; border: 1px solid #ccc; padding: 2px 5px; @@ -99,7 +99,7 @@ max-width: 100%; } -#searchbar:focus { +#toolbar #searchbar:focus { border-color: #999; } @@ -128,6 +128,7 @@ /* FILTER COLUMN */ #changelist-filter { + flex: 0 0 240px; order: 1; width: 240px; background: #f8f8f8; diff --git a/static/admin/css/responsive.css b/static/admin/css/responsive.css index d745eaebf..053e84132 100644 --- a/static/admin/css/responsive.css +++ b/static/admin/css/responsive.css @@ -120,7 +120,8 @@ input[type="submit"], button { } #changelist-search .quiet { - width: 100%; + width: 0; + flex: 1 0 auto; margin: 5px 0 0 25px; } @@ -156,7 +157,7 @@ input[type="submit"], button { } #changelist-filter { - width: 200px; + flex-basis: 200px; } .change-list .filtered .results, @@ -216,7 +217,7 @@ input[type="submit"], button { } textarea { - max-width: 518px; + max-width: 100%; max-height: 120px; } @@ -557,6 +558,7 @@ input[type="submit"], button { .aligned .form-row, .aligned .form-row > div { display: flex; + flex-wrap: wrap; max-width: 100vw; } diff --git a/static/websiteFunctions/websiteFunctions.js b/static/websiteFunctions/websiteFunctions.js index 6a86b3fc6..84560d7e1 100644 --- a/static/websiteFunctions/websiteFunctions.js +++ b/static/websiteFunctions/websiteFunctions.js @@ -1896,7 +1896,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) { function ListInitialDatas(response) { - if (response.data.sslStatus == 1) { + if (response.data.sslStatus === 1) { $scope.sslSaved = false; $scope.couldNotSaveSSL = true; @@ -2040,9 +2040,14 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) { $scope.success = true; $scope.couldNotConnect = true; $scope.goBackDisable = true; + $scope.DomainCreateForm = true; var statusFile; + $scope.WebsiteSelection = function (){ + $scope.DomainCreateForm = false; + }; + $scope.createDomain = function () { $scope.domainLoading = false; @@ -2053,6 +2058,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) { $scope.couldNotConnect = true; $scope.goBackDisable = true; $scope.currentStatus = "Starting creation.."; + $scope.DomainCreateForm = true; var ssl, dkimCheck, openBasedir; @@ -2091,7 +2097,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) { phpSelection: phpSelection, ssl: ssl, path: path, - masterDomain: $("#domainNamePage").text(), + masterDomain: $scope.masterDomain, dkimCheck: dkimCheck, openBasedir: openBasedir }; @@ -2114,6 +2120,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) { $scope.domainLoading = true; $scope.installationDetailsForm = true; + $scope.DomainCreateForm = true; $scope.installationProgress = false; $scope.errorMessageBox = false; $scope.success = true; @@ -2130,6 +2137,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) { $scope.domainLoading = true; $scope.installationDetailsForm = true; + $scope.DomainCreateForm = true; $scope.installationProgress = false; $scope.errorMessageBox = true; $scope.success = true; @@ -2144,11 +2152,13 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) { $scope.goBack = function () { $scope.domainLoading = true; $scope.installationDetailsForm = false; + $scope.DomainCreateForm = true; $scope.installationProgress = true; $scope.errorMessageBox = true; $scope.success = true; $scope.couldNotConnect = true; $scope.goBackDisable = true; + $scope.DomainCreateForm = true; $("#installProgress").css("width", "0%"); }; @@ -2194,6 +2204,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) { $scope.domainLoading = true; $scope.installationDetailsForm = true; + $scope.DomainCreateForm = true; $scope.installationProgress = false; $scope.errorMessageBox = false; $scope.success = true; @@ -2221,6 +2232,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) { $scope.domainLoading = true; $scope.installationDetailsForm = true; + $scope.DomainCreateForm = true; $scope.installationProgress = false; $scope.errorMessageBox = true; $scope.success = true; diff --git a/websiteFunctions/static/websiteFunctions/websiteFunctions.js b/websiteFunctions/static/websiteFunctions/websiteFunctions.js index 6a86b3fc6..84560d7e1 100755 --- a/websiteFunctions/static/websiteFunctions/websiteFunctions.js +++ b/websiteFunctions/static/websiteFunctions/websiteFunctions.js @@ -1896,7 +1896,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) { function ListInitialDatas(response) { - if (response.data.sslStatus == 1) { + if (response.data.sslStatus === 1) { $scope.sslSaved = false; $scope.couldNotSaveSSL = true; @@ -2040,9 +2040,14 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) { $scope.success = true; $scope.couldNotConnect = true; $scope.goBackDisable = true; + $scope.DomainCreateForm = true; var statusFile; + $scope.WebsiteSelection = function (){ + $scope.DomainCreateForm = false; + }; + $scope.createDomain = function () { $scope.domainLoading = false; @@ -2053,6 +2058,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) { $scope.couldNotConnect = true; $scope.goBackDisable = true; $scope.currentStatus = "Starting creation.."; + $scope.DomainCreateForm = true; var ssl, dkimCheck, openBasedir; @@ -2091,7 +2097,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) { phpSelection: phpSelection, ssl: ssl, path: path, - masterDomain: $("#domainNamePage").text(), + masterDomain: $scope.masterDomain, dkimCheck: dkimCheck, openBasedir: openBasedir }; @@ -2114,6 +2120,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) { $scope.domainLoading = true; $scope.installationDetailsForm = true; + $scope.DomainCreateForm = true; $scope.installationProgress = false; $scope.errorMessageBox = false; $scope.success = true; @@ -2130,6 +2137,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) { $scope.domainLoading = true; $scope.installationDetailsForm = true; + $scope.DomainCreateForm = true; $scope.installationProgress = false; $scope.errorMessageBox = true; $scope.success = true; @@ -2144,11 +2152,13 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) { $scope.goBack = function () { $scope.domainLoading = true; $scope.installationDetailsForm = false; + $scope.DomainCreateForm = true; $scope.installationProgress = true; $scope.errorMessageBox = true; $scope.success = true; $scope.couldNotConnect = true; $scope.goBackDisable = true; + $scope.DomainCreateForm = true; $("#installProgress").css("width", "0%"); }; @@ -2194,6 +2204,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) { $scope.domainLoading = true; $scope.installationDetailsForm = true; + $scope.DomainCreateForm = true; $scope.installationProgress = false; $scope.errorMessageBox = false; $scope.success = true; @@ -2221,6 +2232,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) { $scope.domainLoading = true; $scope.installationDetailsForm = true; + $scope.DomainCreateForm = true; $scope.installationProgress = false; $scope.errorMessageBox = true; $scope.success = true; diff --git a/websiteFunctions/templates/websiteFunctions/createDomain.html b/websiteFunctions/templates/websiteFunctions/createDomain.html new file mode 100755 index 000000000..7fdef8d7c --- /dev/null +++ b/websiteFunctions/templates/websiteFunctions/createDomain.html @@ -0,0 +1,158 @@ +{% extends "baseTemplate/index.html" %} +{% load i18n %} +{% block title %}{% trans "Create New Domain - CyberPanel" %}{% endblock %} +{% block content %} + + {% load static %} + {% get_current_language as LANGUAGE_CODE %} + + +
    +
    +

    {% trans "Create Child Domain" %}

    +

    {% trans "Create child-domains, child domains are owned by a master website. " %}

    +
    + + +
    +
    +

    + {% trans "Details" %} +

    +
    + +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    {% trans "Invalid Domain (Note: You don't need to add 'http' or 'https')" %}
    +
    + +
    + +
    + +
    +
    + +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    + +
    + +
    + + +
    +
    + +
    + +
    + +
    +

    {$ currentStatus $}

    +
    + +
    +
    + 70% Complete +
    +
    + +
    +

    {% trans "Error message:" %} {$ errorMessage $}

    +
    + +
    +

    {% trans "Website succesfully created." %}

    +
    + + +
    +

    {% trans "Could not connect to server. Please refresh this page." %}

    +
    + + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    +
    +
    + + +
    + + +{% endblock %} diff --git a/websiteFunctions/templates/websiteFunctions/website.html b/websiteFunctions/templates/websiteFunctions/website.html index 0802c79f9..b80b9cd0a 100755 --- a/websiteFunctions/templates/websiteFunctions/website.html +++ b/websiteFunctions/templates/websiteFunctions/website.html @@ -242,10 +242,10 @@
    -
    @@ -326,7 +325,6 @@
    -
    @@ -358,7 +356,6 @@
    -
    @@ -368,7 +365,6 @@
    -
    diff --git a/websiteFunctions/urls.py b/websiteFunctions/urls.py index 4ebef718e..b497ea649 100755 --- a/websiteFunctions/urls.py +++ b/websiteFunctions/urls.py @@ -11,6 +11,10 @@ urlpatterns = [ url(r'^deleteWebsite$', views.deleteWebsite, name='deleteWebsite'), url(r'^siteState$', views.siteState, name='siteState'), + ## + + url(r'^CreateNewDomain$', views.CreateNewDomain, name='CreateNewDomain'), + # Website modification url diff --git a/websiteFunctions/views.py b/websiteFunctions/views.py index a03884740..603455802 100755 --- a/websiteFunctions/views.py +++ b/websiteFunctions/views.py @@ -46,6 +46,14 @@ def deleteWebsite(request): except KeyError: return redirect(loadLoginPage) +def CreateNewDomain(request): + try: + userID = request.session['userID'] + wm = WebsiteManager() + return wm.CreateNewDomain(request, userID) + except KeyError: + return redirect(loadLoginPage) + def siteState(request): try: userID = request.session['userID'] diff --git a/websiteFunctions/website.py b/websiteFunctions/website.py index 56950db0d..5543ff9bd 100755 --- a/websiteFunctions/website.py +++ b/websiteFunctions/website.py @@ -75,6 +75,12 @@ class WebsiteManager: {'websiteList': websitesName}, 'deleteWebsite') return proc.render() + def CreateNewDomain(self, request=None, userID=None, data=None): + currentACL = ACLManager.loadedACL(userID) + websitesName = ACLManager.findAllSites(currentACL, userID) + proc = httpProc(request, 'websiteFunctions/createDomain.html', {'websiteList': websitesName, 'phps': PHPManager.findPHPVersions()}) + return proc.render() + def siteState(self, request=None, userID=None, data=None): currentACL = ACLManager.loadedACL(userID)