diff --git a/websiteFunctions/models.py b/websiteFunctions/models.py
index 9e4c8fe82..9f58f118d 100755
--- a/websiteFunctions/models.py
+++ b/websiteFunctions/models.py
@@ -102,7 +102,7 @@ class NormalBackupJobLogs(models.Model):
class wpplugins(models.Model):
- owner = models.ForeignKey(Websites, on_delete=models.CASCADE)
+ owner = models.ForeignKey(Administrator, on_delete=models.CASCADE)
Name = models.CharField(max_length=255, default='')
config = models.TextField()
diff --git a/websiteFunctions/static/websiteFunctions/websiteFunctions.js b/websiteFunctions/static/websiteFunctions/websiteFunctions.js
index 644bb9c53..bf4966f2e 100755
--- a/websiteFunctions/static/websiteFunctions/websiteFunctions.js
+++ b/websiteFunctions/static/websiteFunctions/websiteFunctions.js
@@ -19,10 +19,11 @@ function getCookie(name) {
}
return cookieValue;
}
+
var arry = []
-function selectpluginJs(val) {
- $('#mysearch').hide()
+function selectpluginJs(val) {
+ $('#mysearch').hide()
arry.push(val)
// console.log(arry)
@@ -37,18 +38,29 @@ function selectpluginJs(val) {
}
-app.controller('WPAddNewPlugin', function ($scope, $http, $timeout, $window) {
- $scope.SearchPluginName = function () {
+var DeletePluginURL;
+function DeletePluginBuucket(url) {
+ DeletePluginURL = url;
+}
+
+function FinalDeletePluginBuucket() {
+ window.location.href = DeletePluginURL;
+}
+
+var SPVal;
+app.controller('WPAddNewPlugin', function ($scope, $http, $timeout, $window, $compile) {
+
+ $scope.SearchPluginName = function (val) {
+ SPVal = val;
url = "/websites/SearchOnkeyupPlugin";
var searchcontent = $scope.searchcontent;
-
var data = {
- pluginname : searchcontent
+ pluginname: searchcontent
};
var config = {
@@ -63,23 +75,35 @@ app.controller('WPAddNewPlugin', function ($scope, $http, $timeout, $window) {
function ListInitialDatas(response) {
if (response.data.status === 1) {
- // console.log(response.data);
+ if (SPVal == 'add') {
+ $('#mysearch').show()
+ document.getElementById('mysearch').innerHTML = "";
+ var res = response.data.plugns.plugins
+ // console.log(res);
+ for (i = 0; i <= res.length; i++) {
+ //
+ var tml = '
';
+ $('#mysearch').append(tml);
+ }
+ } else if (SPVal == 'eidt') {
+ $('#mysearch').show()
+ document.getElementById('mysearch').innerHTML = "";
+ var res = response.data.plugns.plugins
+ // console.log(res);
+ for (i = 0; i <= res.length; i++) {
+ //
+ var tml = '
';
+ var temp = $compile(tml)($scope)
+ angular.element(document.getElementById('mysearch')).append(temp);
+ }
+
+ }
- $('#mysearch').show()
- document.getElementById('mysearch').innerHTML = "";
- var res = response.data.plugns.plugins
- // console.log(res);
- for (i = 0; i <= res.length; i++) {
- //
- var tml = '
';
- $('#mysearch').append(tml);
-
- }
} else {
// $scope.errorMessage = response.data.error_message;
- alert("Status not = 1: Error..."+response.data.error_message)
+ alert("Status not = 1: Error..." + response.data.error_message)
}
@@ -87,11 +111,136 @@ app.controller('WPAddNewPlugin', function ($scope, $http, $timeout, $window) {
function cantLoadInitialDatas(response) {
- alert("Error..."+response)
+ alert("Error..." + response)
}
}
+ $scope.AddNewplugin = function () {
+
+ url = "/websites/AddNewpluginAjax";
+
+ var bucketname = $scope.PluginbucketName
+
+ var config = {
+ headers: {
+ 'X-CSRFToken': getCookie('csrftoken')
+ }
+ };
+
+
+ var data = {
+ config: arry,
+ Name: bucketname
+ };
+
+ $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
+
+ function ListInitialDatas(response) {
+
+ if (response.data.status === 1) {
+ alert("added..........");
+ location.reload();
+ } else {
+
+ // $scope.errorMessage = response.data.error_message;
+ alert("Status not = 1: Error..." + response.data.error_message)
+ }
+
+
+ }
+
+ function cantLoadInitialDatas(response) {
+
+ alert("Error..." + response)
+
+ }
+ }
+
+ $scope.deletesPlgin = function (val) {
+
+ url = "/websites/deletesPlgin";
+
+
+ var data = {
+ pluginname: val,
+ pluginbBucketID: $('#pluginbID').html()
+ };
+
+ var config = {
+ headers: {
+ 'X-CSRFToken': getCookie('csrftoken')
+ }
+ };
+
+ $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
+
+
+ function ListInitialDatas(response) {
+
+ if (response.data.status === 1) {
+ location.reload();
+
+ } else {
+
+ // $scope.errorMessage = response.data.error_message;
+ alert("Status not = 1: Error..." + response.data.error_message)
+ }
+
+
+ }
+
+ function cantLoadInitialDatas(response) {
+
+ alert("Error..." + response)
+
+ }
+
+ }
+
+ $scope.Addplugin = function (slug) {
+ $('#mysearch').hide()
+
+ url = "/websites/Addplugineidt";
+
+
+ var data = {
+ pluginname: slug,
+ pluginbBucketID: $('#pluginbID').html()
+ };
+
+ var config = {
+ headers: {
+ 'X-CSRFToken': getCookie('csrftoken')
+ }
+ };
+
+ $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
+
+
+ function ListInitialDatas(response) {
+
+ if (response.data.status === 1) {
+ location.reload();
+
+ } else {
+
+ // $scope.errorMessage = response.data.error_message;
+ alert("Status not = 1: Error..." + response.data.error_message)
+ }
+
+
+ }
+
+ function cantLoadInitialDatas(response) {
+
+ alert("Error..." + response)
+
+ }
+
+
+ }
+
});
@@ -774,8 +923,9 @@ app.controller('listChildDomainsMain', function ($scope, $http, $timeout) {
}
+
var DeleteDomain;
- $scope.deleteDomainInit = function (childDomainForDeletion){
+ $scope.deleteDomainInit = function (childDomainForDeletion) {
DeleteDomain = childDomainForDeletion;
};
@@ -2118,7 +2268,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
var statusFile;
- $scope.WebsiteSelection = function (){
+ $scope.WebsiteSelection = function () {
$scope.DomainCreateForm = false;
};
@@ -2804,7 +2954,7 @@ RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
### End CyberPanel Generated Rules.
`;
-
+
const WWWToNonWWW = `### Rewrite Rules Added by CyberPanel Rewrite Rule Generator
RewriteEngine On
@@ -2831,8 +2981,7 @@ RewriteRule ^(.*)$ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
$scope.rewriteRules = httpToHTTPS + $scope.rewriteRules;
} else if ($scope.rewriteTemplate === "Force NON-WWW -> WWW") {
$scope.rewriteRules = nonWWWToWWW + $scope.rewriteRules;
- }
- else if ($scope.rewriteTemplate === "Force WWW -> NON-WWW") {
+ } else if ($scope.rewriteTemplate === "Force WWW -> NON-WWW") {
$scope.rewriteRules = WWWToNonWWW + $scope.rewriteRules;
}
};
diff --git a/websiteFunctions/templates/websiteFunctions/WPAddNewPlugin.html b/websiteFunctions/templates/websiteFunctions/WPAddNewPlugin.html
index 577080151..3cf925426 100644
--- a/websiteFunctions/templates/websiteFunctions/WPAddNewPlugin.html
+++ b/websiteFunctions/templates/websiteFunctions/WPAddNewPlugin.html
@@ -32,7 +32,7 @@
@@ -56,7 +56,7 @@
| ID + | +File name + | + +Action + | + + +
|---|---|---|
|
+ {{ sub.id }} + + |
+
+ {{ sub.Name }} + |
+
+
+
+ Edit
+
+
+
+
+
+
+
+
+ |
+
+
+