push changes

This commit is contained in:
Michael Ramsey
2019-10-08 10:53:02 -04:00
parent 0695e9c9d0
commit bd71b39d31
1802 changed files with 170876 additions and 50904 deletions

View File

@@ -0,0 +1,934 @@
app.controller('installCageFS', function ($scope, $http, $timeout, $window) {
$scope.installDockerStatus = true;
$scope.installBoxGen = true;
$scope.dockerInstallBTN = false;
$scope.submitCageFSInstall = function () {
$scope.installDockerStatus = false;
$scope.installBoxGen = true;
$scope.dockerInstallBTN = true;
url = "/CloudLinux/submitCageFSInstall";
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.installBoxGen = false;
getRequestStatus();
} else {
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 getRequestStatus() {
$scope.cyberPanelLoading = false;
url = "/serverstatus/switchTOLSWSStatus";
var data = {};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
if (response.data.abort === 0) {
$scope.requestData = response.data.requestStatus;
$timeout(getRequestStatus, 1000);
} else {
// Notifications
$scope.cyberPanelLoading = true;
$timeout.cancel();
$scope.requestData = response.data.requestStatus;
if (response.data.installed === 1) {
$timeout(function () {
$window.location.reload();
}, 3000);
}
}
}
function cantLoadInitialDatas(response) {
$scope.cyberPanelLoading = true;
new PNotify({
title: 'Operation Failed!',
text: 'Could not connect to server, please refresh this page',
type: 'error'
});
}
}
});
app.controller('listWebsitesCage', function ($scope, $http) {
var globalPageNumber;
$scope.getFurtherWebsitesFromDB = function (pageNumber) {
$scope.cyberPanelLoading = false;
globalPageNumber = pageNumber;
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
var data = {page: pageNumber};
dataurl = "/CloudLinux/submitWebsiteListing";
$http.post(dataurl, data, config).then(ListInitialData, cantLoadInitialData);
function ListInitialData(response) {
$scope.cyberPanelLoading = true;
if (response.data.listWebSiteStatus === 1) {
var finalData = JSON.parse(response.data.data);
$scope.WebSitesList = finalData;
$scope.pagination = response.data.pagination;
$scope.default = response.data.default;
$("#listFail").hide();
} else {
$("#listFail").fadeIn();
$scope.errorMessage = response.data.error_message;
console.log(response.data);
}
}
function cantLoadInitialData(response) {
$scope.cyberPanelLoading = true;
console.log("not good");
}
};
$scope.getFurtherWebsitesFromDB(1);
$scope.cyberPanelLoading = true;
$scope.searchWebsites = function () {
$scope.cyberPanelLoading = false;
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
var data = {
patternAdded: $scope.patternAdded
};
dataurl = "/websites/searchWebsites";
$http.post(dataurl, data, config).then(ListInitialData, cantLoadInitialData);
function ListInitialData(response) {
$scope.cyberPanelLoading = true;
if (response.data.listWebSiteStatus === 1) {
var finalData = JSON.parse(response.data.data);
$scope.WebSitesList = finalData;
$("#listFail").hide();
} 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: 'Connect disrupted, refresh the page.',
type: 'error'
});
}
};
$scope.enableOrDisable = function (domain, all, mode, toggle = 0) {
$scope.cyberPanelLoading = false;
url = "/CloudLinux/enableOrDisable";
var data = {
domain: domain,
all: all,
mode: mode,
toggle: toggle
};
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: response.data.success,
type: 'success'
});
if (all === 0) {
$scope.getFurtherWebsitesFromDB(globalPageNumber);
}
} else {
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'
});
}
};
$scope.refreshStatus = function () {
$scope.getFurtherWebsitesFromDB(globalPageNumber);
}
});
app.controller('createCLPackage', function ($scope, $http) {
$scope.cyberPanelLoading = true;
$scope.modifyPackageForm = true;
$scope.toggleView = function () {
$scope.modifyPackageForm = false;
};
$scope.createPackage = function () {
$scope.cyberPanelLoading = false;
url = "/CloudLinux/submitCreatePackage";
var data = {
selectedPackage: $scope.selectedPackage,
name: $scope.name,
SPEED: $scope.SPEED,
VMEM: $scope.VMEM,
PMEM: $scope.PMEM,
IO: $scope.IO,
IOPS: $scope.IOPS,
EP: $scope.EP,
NPROC: $scope.NPROC,
INODESsoft: $scope.INODESsoft,
INODEShard: $scope.INODEShard,
};
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: 'Successfully created.',
type: 'success'
});
} else {
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'
});
}
};
});
app.controller('listCloudLinuxPackages', function ($scope, $http) {
$scope.cyberPanelLoading = true;
$scope.fetchPackageas = function () {
$scope.cyberPanelLoading = false;
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
var data = {};
dataurl = "/CloudLinux/fetchPackages";
$http.post(dataurl, data, config).then(ListInitialData, cantLoadInitialData);
function ListInitialData(response) {
$scope.cyberPanelLoading = true;
if (response.data.status === 1) {
$scope.packages = 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.fetchPackageas();
$scope.deleteCLPackage = function (name) {
$scope.cyberPanelLoading = false;
url = "/CloudLinux/deleteCLPackage";
var data = {
name: name
};
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: 'Successfully deleted.',
type: 'success'
});
$scope.fetchPackageas();
} else {
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'
});
}
};
$scope.populatePackage = function (name, speed, vmem, pmem, io, iops, ep, nproc, inodessoft, inodeshard) {
$scope.name = name;
$scope.SPEED = speed;
$scope.VMEM = vmem;
$scope.PMEM = pmem;
$scope.IO = io;
$scope.IOPS = iops;
$scope.EP = ep;
$scope.NPROC = nproc;
$scope.inodessoft = inodessoft;
$scope.inodeshard = inodeshard;
};
$scope.saveSettings = function () {
$scope.cyberPanelLoading = false;
url = "/CloudLinux/saveSettings";
var data = {
name: $scope.name,
SPEED: $scope.SPEED,
VMEM: $scope.VMEM,
PMEM: $scope.PMEM,
IO: $scope.IO,
IOPS: $scope.IOPS,
EP: $scope.EP,
NPROC: $scope.NPROC,
INODESsoft: $scope.inodessoft,
INODEShard: $scope.inodeshard,
};
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: 'Changes successfully applied.',
type: 'success'
});
$scope.fetchPackageas();
} else {
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'
});
}
};
});
app.controller('websiteContainerLimitCL', function ($scope, $http, $timeout, $window) {
// Get CPU Usage of User
var cpu = [];
var dataset;
var totalPoints = 100;
var updateInterval = 1000;
var now = new Date().getTime();
var options = {
series: {
lines: {
lineWidth: 1.2
},
bars: {
align: "center",
fillColor: {colors: [{opacity: 1}, {opacity: 1}]},
barWidth: 500,
lineWidth: 1
}
},
xaxis: {
mode: "time",
tickSize: [5, "second"],
tickFormatter: function (v, axis) {
var date = new Date(v);
if (date.getSeconds() % 20 == 0) {
var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
return hours + ":" + minutes + ":" + seconds;
} else {
return "";
}
},
axisLabel: "Time",
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: 'Verdana, Arial',
axisLabelPadding: 10
},
yaxes: [
{
min: 0,
max: 100,
tickSize: 5,
tickFormatter: function (v, axis) {
if (v % 10 == 0) {
return v + "%";
} else {
return "";
}
},
axisLabel: "CPU loading",
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: 'Verdana, Arial',
axisLabelPadding: 6
}, {
max: 5120,
position: "right",
axisLabel: "Disk",
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: 'Verdana, Arial',
axisLabelPadding: 6
}
],
legend: {
noColumns: 0,
position: "nw"
},
grid: {
backgroundColor: {colors: ["#ffffff", "#EDF5FF"]}
}
};
function initData() {
for (var i = 0; i < totalPoints; i++) {
var temp = [now += updateInterval, 0];
cpu.push(temp);
}
}
function GetData() {
var data = {
domain: $("#domain").text()
};
$.ajaxSetup({cache: false});
$.ajax({
url: "/CloudLinux/getUsageData",
dataType: 'json',
success: update,
type: "POST",
headers: {'X-CSRFToken': getCookie('csrftoken')},
contentType: "application/json",
data: JSON.stringify(data), // Our valid JSON string
error: function () {
setTimeout(GetData, updateInterval);
}
});
}
var temp;
function update(_data) {
cpu.shift();
now += updateInterval;
temp = [now, _data.cpu];
cpu.push(temp);
dataset = [
{label: "CPU:" + _data.cpu + "%", data: cpu, lines: {fill: true, lineWidth: 1.2}, color: "#00FF00"}
];
$.plot($("#flot-placeholder1"), dataset, options);
setTimeout(GetData, updateInterval);
}
// Memory Usage of User
var memory = [];
var datasetMemory;
var totalPointsMemory = 100;
var updateIntervalMemory = 1000;
var nowMemory = new Date().getTime();
var optionsMemory = {
series: {
lines: {
lineWidth: 1.2
},
bars: {
align: "center",
fillColor: {colors: [{opacity: 1}, {opacity: 1}]},
barWidth: 500,
lineWidth: 1
}
},
xaxis: {
mode: "time",
tickSize: [5, "second"],
tickFormatter: function (v, axis) {
var date = new Date(v);
if (date.getSeconds() % 20 == 0) {
var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
return hours + ":" + minutes + ":" + seconds;
} else {
return "";
}
},
axisLabel: "Time",
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: 'Verdana, Arial',
axisLabelPadding: 10
},
yaxes: [
{
min: 0,
max: $scope.memory,
tickSize: 5,
tickFormatter: function (v, axis) {
if (v % 10 == 0) {
return v + "MB";
} else {
return "";
}
},
axisLabel: "CPU loading",
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: 'Verdana, Arial',
axisLabelPadding: 6
}, {
max: 5120,
position: "right",
axisLabel: "Disk",
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: 'Verdana, Arial',
axisLabelPadding: 6
}
],
legend: {
noColumns: 0,
position: "nw"
},
grid: {
backgroundColor: {colors: ["#ffffff", "#EDF5FF"]}
}
};
function initDataMemory() {
for (var i = 0; i < totalPointsMemory; i++) {
var temp = [nowMemory += updateIntervalMemory, 0];
memory.push(temp);
}
}
function GetDataMemory() {
var data = {
domain: $("#domain").text(),
type: 'memory'
};
$.ajaxSetup({cache: false});
$.ajax({
url: "/CloudLinux/getUsageData",
dataType: 'json',
headers: {'X-CSRFToken': getCookie('csrftoken')},
success: updateMemory,
type: "POST",
contentType: "application/json",
data: JSON.stringify(data), // Our valid JSON string
error: function () {
setTimeout(GetDataMemory, updateIntervalMemory);
}
});
}
var tempMemory;
function updateMemory(_data) {
memory.shift();
nowMemory += updateIntervalMemory;
tempMemory = [nowMemory, _data.memory];
memory.push(tempMemory);
datasetMemory = [
{
label: "Memory:" + _data.memory + "MB",
data: memory,
lines: {fill: true, lineWidth: 1.2},
color: "#00FF00"
}
];
$.plot($("#memoryUsage"), datasetMemory, optionsMemory);
setTimeout(GetDataMemory, updateIntervalMemory);
}
// Disk Usage
var readRate = [], writeRate = [];
var datasetDisk;
var totalPointsDisk = 100;
var updateIntervalDisk = 5000;
var now = new Date().getTime();
var optionsDisk = {
series: {
lines: {
lineWidth: 1.2
},
bars: {
align: "center",
fillColor: {colors: [{opacity: 1}, {opacity: 1}]},
barWidth: 500,
lineWidth: 1
}
},
xaxis: {
mode: "time",
tickSize: [30, "second"],
tickFormatter: function (v, axis) {
var date = new Date(v);
if (date.getSeconds() % 20 == 0) {
var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
return hours + ":" + minutes + ":" + seconds;
} else {
return "";
}
},
axisLabel: "Time",
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: 'Verdana, Arial',
axisLabelPadding: 10
},
yaxes: [
{
min: 0,
max: $scope.networkSpeed,
tickSize: 5,
tickFormatter: function (v, axis) {
if (v % 10 == 0) {
return v + "mb/sec";
} else {
return "";
}
},
axisLabel: "CPU loading",
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: 'Verdana, Arial',
axisLabelPadding: 6
}, {
max: 5120,
position: "right",
axisLabel: "Disk",
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: 'Verdana, Arial',
axisLabelPadding: 6
}
],
legend: {
noColumns: 0,
position: "nw"
},
grid: {
backgroundColor: {colors: ["#ffffff", "#EDF5FF"]}
}
};
function initDataDisk() {
for (var i = 0; i < totalPointsDisk; i++) {
var temp = [now += updateIntervalDisk, 0];
readRate.push(temp);
writeRate.push(temp);
}
}
function GetDataDisk() {
var data = {
domain: $("#domain").text(),
type: 'io'
};
$.ajaxSetup({cache: false});
$.ajax({
url: "/CloudLinux/getUsageData",
dataType: 'json',
headers: {'X-CSRFToken': getCookie('csrftoken')},
success: updateDisk,
type: "POST",
contentType: "application/json",
data: JSON.stringify(data), // Our valid JSON string
error: function () {
setTimeout(GetDataMemory, updateIntervalMemory);
}
});
}
var tempDisk;
function updateDisk(_data) {
readRate.shift();
writeRate.shift();
now += updateIntervalDisk;
tempDisk = [now, _data.readRate];
readRate.push(tempDisk);
tempDisk = [now, _data.readRate];
writeRate.push(tempDisk);
datasetDisk = [
{
label: "Read IO/s " + _data.readRate + " mb/s ",
data: readRate,
lines: {fill: true, lineWidth: 1.2},
color: "#00FF00"
},
{
label: "Write IO/s " + _data.writeRate + " mb/s ",
data: writeRate,
lines: {lineWidth: 1.2},
color: "#FF0000"
}
];
$.plot($("#diskUsage"), datasetDisk, optionsDisk);
setTimeout(GetDataDisk, updateIntervalDisk);
}
$(document).ready(function () {
// Report Memory Usage
initDataMemory();
datasetMemory = [
{label: "Memory", data: memory, lines: {fill: true, lineWidth: 1.2}, color: "#00FF00"}
];
$.plot($("#memoryUsage"), datasetMemory, optionsMemory);
setTimeout(GetDataMemory, updateIntervalMemory);
// Report CPU Usage
initData();
dataset = [
{label: "CPU", data: cpu, lines: {fill: true, lineWidth: 1.2}, color: "#00FF00"}
];
$.plot($("#flot-placeholder1"), dataset, options);
setTimeout(GetData, updateInterval);
// Report Disk Usage
initDataDisk();
datasetDisk = [
{label: "Read IO/s: ", data: readRate, lines: {fill: true, lineWidth: 1.2}, color: "#00FF00"},
{label: "Write IO/s: ", data: writeRate, color: "#0044FF", bars: {show: true}, yaxis: 2}
];
$.plot($("#diskUsage"), datasetDisk, optionsDisk);
setTimeout(GetDataDisk, updateIntervalDisk);
});
});

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -0,0 +1,10 @@
/*!
Author : Hunter Perrin
Version : 3.2.0
Link : http://sciactive.com/pnotify/
*/.ui-pnotify{top:36px;right:36px;position:absolute;height:auto;z-index:2}body>.ui-pnotify{position:fixed;z-index:100040}.ui-pnotify-modal-overlay{background-color:rgba(0,0,0,.4);top:0;left:0;position:absolute;height:100%;width:100%;z-index:1}body>.ui-pnotify-modal-overlay{position:fixed;z-index:100039}.ui-pnotify.ui-pnotify-in{display:block!important}.ui-pnotify.ui-pnotify-move{transition:left .5s ease,top .5s ease,right .5s ease,bottom .5s ease}.ui-pnotify.ui-pnotify-fade-slow{transition:opacity .4s linear;opacity:0}.ui-pnotify.ui-pnotify-fade-slow.ui-pnotify.ui-pnotify-move{transition:opacity .4s linear,left .5s ease,top .5s ease,right .5s ease,bottom .5s ease}.ui-pnotify.ui-pnotify-fade-normal{transition:opacity .25s linear;opacity:0}.ui-pnotify.ui-pnotify-fade-normal.ui-pnotify.ui-pnotify-move{transition:opacity .25s linear,left .5s ease,top .5s ease,right .5s ease,bottom .5s ease}.ui-pnotify.ui-pnotify-fade-fast{transition:opacity .1s linear;opacity:0}.ui-pnotify.ui-pnotify-fade-fast.ui-pnotify.ui-pnotify-move{transition:opacity .1s linear,left .5s ease,top .5s ease,right .5s ease,bottom .5s ease}.ui-pnotify.ui-pnotify-fade-in{opacity:1}.ui-pnotify .ui-pnotify-shadow{-webkit-box-shadow:0 6px 28px 0 rgba(0,0,0,.1);-moz-box-shadow:0 6px 28px 0 rgba(0,0,0,.1);box-shadow:0 6px 28px 0 rgba(0,0,0,.1)}.ui-pnotify-container{background-position:0 0;padding:.8em;height:100%;margin:0}.ui-pnotify-container:after{content:" ";visibility:hidden;display:block;height:0;clear:both}.ui-pnotify-container.ui-pnotify-sharp{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.ui-pnotify-title{display:block;margin-bottom:.4em;margin-top:0}.ui-pnotify-text{display:block}.ui-pnotify-icon,.ui-pnotify-icon span{display:block;float:left;margin-right:.2em}.ui-pnotify.stack-bottomleft,.ui-pnotify.stack-topleft{left:25px;right:auto}.ui-pnotify.stack-bottomleft,.ui-pnotify.stack-bottomright{bottom:25px;top:auto}.ui-pnotify.stack-modal{left:50%;right:auto;margin-left:-150px}
.brighttheme{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.brighttheme.ui-pnotify-container{padding:18px}.brighttheme .ui-pnotify-title{margin-bottom:12px}.brighttheme-notice{background-color:#ffffa2;border:0 solid #ff0;color:#4f4f00}.brighttheme-info{background-color:#8fcedd;border:0 solid #0286a5;color:#012831}.brighttheme-success{background-color:#aff29a;border:0 solid #35db00;color:#104300}.brighttheme-error{background-color:#ffaba2;background-image:repeating-linear-gradient(135deg,transparent,transparent 35px,rgba(255,255,255,.3) 35px,rgba(255,255,255,.3) 70px);border:0 solid #ff1800;color:#4f0800}.brighttheme-icon-closer,.brighttheme-icon-info,.brighttheme-icon-notice,.brighttheme-icon-sticker,.brighttheme-icon-success{position:relative;width:16px;height:16px;font-size:12px;font-weight:700;line-height:16px;font-family:"Courier New",Courier,monospace;border-radius:50%}.brighttheme-icon-closer:after,.brighttheme-icon-info:after,.brighttheme-icon-notice:after,.brighttheme-icon-sticker:after,.brighttheme-icon-success:after{position:absolute;top:0;left:4px}.brighttheme-icon-notice{background-color:#2e2e00;color:#ffffa2;margin-top:2px}.brighttheme-icon-notice:after{content:"!"}.brighttheme-icon-info{background-color:#012831;color:#8fcedd;margin-top:2px}.brighttheme-icon-info:after{content:"i"}.brighttheme-icon-success{background-color:#104300;color:#aff29a;margin-top:2px}.brighttheme-icon-success:after{content:"\002713"}.brighttheme-icon-error{position:relative;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:16px solid #2e0400;font-size:0;line-height:0;color:#ffaba2;margin-top:1px}.brighttheme-icon-error:after{position:absolute;top:1px;left:-4px;font-size:12px;font-weight:700;line-height:16px;font-family:"Courier New",Courier,monospace;content:"!"}.brighttheme-icon-closer,.brighttheme-icon-sticker{display:inline-block}.brighttheme-icon-closer:after{top:-4px;content:"\002715"}.brighttheme-icon-sticker:after{top:-5px;content:"\01D1BC";-moz-transform:rotate(-90deg);-webkit-transform:rotate(-90deg);-o-transform:rotate(-90deg);-ms-transform:rotate(-90deg);transform:rotate(-90deg)}.brighttheme-icon-sticker.brighttheme-icon-stuck:after{-moz-transform:rotate(180deg);-webkit-transform:rotate(180deg);-o-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.brighttheme .ui-pnotify-action-bar{padding-top:12px}.brighttheme .ui-pnotify-action-bar input,.brighttheme .ui-pnotify-action-bar textarea{display:block;width:100%;margin-bottom:12px!important}.brighttheme .ui-pnotify-action-button{text-transform:uppercase;font-weight:700;padding:4px 8px;border:none;background:0 0}.brighttheme .ui-pnotify-action-button.btn-primary{border:none;border-radius:0}.brighttheme-notice .ui-pnotify-action-button.btn-primary{background-color:#ff0;color:#4f4f00}.brighttheme-info .ui-pnotify-action-button.btn-primary{background-color:#0286a5;color:#012831}.brighttheme-success .ui-pnotify-action-button.btn-primary{background-color:#35db00;color:#104300}.brighttheme-error .ui-pnotify-action-button.btn-primary{background-color:#ff1800;color:#4f0800}
.ui-pnotify-closer,.ui-pnotify-sticker{float:right;margin-left:.2em}
.ui-pnotify-history-container{position:absolute;top:0;right:18px;width:70px;border-top:none;padding:0;-webkit-border-top-left-radius:0;-moz-border-top-left-radius:0;border-top-left-radius:0;-webkit-border-top-right-radius:0;-moz-border-top-right-radius:0;border-top-right-radius:0;z-index:10000}.ui-pnotify-history-container.ui-pnotify-history-fixed{position:fixed}.ui-pnotify-history-container .ui-pnotify-history-header{padding:2px;text-align:center}.ui-pnotify-history-container button{cursor:pointer;display:block;width:100%}.ui-pnotify-history-container .ui-pnotify-history-pulldown{display:block;margin:0 auto}.ui-pnotify-history-brighttheme{background-color:#8fcedd;border:0 solid #0286a5;color:#012831}.ui-pnotify-history-brighttheme button{text-transform:uppercase;font-weight:700;padding:4px 8px;border:none;background:0 0}.ui-pnotify-history-brighttheme .ui-pnotify-history-pulldown::after{display:block;font-size:16px;line-height:14px;padding-bottom:4px;content:"⌄";text-align:center;font-weight:700;font-family:Arial,sans-serif}
.ui-pnotify-container{position:relative;left:0}@media (max-width:480px){.ui-pnotify-mobile-able.ui-pnotify{position:fixed;top:0;right:0;left:0;width:auto!important;font-size:1.2em;-webkit-font-smoothing:antialiased;-moz-font-smoothing:antialiased;-ms-font-smoothing:antialiased;font-smoothing:antialiased}.ui-pnotify-mobile-able.ui-pnotify .ui-pnotify-shadow{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;border-bottom-width:5px}.ui-pnotify-mobile-able .ui-pnotify-container{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.ui-pnotify-mobile-able.ui-pnotify.stack-bottomleft,.ui-pnotify-mobile-able.ui-pnotify.stack-topleft{left:0;right:0}.ui-pnotify-mobile-able.ui-pnotify.stack-bottomleft,.ui-pnotify-mobile-able.ui-pnotify.stack-bottomright{left:0;right:0;bottom:0;top:auto}.ui-pnotify-mobile-able.ui-pnotify.stack-bottomleft .ui-pnotify-shadow,.ui-pnotify-mobile-able.ui-pnotify.stack-bottomright .ui-pnotify-shadow{border-top-width:5px;border-bottom-width:1px}}
.ui-pnotify.ui-pnotify-nonblock-fade{opacity:.2}.ui-pnotify.ui-pnotify-nonblock-hide{display:none!important}

File diff suppressed because one or more lines are too long

View File

@@ -22,6 +22,16 @@ function getCookie(name) {
return cookieValue;
}
function randomPassword(length) {
var chars = "abcdefghijklmnopqrstuvwxyz!@#%^*-+ABCDEFGHIJKLMNOP1234567890";
var pass = "";
for (var x = 0; x < length; x++) {
var i = Math.floor(Math.random() * chars.length);
pass += chars.charAt(i);
}
return pass;
}
/* Utilities ends here */
@@ -41,7 +51,7 @@ app.filter('getwebsitename', function() {
if(domain !== undefined) {
domain = domain.replace("-", "");
domain = domain.replace(/-/g, '');
var domainName = domain.split(".");
@@ -70,16 +80,13 @@ app.controller('systemStatusInfo', function($scope,$http,$timeout) {
function ListInitialData(response) {
$scope.cpuUsage = response.data.cpuUsage;
$scope.ramUsage = response.data.ramUsage;
$scope.diskUsage = response.data.diskUsage;
}
function cantLoadInitialData(response) {
console.log("not good");
}
function cantLoadInitialData(response) {}
//$timeout(getStuff, 2000);
@@ -103,52 +110,209 @@ app.controller('adminController', function($scope,$http,$timeout) {
function ListInitialData(response) {
$scope.currentAdmin = response.data.user_name;
$scope.currentAdmin = response.data.adminName;
$scope.admin_type = response.data.admin_type;
$("#serverIPAddress").text(response.data.serverIPAddress);
if (response.data.admin_type !== "Administrator")
{
if (response.data.admin === 0) {
$('.serverACL').hide();
if(response.data.admin_type !== "Reseller") {
$("#normalUser").hide();
$("#normalUserA").hide();
$("#normalUserB").hide();
if(!Boolean(response.data.versionManagement)){
$('.versionManagement').hide();
}
// User Management
if(!Boolean(response.data.createNewUser)){
$('.createNewUser').hide();
}
if(!Boolean(response.data.listUsers)){
$('.listUsers').hide();
}
if(!Boolean(response.data.resellerCenter)){
$('.resellerCenter').hide();
}
if(!Boolean(response.data.deleteUser)){
$('.deleteUser').hide();
}
if(!Boolean(response.data.changeUserACL)){
$('.changeUserACL').hide();
}
// Website Management
if(!Boolean(response.data.createWebsite)){
$('.createWebsite').hide();
}
if(!Boolean(response.data.modifyWebsite)){
$('.modifyWebsite').hide();
}
if(!Boolean(response.data.suspendWebsite)){
$('.suspendWebsite').hide();
}
if(!Boolean(response.data.deleteWebsite)){
$('.deleteWebsite').hide();
}
$("#normalUserC").hide();
$("#normalUserD").hide();
$("#normalUserE").hide();
$("#normalUserF").hide();
$("#normalUserG").hide();
$("#normalUserH").hide();
$("#normalUserP").hide();
$("#normalUserI").hide();
// Package Management
$("#ssl").hide();
$("#sslA").hide();
$("#siteState").hide();
if(!Boolean(response.data.createPackage)){
$('.createPackage').hide();
}
$("#restoreSite").hide();
$("#backupDestinations").hide();
$("#scheduleBackup").hide();
if(!Boolean(response.data.listPackages)){
$('.listPackages').hide();
}
$("#remoteBackups").hide();
$("#packageHome").hide();
$("#packageSub").hide();
$("#createWebsite").hide();
$("#modifyWebSite").hide();
$("#deleteWebsite").hide();
$("#versionManagement").hide();
if(!Boolean(response.data.deletePackage)){
$('.deletePackage').hide();
}
}
if(!Boolean(response.data.modifyPackage)){
$('.modifyPackage').hide();
}
// Database Management
if(!Boolean(response.data.createDatabase)){
$('.createDatabase').hide();
}
if(!Boolean(response.data.deleteDatabase)){
$('.deleteDatabase').hide();
}
if(!Boolean(response.data.listDatabases)){
$('.listDatabases').hide();
}
// DNS Management
if(!Boolean(response.data.dnsAsWhole)){
$('.dnsAsWhole').hide();
}
if(!Boolean(response.data.createNameServer)){
$('.createNameServer').hide();
}
if(!Boolean(response.data.createDNSZone)){
$('.createDNSZone').hide();
}
if(!Boolean(response.data.deleteZone)){
$('.addDeleteRecords').hide();
}
if(!Boolean(response.data.addDeleteRecords)){
$('.deleteDatabase').hide();
}
// Email Management
if(!Boolean(response.data.emailAsWhole)){
$('.emailAsWhole').hide();
}
if(!Boolean(response.data.listEmails)){
$('.listEmails').hide();
}
if(!Boolean(response.data.createEmail)){
$('.createEmail').hide();
}
if(!Boolean(response.data.deleteEmail)){
$('.deleteEmail').hide();
}
if(!Boolean(response.data.emailForwarding)){
$('.emailForwarding').hide();
}
if(!Boolean(response.data.changeEmailPassword)){
$('.changeEmailPassword').hide();
}
if(!Boolean(response.data.dkimManager)){
$('.dkimManager').hide();
}
// FTP Management
if(!Boolean(response.data.ftpAsWhole)){
$('.ftpAsWhole').hide();
}
if(!Boolean(response.data.createFTPAccount)){
$('.createFTPAccount').hide();
}
if(!Boolean(response.data.deleteFTPAccount)){
$('.deleteFTPAccount').hide();
}
if(!Boolean(response.data.listFTPAccounts)){
$('.listFTPAccounts').hide();
}
// Backup Management
if(!Boolean(response.data.createBackup)){
$('.createBackup').hide();
}
if(!Boolean(response.data.restoreBackup)){
$('.restoreBackup').hide();
}
if(!Boolean(response.data.addDeleteDestinations)){
$('.addDeleteDestinations').hide();
}
if(!Boolean(response.data.scheDuleBackups)){
$('.scheDuleBackups').hide();
}
if(!Boolean(response.data.remoteBackups)){
$('.remoteBackups').hide();
}
// SSL Management
if(!Boolean(response.data.manageSSL)){
$('.manageSSL').hide();
}
if(!Boolean(response.data.hostnameSSL)){
$('.hostnameSSL').hide();
}
if(!Boolean(response.data.mailServerSSL)){
$('.mailServerSSL').hide();
}
}else{
if(!Boolean(response.data.emailAsWhole)){
$('.emailAsWhole').hide();
}
if(!Boolean(response.data.ftpAsWhole)){
$('.ftpAsWhole').hide();
}
if(!Boolean(response.data.dnsAsWhole)){
$('.dnsAsWhole').hide();
}
}
}
function cantLoadInitialData(response) {
console.log("not good");
}
function cantLoadInitialData(response) {}
});

View File

@@ -0,0 +1,649 @@
app.controller('installContainer', function ($scope, $http, $timeout, $window) {
$scope.installDockerStatus = true;
$scope.installBoxGen = true;
$scope.dockerInstallBTN = false;
$scope.submitContainerInstall = function () {
$scope.installDockerStatus = false;
$scope.installBoxGen = true;
$scope.dockerInstallBTN = true;
url = "/container/submitContainerInstall";
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.installBoxGen = false;
getRequestStatus();
}
else {
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 getRequestStatus() {
$scope.cyberPanelLoading = false;
url = "/serverstatus/switchTOLSWSStatus";
var data = {};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
if (response.data.abort === 0) {
$scope.requestData = response.data.requestStatus;
$timeout(getRequestStatus, 1000);
}
else {
// Notifications
$scope.cyberPanelLoading = true;
$timeout.cancel();
$scope.requestData = response.data.requestStatus;
if (response.data.installed === 1) {
$timeout(function () {
$window.location.reload();
}, 3000);
}
}
}
function cantLoadInitialDatas(response) {
$scope.cyberPanelLoading = true;
new PNotify({
title: 'Operation Failed!',
text: 'Could not connect to server, please refresh this page',
type: 'error'
});
}
}
});
app.controller('websiteContainerLimit', function ($scope, $http, $timeout, $window) {
// Get CPU Usage of User
var cpu = [];
var dataset;
var totalPoints = 100;
var updateInterval = 1000;
var now = new Date().getTime();
var options = {
series: {
lines: {
lineWidth: 1.2
},
bars: {
align: "center",
fillColor: {colors: [{opacity: 1}, {opacity: 1}]},
barWidth: 500,
lineWidth: 1
}
},
xaxis: {
mode: "time",
tickSize: [5, "second"],
tickFormatter: function (v, axis) {
var date = new Date(v);
if (date.getSeconds() % 20 == 0) {
var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
return hours + ":" + minutes + ":" + seconds;
} else {
return "";
}
},
axisLabel: "Time",
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: 'Verdana, Arial',
axisLabelPadding: 10
},
yaxes: [
{
min: 0,
max: 100,
tickSize: 5,
tickFormatter: function (v, axis) {
if (v % 10 == 0) {
return v + "%";
} else {
return "";
}
},
axisLabel: "CPU loading",
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: 'Verdana, Arial',
axisLabelPadding: 6
}, {
max: 5120,
position: "right",
axisLabel: "Disk",
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: 'Verdana, Arial',
axisLabelPadding: 6
}
],
legend: {
noColumns: 0,
position: "nw"
},
grid: {
backgroundColor: {colors: ["#ffffff", "#EDF5FF"]}
}
};
function initData() {
for (var i = 0; i < totalPoints; i++) {
var temp = [now += updateInterval, 0];
cpu.push(temp);
}
}
function GetData() {
var data = {
domain: $("#domain").text()
};
$.ajaxSetup({cache: false});
$.ajax({
url: "/container/getUsageData",
dataType: 'json',
success: update,
type: "POST",
headers: { 'X-CSRFToken': getCookie('csrftoken') },
contentType: "application/json",
data: JSON.stringify(data), // Our valid JSON string
error: function () {
setTimeout(GetData, updateInterval);
}
});
}
var temp;
function update(_data) {
cpu.shift();
now += updateInterval;
temp = [now, _data.cpu];
cpu.push(temp);
dataset = [
{label: "CPU:" + _data.cpu + "%", data: cpu, lines: {fill: true, lineWidth: 1.2}, color: "#00FF00"}
];
$.plot($("#flot-placeholder1"), dataset, options);
setTimeout(GetData, updateInterval);
}
// Memory Usage of User
var memory = [];
var datasetMemory;
var totalPointsMemory = 100;
var updateIntervalMemory = 1000;
var nowMemory = new Date().getTime();
var optionsMemory = {
series: {
lines: {
lineWidth: 1.2
},
bars: {
align: "center",
fillColor: {colors: [{opacity: 1}, {opacity: 1}]},
barWidth: 500,
lineWidth: 1
}
},
xaxis: {
mode: "time",
tickSize: [5, "second"],
tickFormatter: function (v, axis) {
var date = new Date(v);
if (date.getSeconds() % 20 == 0) {
var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
return hours + ":" + minutes + ":" + seconds;
} else {
return "";
}
},
axisLabel: "Time",
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: 'Verdana, Arial',
axisLabelPadding: 10
},
yaxes: [
{
min: 0,
max: $scope.memory,
tickSize: 5,
tickFormatter: function (v, axis) {
if (v % 10 == 0) {
return v + "MB";
} else {
return "";
}
},
axisLabel: "CPU loading",
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: 'Verdana, Arial',
axisLabelPadding: 6
}, {
max: 5120,
position: "right",
axisLabel: "Disk",
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: 'Verdana, Arial',
axisLabelPadding: 6
}
],
legend: {
noColumns: 0,
position: "nw"
},
grid: {
backgroundColor: {colors: ["#ffffff", "#EDF5FF"]}
}
};
function initDataMemory() {
for (var i = 0; i < totalPointsMemory; i++) {
var temp = [nowMemory += updateIntervalMemory, 0];
memory.push(temp);
}
}
function GetDataMemory() {
var data = {
domain: $("#domain").text(),
type: 'memory'
};
$.ajaxSetup({cache: false});
$.ajax({
url: "/container/getUsageData",
dataType: 'json',
headers: { 'X-CSRFToken': getCookie('csrftoken') },
success: updateMemory,
type: "POST",
contentType: "application/json",
data: JSON.stringify(data), // Our valid JSON string
error: function () {
setTimeout(GetDataMemory, updateIntervalMemory);
}
});
}
var tempMemory;
function updateMemory(_data) {
memory.shift();
nowMemory += updateIntervalMemory;
tempMemory = [nowMemory, _data.memory];
memory.push(tempMemory);
datasetMemory = [
{
label: "Memory:" + _data.memory + "MB",
data: memory,
lines: {fill: true, lineWidth: 1.2},
color: "#00FF00"
}
];
$.plot($("#memoryUsage"), datasetMemory, optionsMemory);
setTimeout(GetDataMemory, updateIntervalMemory);
}
// Disk Usage
var readRate = [], writeRate = [];
var datasetDisk;
var totalPointsDisk = 100;
var updateIntervalDisk = 5000;
var now = new Date().getTime();
var optionsDisk = {
series: {
lines: {
lineWidth: 1.2
},
bars: {
align: "center",
fillColor: {colors: [{opacity: 1}, {opacity: 1}]},
barWidth: 500,
lineWidth: 1
}
},
xaxis: {
mode: "time",
tickSize: [30, "second"],
tickFormatter: function (v, axis) {
var date = new Date(v);
if (date.getSeconds() % 20 == 0) {
var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
return hours + ":" + minutes + ":" + seconds;
} else {
return "";
}
},
axisLabel: "Time",
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: 'Verdana, Arial',
axisLabelPadding: 10
},
yaxes: [
{
min: 0,
max: $scope.networkSpeed,
tickSize: 5,
tickFormatter: function (v, axis) {
if (v % 10 == 0) {
return v + "mb/sec";
} else {
return "";
}
},
axisLabel: "CPU loading",
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: 'Verdana, Arial',
axisLabelPadding: 6
}, {
max: 5120,
position: "right",
axisLabel: "Disk",
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: 'Verdana, Arial',
axisLabelPadding: 6
}
],
legend: {
noColumns: 0,
position: "nw"
},
grid: {
backgroundColor: {colors: ["#ffffff", "#EDF5FF"]}
}
};
function initDataDisk() {
for (var i = 0; i < totalPointsDisk; i++) {
var temp = [now += updateIntervalDisk, 0];
readRate.push(temp);
writeRate.push(temp);
}
}
function GetDataDisk() {
var data = {
domain: $("#domain").text(),
type: 'io'
};
$.ajaxSetup({cache: false});
$.ajax({
url: "/container/getUsageData",
dataType: 'json',
headers: { 'X-CSRFToken': getCookie('csrftoken') },
success: updateDisk,
type: "POST",
contentType: "application/json",
data: JSON.stringify(data), // Our valid JSON string
error: function () {
setTimeout(GetDataMemory, updateIntervalMemory);
}
});
}
var tempDisk;
function updateDisk(_data) {
readRate.shift();
writeRate.shift();
now += updateIntervalDisk;
tempDisk = [now, _data.readRate];
readRate.push(tempDisk);
tempDisk = [now, _data.readRate];
writeRate.push(tempDisk);
datasetDisk = [
{label: "Read IO/s " + _data.readRate + " mb/s ", data: readRate, lines: {fill: true, lineWidth: 1.2}, color: "#00FF00"},
{label: "Write IO/s " + _data.writeRate + " mb/s ", data: writeRate, lines: {lineWidth: 1.2}, color: "#FF0000"}
];
$.plot($("#diskUsage"), datasetDisk, optionsDisk);
setTimeout(GetDataDisk, updateIntervalDisk);
}
$(document).ready(function () {
initDataDisk();
datasetDisk = [
{label: "Read IO/s: ", data: readRate, lines: {fill: true, lineWidth: 1.2}, color: "#00FF00"},
{label: "Write IO/s: ", data: writeRate, color: "#0044FF", bars: {show: true}, yaxis: 2}
];
$.plot($("#diskUsage"), datasetDisk, optionsDisk);
setTimeout(GetDataDisk, updateIntervalDisk);
});
////
$scope.cyberPanelLoading = true;
$scope.limitsInfoBox = true;
$scope.fetchWebsiteLimits = function () {
$scope.cyberPanelLoading = false;
url = "/container/fetchWebsiteLimits";
var data = {
'domain': $("#domain").text()
};
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.cpuPers = response.data.cpuPers;
$scope.IO = response.data.IO;
$scope.IOPS = response.data.IOPS;
$scope.memory = response.data.memory;
$scope.networkSpeed = response.data.networkSpeed;
if (response.data.enforce === 0) {
$scope.limitsInfoBox = false;
} else {
$scope.limitsInfoBox = true;
}
// Report Memory Usage
initDataMemory();
datasetMemory = [
{label: "Memory", data: memory, lines: {fill: true, lineWidth: 1.2}, color: "#00FF00"}
];
$.plot($("#memoryUsage"), datasetMemory, optionsMemory);
setTimeout(GetDataMemory, updateIntervalMemory);
// Report CPU Usage
initData();
dataset = [
{label: "CPU", data: cpu, lines: {fill: true, lineWidth: 1.2}, color: "#00FF00"}
];
$.plot($("#flot-placeholder1"), dataset, options);
setTimeout(GetData, updateInterval);
}
else {
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'
});
}
};
$scope.fetchWebsiteLimits();
$scope.saveWebsiteLimits = function () {
$scope.cyberPanelLoading = false;
url = "/container/saveWebsiteLimits";
var data = {
'domain': $("#domain").text(),
'cpuPers': $scope.cpuPers,
'IO': $scope.IO,
'IOPS': $scope.IOPS,
'memory': $scope.memory,
'networkSpeed': $scope.networkSpeedBox,
'networkHandle': $scope.networkHandle,
'enforce': $scope.enforce
};
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: 'Changes successfully applied.',
type: 'success'
});
$scope.fetchWebsiteLimits();
}
else {
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'
});
}
};
});

View File

@@ -3,113 +3,114 @@
*/
/* Java script code to create database */
app.controller('createDatabase', function($scope,$http) {
app.controller('createDatabase', function ($scope, $http) {
$scope.createDatabaseLoading = true;
$scope.dbDetails = true;
$scope.databaseCreationFailed = true;
$scope.databaseCreated = true;
$scope.couldNotConnect = true;
$scope.generatedPasswordView = true;
$scope.showDetailsBoxes = function(){
$scope.showDetailsBoxes = function () {
$scope.dbDetails = false;
};
$scope.createDatabase = function () {
$scope.createDatabase = function(){
$scope.createDatabaseLoading = false;
$scope.dbDetails = false;
$scope.databaseCreationFailed = true;
$scope.databaseCreated = true;
$scope.couldNotConnect = true;
$scope.createDatabaseLoading = false;
var databaseWebsite = $scope.databaseWebsite;
var dbName = $scope.dbName;
var dbUsername = $scope.dbUsername;
var dbPassword = $scope.dbPassword;
var webUserName = "";
// getting website username
webUserName = databaseWebsite.replace(/-/g, '');
webUserName = webUserName.split(".")[0];
if (webUserName.length > 5) {
webUserName = webUserName.substring(0, 4);
}
var url = "/dataBases/submitDBCreation";
var data = {
webUserName: webUserName,
databaseWebsite: databaseWebsite,
dbName: dbName,
dbUsername: dbUsername,
dbPassword: dbPassword
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
if (response.data.createDBStatus == 1) {
$scope.createDatabaseLoading = true;
$scope.dbDetails = false;
$scope.databaseCreationFailed = true;
$scope.databaseCreated = true;
$scope.databaseCreated = false;
$scope.couldNotConnect = true;
var databaseWebsite = $scope.databaseWebsite;
var dbName = $scope.dbName;
var dbUsername = $scope.dbUsername;
var dbPassword = $scope.dbPassword;
var webUserName = "";
}
// getting website username
webUserName = databaseWebsite.replace("-", "");
webUserName = webUserName.split(".")[0];
if(webUserName.length > 5){
webUserName = webUserName.substring(0,4);
}
var url = "/dataBases/submitDBCreation";
else {
var data = {
webUserName:webUserName,
databaseWebsite:databaseWebsite,
dbName:dbName,
dbUsername:dbUsername,
dbPassword:dbPassword,
};
var config = {
headers : {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
$scope.createDatabaseLoading = true;
$scope.dbDetails = false;
$scope.databaseCreationFailed = false;
$scope.databaseCreated = true;
$scope.couldNotConnect = true;
$scope.errorMessage = response.data.error_message;
function ListInitialDatas(response) {
}
if(response.data.createDBStatus == 1){
$scope.createDatabaseLoading = true;
$scope.dbDetails = false;
$scope.databaseCreationFailed = true;
$scope.databaseCreated = false;
$scope.couldNotConnect = true;
}
else
{
$scope.createDatabaseLoading = true;
$scope.dbDetails = false;
$scope.databaseCreationFailed = false;
$scope.databaseCreated = true;
$scope.couldNotConnect = true;
$scope.errorMessage = response.data.error_message;
}
}
function cantLoadInitialDatas(response) {
$scope.createDatabaseLoading = true;
$scope.dbDetails = true;
$scope.databaseCreationFailed = true;
$scope.databaseCreated = true;
$scope.couldNotConnect = false;
}
}
function cantLoadInitialDatas(response) {
$scope.createDatabaseLoading = true;
$scope.dbDetails = true;
$scope.databaseCreationFailed = true;
$scope.databaseCreated = true;
$scope.couldNotConnect = false;
}
};
$scope.generatePassword = function () {
$scope.generatedPasswordView = false;
$scope.dbPassword = randomPassword(12);
};
$scope.usePassword = function () {
$scope.generatedPasswordView = true;
};
});
@@ -117,7 +118,7 @@ app.controller('createDatabase', function($scope,$http) {
/* Java script code to delete database */
app.controller('deleteDatabase', function($scope,$http) {
app.controller('deleteDatabase', function ($scope, $http) {
$scope.deleteDatabaseLoading = true;
$scope.fetchedDatabases = true;
@@ -126,153 +127,147 @@ app.controller('deleteDatabase', function($scope,$http) {
$scope.couldNotConnect = true;
$scope.fetchDatabases = function(){
$scope.fetchDatabases = function () {
$scope.deleteDatabaseLoading = false;
$scope.fetchedDatabases = true;
$scope.deleteDatabaseLoading = false;
$scope.fetchedDatabases = true;
$scope.databaseDeletionFailed = true;
$scope.databaseDeleted = true;
$scope.couldNotConnect = true;
var databaseWebsite = $scope.databaseWebsite;
var url = "/dataBases/fetchDatabases";
var data = {
databaseWebsite: databaseWebsite,
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
if (response.data.fetchStatus == 1) {
$scope.dbnames = JSON.parse(response.data.data);
$scope.deleteDatabaseLoading = true;
$scope.fetchedDatabases = false;
$scope.databaseDeletionFailed = true;
$scope.databaseDeleted = true;
$scope.couldNotConnect = true;
var databaseWebsite = $scope.databaseWebsite;
}
var url = "/dataBases/fetchDatabases";
else {
$scope.deleteDatabaseLoading = true;
$scope.fetchedDatabases = true;
$scope.databaseDeletionFailed = false;
$scope.databaseDeleted = true;
$scope.couldNotConnect = true;
var data = {
databaseWebsite:databaseWebsite,
};
var config = {
headers : {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
$scope.errorMessage = response.data.error_message;
function ListInitialDatas(response) {
}
if(response.data.fetchStatus == 1){
}
function cantLoadInitialDatas(response) {
$scope.deleteDatabaseLoading = true;
$scope.fetchedDatabases = true;
$scope.databaseDeletionFailed = true;
$scope.databaseDeleted = true;
$scope.couldNotConnect = false;
$scope.dbnames = JSON.parse(response.data.data);
$scope.deleteDatabaseLoading = true;
$scope.fetchedDatabases = false;
$scope.databaseDeletionFailed = true;
$scope.databaseDeleted = true;
$scope.couldNotConnect = true;
}
else
{
$scope.deleteDatabaseLoading = true;
$scope.fetchedDatabases = true;
$scope.databaseDeletionFailed = false;
$scope.databaseDeleted = true;
$scope.couldNotConnect = true;
$scope.errorMessage = response.data.error_message;
}
}
function cantLoadInitialDatas(response) {
$scope.deleteDatabaseLoading = true;
$scope.fetchedDatabases = true;
$scope.databaseDeletionFailed = true;
$scope.databaseDeleted = true;
$scope.couldNotConnect = false;
}
}
};
$scope.deleteDatabase = function(){
$scope.deleteDatabase = function () {
$scope.deleteDatabaseLoading = false;
$scope.fetchedDatabases = true;
$scope.deleteDatabaseLoading = false;
$scope.fetchedDatabases = true;
$scope.databaseDeletionFailed = true;
$scope.databaseDeleted = true;
$scope.couldNotConnect = true;
var databaseWebsite = $scope.databaseWebsite;
var url = "/dataBases/submitDatabaseDeletion";
var data = {
dbName: $scope.selectedDB,
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
if (response.data.deleteStatus == 1) {
$scope.deleteDatabaseLoading = true;
$scope.fetchedDatabases = false;
$scope.databaseDeletionFailed = true;
$scope.databaseDeleted = false;
$scope.couldNotConnect = true;
}
else {
$scope.deleteDatabaseLoading = true;
$scope.fetchedDatabases = true;
$scope.databaseDeletionFailed = false;
$scope.databaseDeleted = true;
$scope.couldNotConnect = true;
var databaseWebsite = $scope.databaseWebsite;
var url = "/dataBases/submitDatabaseDeletion";
$scope.errorMessage = response.data.error_message;
var data = {
dbName:$scope.selectedDB,
};
var config = {
headers : {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
}
function ListInitialDatas(response) {
}
function cantLoadInitialDatas(response) {
$scope.deleteDatabaseLoading = true;
$scope.fetchedDatabases = true;
$scope.databaseDeletionFailed = true;
$scope.databaseDeleted = true;
$scope.couldNotConnect = false;
if(response.data.deleteStatus == 1){
$scope.deleteDatabaseLoading = true;
$scope.fetchedDatabases = false;
$scope.databaseDeletionFailed = true;
$scope.databaseDeleted = false;
$scope.couldNotConnect = true;
}
else
{
$scope.deleteDatabaseLoading = true;
$scope.fetchedDatabases = true;
$scope.databaseDeletionFailed = false;
$scope.databaseDeleted = true;
$scope.couldNotConnect = true;
$scope.errorMessage = response.data.error_message;
}
}
function cantLoadInitialDatas(response) {
$scope.deleteDatabaseLoading = true;
$scope.fetchedDatabases = true;
$scope.databaseDeletionFailed = true;
$scope.databaseDeleted = true;
$scope.couldNotConnect = false;
}
}
};
@@ -281,11 +276,10 @@ app.controller('deleteDatabase', function($scope,$http) {
/* Java script code to delete database ends here */
/* Java script code to list databases */
app.controller('listDBs', function($scope,$http) {
app.controller('listDBs', function ($scope, $http) {
$scope.recordsFetched = true;
$scope.passwordChanged = true;
@@ -299,157 +293,204 @@ app.controller('listDBs', function($scope,$http) {
var globalDBUsername = "";
$scope.fetchDBs = function () {
populateCurrentRecords();
populateCurrentRecords();
};
$scope.changePassword = function (dbUsername) {
$scope.recordsFetched = true;
$scope.passwordChanged = true;
$scope.canNotChangePassword = true;
$scope.couldNotConnect = true;
$scope.dbLoading = true;
$scope.dbAccounts = false;
$scope.changePasswordBox = false;
$scope.notificationsBox = true;
$scope.dbUsername = dbUsername;
$scope.recordsFetched = true;
$scope.passwordChanged = true;
$scope.canNotChangePassword = true;
$scope.couldNotConnect = true;
$scope.dbLoading = true;
$scope.dbAccounts = false;
$scope.changePasswordBox = false;
$scope.notificationsBox = true;
$scope.dbUsername = dbUsername;
globalDBUsername = dbUsername;
globalDBUsername = dbUsername;
};
$scope.changePasswordBtn = function () {
$scope.dbLoading = false;
$scope.passwordChanged = true;
$scope.dbLoading = false;
$scope.passwordChanged = true;
url = "/dataBases/changePassword";
url = "/dataBases/changePassword";
var data = {
dbUserName:globalDBUsername,
dbPassword: $scope.dbPassword,
};
var data = {
dbUserName: globalDBUsername,
dbPassword: $scope.dbPassword,
};
var config = {
headers : {
'X-CSRFToken': getCookie('csrftoken')
}
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
function ListInitialDatas(response) {
if(response.data.changePasswordStatus == 1){
$scope.notificationsBox = false;
$scope.passwordChanged = false;
$scope.dbLoading = true;
$scope.domainFeteched = $scope.selectedDomain;
if (response.data.changePasswordStatus == 1) {
$scope.notificationsBox = false;
$scope.passwordChanged = false;
$scope.dbLoading = true;
$scope.domainFeteched = $scope.selectedDomain;
}
else{
$scope.notificationsBox = false;
$scope.canNotChangePassword = false;
$scope.dbLoading = true;
$scope.canNotChangePassword = false;
$scope.errorMessage = response.data.error_message;
}
}
else {
$scope.notificationsBox = false;
$scope.canNotChangePassword = false;
$scope.dbLoading = true;
$scope.canNotChangePassword = false;
$scope.errorMessage = response.data.error_message;
}
}
function cantLoadInitialDatas(response) {
$scope.notificationsBox = false;
$scope.couldNotConnect = false;
$scope.dbLoading = true;
}
}
function cantLoadInitialDatas(response) {
$scope.notificationsBox = false;
$scope.couldNotConnect = false;
$scope.dbLoading = true;
};
}
};
function populateCurrentRecords() {
$scope.recordsFetched = true;
$scope.passwordChanged = true;
$scope.canNotChangePassword = true;
$scope.couldNotConnect = true;
$scope.dbLoading = false;
$scope.dbAccounts = true;
$scope.changePasswordBox = true;
$scope.notificationsBox = true;
var selectedDomain = $scope.selectedDomain;
url = "/dataBases/fetchDatabases";
var data = {
databaseWebsite: selectedDomain,
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
function populateCurrentRecords(){
$scope.recordsFetched = true;
$scope.passwordChanged = true;
$scope.canNotChangePassword = true;
$scope.couldNotConnect = true;
$scope.dbLoading = false;
$scope.dbAccounts = true;
$scope.changePasswordBox = true;
$scope.notificationsBox = true;
var selectedDomain = $scope.selectedDomain;
url = "/dataBases/fetchDatabases";
var data = {
databaseWebsite:selectedDomain,
};
var config = {
headers : {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
function ListInitialDatas(response) {
if (response.data.fetchStatus == 1) {
$scope.records = JSON.parse(response.data.data);
if(response.data.fetchStatus == 1){
$scope.recordsFetched = false;
$scope.passwordChanged = true;
$scope.canNotChangePassword = true;
$scope.couldNotConnect = true;
$scope.dbLoading = true;
$scope.dbAccounts = false;
$scope.changePasswordBox = true;
$scope.notificationsBox = false;
$scope.records = JSON.parse(response.data.data);
$scope.domainFeteched = $scope.selectedDomain;
}
else {
$scope.recordsFetched = true;
$scope.passwordChanged = true;
$scope.canNotChangePassword = true;
$scope.couldNotConnect = true;
$scope.dbLoading = true;
$scope.dbAccounts = true;
$scope.changePasswordBox = true;
$scope.notificationsBox = true;
$scope.recordsFetched = false;
$scope.passwordChanged = true;
$scope.canNotChangePassword = true;
$scope.couldNotConnect = true;
$scope.dbLoading = true;
$scope.dbAccounts = false;
$scope.changePasswordBox = true;
$scope.notificationsBox = false;
$scope.errorMessage = response.data.error_message;
}
$scope.domainFeteched = $scope.selectedDomain;
}
}
else{
$scope.recordsFetched = true;
$scope.passwordChanged = true;
$scope.canNotChangePassword = true;
$scope.couldNotConnect = true;
$scope.dbLoading = true;
$scope.dbAccounts = true;
$scope.changePasswordBox = true;
$scope.notificationsBox = true;
function cantLoadInitialDatas(response) {
$scope.recordsFetched = true;
$scope.passwordChanged = true;
$scope.canNotChangePassword = true;
$scope.couldNotConnect = false;
$scope.dbLoading = true;
$scope.dbAccounts = true;
$scope.changePasswordBox = true;
$scope.notificationsBox = true;
$scope.errorMessage = response.data.error_message;
}
}
}
function cantLoadInitialDatas(response) {
$scope.recordsFetched = true;
$scope.passwordChanged = true;
$scope.canNotChangePassword = true;
$scope.couldNotConnect = false;
$scope.dbLoading = true;
$scope.dbAccounts = true;
$scope.changePasswordBox = true;
$scope.notificationsBox = true;
}
}
////
};
$scope.generatedPasswordView = true;
$scope.generatePassword = function () {
$scope.generatedPasswordView = false;
$scope.dbPassword = randomPassword(12);
};
$scope.usePassword = function () {
$scope.generatedPasswordView = true;
};
});
/* Java script code to list database ends here */
/* Java script code to list database ends here */
app.controller('phpMyAdmin', function ($scope, $http, $window) {
function setupPHPMYAdminSession() {
url = "/dataBases/setupPHPMYAdminSession";
var data = {};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
if (response.data.status === 1) {
$window.location.href = '/phpmyadmin';
}
else {}
}
function cantLoadInitialDatas(response) {}
}
setupPHPMYAdminSession();
});

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -2,12 +2,21 @@
width: 25%;
}
#navBar{
/*#navBar{
background: -moz-linear-gradient(#a4dbf5, #8cc5e0);
background: -webkit-linear-gradient(#a4dbf5, #8cc5e0);
background: -o-linear-gradient(#a4dbf5, #8cc5e0);
}*/
#navBar {
background: #0daeff; /* Old browsers */
background: -moz-linear-gradient(-45deg, #0daeff 0%,#3939ad 30%); /* FF3.6-15 */
background: -webkit-linear-gradient(-45deg, #0daeff 0%,#3939ad 30%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(-45deg, #0daeff 0%,#3939ad 30%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3939ad', endColorstr='#0daeff',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
}
.navbar-brand {
margin: 0 1rem 0 1rem;
}
#mainRow{
margin: 1%;
}
@@ -41,4 +50,127 @@
#htmlEditorStyles{
margin-bottom: 2%;
margin-top: 2%;
}
}
.flex-wrap {
display: flex;
flex-wrap: wrap;
}
.mt-5 {
margin-top: 5px !important;
}
.mt-10 {
margin-top: 10px;
}
.mt-20 {
margin-top: 20px;
}
.mt-30 {
margin-top: 30px;
}
.mr-10 {
margin-right: 10px;
}
.mb-10 {
margin-bottom: 10px;
}
.ml-10 {
margin-left: 10px;
}
.my-10 {
margin-top: 10px;
margin-bottom: 10px;
}
.mx-5 {
margin-left: 5px;
margin-right: 5px;
}
.mx-10 {
margin-left: 10px;
margin-right: 10px;
}
.header-logo {
width: 315px;
/* text-align: center;*/
font-size: 16px;
float: left;
position: relative;
}
a.nav-link {
color: #add8e6;
}
a.nav-link:hover {
color: #E4F2F7;
}
.point-events {
pointer-events: all;
}
.card-header {
padding: .75rem 1.25rem;
margin-bottom: 0;
background-color: transparent;
border-bottom: none;
}
.form-control {
padding: 0 .5rem;
border: 1px solid #eeeeee;
color: #777;
font-size: .95em;
}
.form-control[readonly] {
background-color: transparent;
}
a {
color: #6C6CA4;
text-decoration: none;
background-color: transparent;
-webkit-text-decoration-skip: objects;
}
a:hover {
color: #8989B6;
text-decoration: none;
background-color: transparent;
-webkit-text-decoration-skip: objects;
}
#tableHead {
background: #8989B6;
color: #E1E1EC;
}
.table td, .table th {
padding: .15em;
vertical-align: top;
border-top: 1px solid #e9ecef;
}
.table thead th {
vertical-align: bottom;
border-bottom: 1px solid #e9ecef;
font-weight: 400;
}
.table td {
font-size: 14px;
color: #666666;
}
.list-group-item {
padding: .2em 1.25rem;
}
i.fa.fa-file {
color: #6C6CA4 !important;
}
i.fa.fa-minus {
color: #6C6CA4 !important;
}
i.fa.fa-plus {
color: #6C6CA4 !important;
}
.list-group-item {
background-color: transparent;
}
.bg-lightgray {
background: #F9F9FA;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,7 @@
/* Java script code to create account */
app.controller('createFTPAccount', function($scope,$http) {
app.controller('createFTPAccount', function ($scope, $http) {
$scope.ftpLoading = true;
$scope.ftpDetails = true;
@@ -12,7 +12,7 @@ app.controller('createFTPAccount', function($scope,$http) {
$scope.successfullyCreated = true;
$scope.couldNotConnect = true;
$scope.showFTPDetails = function(){
$scope.showFTPDetails = function () {
$scope.ftpLoading = true;
$scope.ftpDetails = false;
@@ -23,99 +23,103 @@ app.controller('createFTPAccount', function($scope,$http) {
};
$scope.createFTPAccount = function () {
$scope.ftpLoading = false;
$scope.ftpDetails = false;
$scope.canNotCreate = true;
$scope.successfullyCreated = true;
$scope.couldNotConnect = true;
var ftpDomain = $scope.ftpDomain;
var ftpUserName = $scope.ftpUserName;
var ftpPassword = $scope.ftpPassword;
var path = $scope.ftpPath;
if (typeof path === 'undefined') {
path = "";
}
var url = "/ftp/submitFTPCreation";
$scope.createFTPAccount = function(){
var data = {
ftpDomain: ftpDomain,
ftpUserName: ftpUserName,
passwordByPass: ftpPassword,
path: path,
};
$scope.ftpLoading = false;
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
if (response.data.creatFTPStatus == 1) {
$scope.ftpLoading = true;
$scope.ftpDetails = false;
$scope.canNotCreate = true;
$scope.successfullyCreated = false;
$scope.couldNotConnect = true;
} else {
$scope.ftpLoading = true;
$scope.ftpDetails = false;
$scope.canNotCreate = false;
$scope.successfullyCreated = true;
$scope.couldNotConnect = true;
var ftpDomain = $scope.ftpDomain;
var ftpUserName = $scope.ftpUserName;
var ftpPassword = $scope.ftpPassword;
var path = $scope.ftpPath;
if (typeof path === 'undefined'){
path = "";
}
var url = "/ftp/submitFTPCreation";
$scope.errorMessage = response.data.error_message;
var data = {
ftpDomain:ftpDomain,
ftpUserName:ftpUserName,
ftpPassword:ftpPassword,
path:path,
};
var config = {
headers : {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
}
function ListInitialDatas(response) {
if(response.data.creatFTPStatus == 1){
$scope.ftpLoading = true;
$scope.ftpDetails = false;
$scope.canNotCreate = true;
$scope.successfullyCreated = false;
$scope.couldNotConnect = true;
}
else
{
$scope.ftpLoading = true;
$scope.ftpDetails = false;
$scope.canNotCreate = false;
$scope.successfullyCreated = true;
$scope.couldNotConnect = true;
$scope.errorMessage = response.data.error_message;
}
}
function cantLoadInitialDatas(response) {
$scope.ftpLoading = true;
$scope.ftpDetails = false;
$scope.canNotCreate = true;
$scope.successfullyCreated = true;
$scope.couldNotConnect = false;
}
}
function cantLoadInitialDatas(response) {
$scope.ftpLoading = true;
$scope.ftpDetails = false;
$scope.canNotCreate = true;
$scope.successfullyCreated = true;
$scope.couldNotConnect = false;
}
};
$scope.hideFewDetails = function(){
$scope.hideFewDetails = function () {
$scope.successfullyCreated = true;
};
///
$scope.generatedPasswordView = true;
$scope.generatePassword = function () {
$scope.generatedPasswordView = false;
$scope.ftpPassword = randomPassword(12);
};
$scope.usePassword = function () {
$scope.generatedPasswordView = true;
};
});
/* Java script code to create account ends here */
@@ -123,7 +127,7 @@ app.controller('createFTPAccount', function($scope,$http) {
/* Java script code to delete ftp account */
app.controller('deleteFTPAccount', function($scope,$http) {
app.controller('deleteFTPAccount', function ($scope, $http) {
$scope.ftpAccountsOfDomain = true;
$scope.deleteFTPButton = true;
@@ -132,7 +136,7 @@ app.controller('deleteFTPAccount', function($scope,$http) {
$scope.couldNotConnect = true;
$scope.deleteFTPButtonInit = true;
$scope.getFTPAccounts = function(){
$scope.getFTPAccounts = function () {
$scope.ftpAccountsOfDomain = true;
$scope.deleteFTPButton = true;
@@ -142,157 +146,141 @@ app.controller('deleteFTPAccount', function($scope,$http) {
$scope.deleteFTPButtonInit = true;
var url = "/ftp/fetchFTPAccounts";
var data = {
ftpDomain:$scope.selectedDomain,
};
var data = {
ftpDomain: $scope.selectedDomain,
};
var config = {
headers : {
'X-CSRFToken': getCookie('csrftoken')
}
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
function ListInitialDatas(response) {
if(response.data.fetchStatus == 1){
if (response.data.fetchStatus == 1) {
$scope.ftpAccountsFeteched = JSON.parse(response.data.data);
$scope.ftpAccountsOfDomain = false;
$scope.deleteFTPButton = true;
$scope.deleteFailure = true;
$scope.deleteSuccess = true;
$scope.couldNotConnect = true;
$scope.deleteFTPButtonInit = false;
}
else
{
$scope.ftpAccountsOfDomain = true;
$scope.deleteFTPButton = true;
$scope.deleteFailure = true;
$scope.deleteSuccess = true;
$scope.couldNotConnect = false;
$scope.deleteFTPButtonInit = true;
}
}
function cantLoadInitialDatas(response) {
$scope.ftpAccountsOfDomain = true;
$scope.deleteFTPButton = true;
$scope.deleteFailure = true;
$scope.deleteSuccess = true;
$scope.couldNotConnect = false;
$scope.deleteFTPButtonInit = true;
}
};
$scope.deleteFTPAccount = function(){
$scope.ftpAccountsFeteched = JSON.parse(response.data.data);
$scope.ftpAccountsOfDomain = false;
$scope.deleteFTPButton = false;
$scope.deleteFTPButton = true;
$scope.deleteFailure = true;
$scope.deleteSuccess = true;
$scope.couldNotConnect = true;
$scope.deleteFTPButtonInit = false;
} else {
$scope.ftpAccountsOfDomain = true;
$scope.deleteFTPButton = true;
$scope.deleteFailure = true;
$scope.deleteSuccess = true;
$scope.couldNotConnect = false;
$scope.deleteFTPButtonInit = true;
}
}
function cantLoadInitialDatas(response) {
$scope.ftpAccountsOfDomain = true;
$scope.deleteFTPButton = true;
$scope.deleteFailure = true;
$scope.deleteSuccess = true;
$scope.couldNotConnect = false;
$scope.deleteFTPButtonInit = true;
}
};
$scope.deleteFTPAccount = function () {
$scope.ftpAccountsOfDomain = false;
$scope.deleteFTPButton = false;
$scope.deleteFailure = true;
$scope.deleteSuccess = true;
$scope.couldNotConnect = true;
$scope.deleteFTPButtonInit = false;
};
$scope.deleteFTPFinal = function(){
$scope.deleteFTPFinal = function () {
var url = "/ftp/submitFTPDelete";
var data = {
ftpUsername:$scope.selectedFTPAccount,
};
var data = {
ftpUsername: $scope.selectedFTPAccount,
};
var config = {
headers : {
'X-CSRFToken': getCookie('csrftoken')
}
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
function ListInitialDatas(response) {
if(response.data.deleteStatus == 1){
if (response.data.deleteStatus == 1) {
$scope.ftpAccountsOfDomain = true;
$scope.deleteFTPButton = true;
$scope.deleteFailure = true;
$scope.deleteSuccess = false;
$scope.couldNotConnect = true;
$scope.deleteFTPButtonInit = true;
$scope.ftpAccountsOfDomain = true;
$scope.deleteFTPButton = true;
$scope.deleteFailure = true;
$scope.deleteSuccess = false;
$scope.couldNotConnect = true;
$scope.deleteFTPButtonInit = true;
$scope.ftpUserNameDeleted = $scope.selectedFTPAccount;
$scope.ftpUserNameDeleted = $scope.selectedFTPAccount;
}
} else {
else
{
$scope.ftpAccountsOfDomain = true;
$scope.deleteFTPButton = true;
$scope.deleteFailure = false;
$scope.deleteSuccess = true;
$scope.couldNotConnect = true;
$scope.deleteFTPButtonInit = false;
$scope.ftpAccountsOfDomain = true;
$scope.deleteFTPButton = true;
$scope.deleteFailure = false;
$scope.deleteSuccess = true;
$scope.couldNotConnect = true;
$scope.deleteFTPButtonInit = false;
$scope.errorMessage = response.data.error_message;
$scope.errorMessage = response.data.error_message;
}
}
}
}
function cantLoadInitialDatas(response) {
$scope.ftpAccountsOfDomain = true;
$scope.deleteFTPButton = true;
$scope.deleteFailure = false;
$scope.deleteSuccess = true;
$scope.couldNotConnect = false;
$scope.deleteFTPButtonInit = true;
}
function cantLoadInitialDatas(response) {
$scope.ftpAccountsOfDomain = true;
$scope.deleteFTPButton = true;
$scope.deleteFailure = false;
$scope.deleteSuccess = true;
$scope.couldNotConnect = false;
$scope.deleteFTPButtonInit = true;
}
};
@@ -301,7 +289,7 @@ app.controller('deleteFTPAccount', function($scope,$http) {
/* Java script code to delete ftp account ends here */
app.controller('listFTPAccounts', function($scope,$http) {
app.controller('listFTPAccounts', function ($scope, $http) {
$scope.recordsFetched = true;
$scope.passwordChanged = true;
@@ -315,150 +303,159 @@ app.controller('listFTPAccounts', function($scope,$http) {
var globalFTPUsername = "";
$scope.fetchFTPAccounts = function () {
populateCurrentRecords();
populateCurrentRecords();
};
$scope.changePassword = function (ftpUsername) {
$scope.recordsFetched = true;
$scope.passwordChanged = true;
$scope.canNotChangePassword = true;
$scope.couldNotConnect = true;
$scope.ftpLoading = true;
$scope.changePasswordBox = false;
$scope.notificationsBox = true;
$scope.ftpUsername = ftpUsername;
globalFTPUsername = ftpUsername;
$scope.recordsFetched = true;
$scope.passwordChanged = true;
$scope.canNotChangePassword = true;
$scope.couldNotConnect = true;
$scope.ftpLoading = true;
$scope.changePasswordBox = false;
$scope.notificationsBox = true;
$scope.ftpUsername = ftpUsername;
globalFTPUsername = ftpUsername;
};
$scope.changePasswordBtn = function () {
$scope.ftpLoading = false;
$scope.ftpLoading = false;
url = "/ftp/changePassword";
url = "/ftp/changePassword";
var data = {
ftpUserName:globalFTPUsername,
ftpPassword: $scope.ftpPassword,
};
var data = {
ftpUserName: globalFTPUsername,
passwordByPass: $scope.ftpPassword,
};
var config = {
headers : {
'X-CSRFToken': getCookie('csrftoken')
}
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
function ListInitialDatas(response) {
if(response.data.changePasswordStatus == 1){
$scope.notificationsBox = false;
$scope.passwordChanged = false;
$scope.ftpLoading = true;
$scope.domainFeteched = $scope.selectedDomain;
if (response.data.changePasswordStatus == 1) {
$scope.notificationsBox = false;
$scope.passwordChanged = false;
$scope.ftpLoading = true;
$scope.domainFeteched = $scope.selectedDomain;
}
else{
$scope.notificationsBox = false;
$scope.canNotChangePassword = false;
$scope.ftpLoading = true;
$scope.canNotChangePassword = false;
$scope.errorMessage = response.data.error_message;
}
} else {
$scope.notificationsBox = false;
$scope.canNotChangePassword = false;
$scope.ftpLoading = true;
$scope.canNotChangePassword = false;
$scope.errorMessage = response.data.error_message;
}
}
function cantLoadInitialDatas(response) {
$scope.notificationsBox = false;
$scope.couldNotConnect = false;
$scope.ftpLoading = true;
}
}
function cantLoadInitialDatas(response) {
$scope.notificationsBox = false;
$scope.couldNotConnect = false;
$scope.ftpLoading = true;
};
}
};
function populateCurrentRecords() {
$scope.recordsFetched = true;
$scope.passwordChanged = true;
$scope.canNotChangePassword = true;
$scope.couldNotConnect = true;
$scope.ftpLoading = false;
$scope.ftpAccounts = true;
$scope.changePasswordBox = true;
var selectedDomain = $scope.selectedDomain;
url = "/ftp/getAllFTPAccounts";
var data = {
selectedDomain: selectedDomain,
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
function populateCurrentRecords(){
$scope.recordsFetched = true;
$scope.passwordChanged = true;
$scope.canNotChangePassword = true;
$scope.couldNotConnect = true;
$scope.ftpLoading = false;
$scope.ftpAccounts = true;
$scope.changePasswordBox = true;
var selectedDomain = $scope.selectedDomain;
url = "/ftp/getAllFTPAccounts";
var data = {
selectedDomain:selectedDomain,
};
var config = {
headers : {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
function ListInitialDatas(response) {
if (response.data.fetchStatus == 1) {
$scope.records = JSON.parse(response.data.data);
if(response.data.fetchStatus == 1){
$scope.notificationsBox = false;
$scope.recordsFetched = false;
$scope.passwordChanged = true;
$scope.canNotChangePassword = true;
$scope.couldNotConnect = true;
$scope.ftpLoading = true;
$scope.ftpAccounts = false;
$scope.changePasswordBox = true;
$scope.records = JSON.parse(response.data.data);
$scope.domainFeteched = $scope.selectedDomain;
} else {
$scope.notificationsBox = false;
$scope.recordsFetched = true;
$scope.passwordChanged = true;
$scope.canNotChangePassword = true;
$scope.couldNotConnect = true;
$scope.ftpLoading = true;
$scope.ftpAccounts = true;
$scope.changePasswordBox = true;
$scope.errorMessage = response.data.error_message;
}
}
function cantLoadInitialDatas(response) {
$scope.notificationsBox = false;
$scope.recordsFetched = true;
$scope.passwordChanged = true;
$scope.canNotChangePassword = true;
$scope.couldNotConnect = false;
$scope.ftpLoading = true;
$scope.ftpAccounts = true;
$scope.changePasswordBox = true;
$scope.notificationsBox = false;
$scope.recordsFetched = false;
$scope.passwordChanged = true;
$scope.canNotChangePassword = true;
$scope.couldNotConnect = true;
$scope.ftpLoading = true;
$scope.ftpAccounts = false;
$scope.changePasswordBox = true;
}
$scope.domainFeteched = $scope.selectedDomain;
}
}
else{
$scope.notificationsBox = false;
$scope.recordsFetched = true;
$scope.passwordChanged = true;
$scope.canNotChangePassword = true;
$scope.couldNotConnect = true;
$scope.ftpLoading = true;
$scope.ftpAccounts = true;
$scope.changePasswordBox = true;
////
$scope.errorMessage = response.data.error_message;
}
$scope.generatedPasswordView = true;
}
function cantLoadInitialDatas(response) {
$scope.notificationsBox = false;
$scope.recordsFetched = true;
$scope.passwordChanged = true;
$scope.canNotChangePassword = true;
$scope.couldNotConnect = false;
$scope.ftpLoading = true;
$scope.ftpAccounts = true;
$scope.changePasswordBox = true;
$scope.generatePassword = function () {
$scope.generatedPasswordView = false;
$scope.ftpPassword = randomPassword(12);
};
}
};
$scope.usePassword = function () {
$scope.generatedPasswordView = true;
};
});

BIN
static/images/agreement.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
static/images/change.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
static/images/docker.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 877 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 834 B

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 888 B

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

@@ -39,9 +39,6 @@ application.config(['$interpolateProvider',
}
]);
application.controller('loginSystem', function($scope,$http,$window) {
@@ -73,32 +70,39 @@ application.controller('loginSystem', function($scope,$http,$window) {
function ListInitialData(response) {
console.log(response.data)
if (response.data.loginStatus == 0)
if (response.data.loginStatus === 0)
{
$scope.errorMessage = response.data.error_message;
$("#loginFailed").fadeIn();
}
else{
$("#loginFailed").hide();
$window.location.href = '/base';
$window.location.href = '/base/';
}
$("#verifyingLogin").hide();
}
function cantLoadInitialData(response) {
console.log("not good");
}
function cantLoadInitialData(response) {}
};
$scope.initiateLogin = function($event){
var keyCode = $event.which || $event.keyCode;
if (keyCode === 13) {
$scope.verifyLoginCredentials();
}
};
});
/* Java script code to to Check Login status ends here */

File diff suppressed because it is too large Load Diff

View File

@@ -3,571 +3,558 @@
*/
app.controller('installExtensions', function($scope,$http,$timeout) {
app.controller('installExtensions', function ($scope, $http, $timeout) {
var size = 0;
var extName='';
var size = 0;
var extName = '';
$scope.availableExtensions = true;
$scope.loadingExtensions = true;
$scope.canNotFetch = true;
$scope.couldNotConnect = true;
$scope.phpSelectionDisabled = false;
$scope.request = true;
$scope.canNotPerform = true;
$scope.goback = true;
$scope.fetchPHPDetails = function () {
$scope.loadingExtensions = false;
$scope.phpSelectionDisabled = false;
populateCurrentRecords();
$scope.request = true;
};
$scope.installExt = function (extensionName) {
extName = extensionName;
$scope.phpSelectionDisabled = true;
$scope.requestData = "";
$scope.loadingExtensions = false;
$scope.availableExtensions = true;
$scope.request = false;
$scope.goback = true;
url = "/managephp/submitExtensionRequest";
var data = {
extensionName: extensionName,
type: "install"
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
if (response.data.extensionRequestStatus === 1) {
getRequestStatus();
$scope.canNotPerform = true;
}
else {
$scope.canNotPerform = false;
$scope.errorMessage = response.data.error_message;
}
}
function cantLoadInitialDatas(response) {
$scope.availableExtensions = true;
$scope.loadingExtensions = true;
$scope.canNotFetch = true;
$scope.couldNotConnect = true;
$scope.phpSelectionDisabled = false;
$scope.request = true;
$scope.couldNotConnect = false;
$scope.canNotPerform = true;
$scope.goback = true;
$scope.fetchPHPDetails = function(){
$scope.loadingExtensions = false;
$scope.phpSelectionDisabled = false;
populateCurrentRecords();
$scope.request = true;
};
$scope.installExt = function(extensionName){
extName = extensionName;
$scope.phpSelectionDisabled = true;
$scope.requestData = "";
$scope.loadingExtensions = false;
$scope.availableExtensions = true;
$scope.request = false;
$scope.goback = true;
url = "/managephp/submitExtensionRequest";
var data = {
extensionName:extensionName,
type:"install"
};
var config = {
headers : {
'X-CSRFToken': getCookie('csrftoken')
}
};
}
};
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
$scope.uninstallExt = function (extensionName) {
extName = extensionName;
$scope.phpSelectionDisabled = true;
$scope.requestData = "";
$scope.goback = true;
$scope.loadingExtensions = false;
$scope.availableExtensions = true;
$scope.request = false;
url = "/managephp/submitExtensionRequest";
var data = {
extensionName: extensionName,
type: "uninstall"
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
function ListInitialDatas(response) {
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
if(response.data.extensionRequestStatus === 1){
getRequestStatus();
$scope.canNotPerform = true;
function ListInitialDatas(response) {
}
else{
$scope.canNotPerform = false;
$scope.errorMessage = response.data.error_message;
}
if (response.data.extensionRequestStatus == 1) {
getRequestStatus();
$scope.canNotPerform = true;
}
else {
$scope.canNotPerform = false;
$scope.errorMessage = response.data.error_message;
}
}
function cantLoadInitialDatas(response) {
$scope.canNotFetch = true;
$scope.couldNotConnect = false;
$scope.canNotPerform = true;
}
};
function populateCurrentRecords() {
var phpSelection = $scope.phpSelection;
url = "/managephp/getExtensionsInformation";
var data = {
phpSelection: phpSelection,
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
if (response.data.fetchStatus === 1) {
$scope.records = JSON.parse(response.data.data);
$scope.availableExtensions = false;
$scope.loadingExtensions = true;
$scope.canNotFetch = true;
$scope.couldNotConnect = true;
}
else {
$scope.errorMessage = response.data.error_message;
$scope.canNotFetch = false;
$scope.couldNotConnect = true;
}
}
function cantLoadInitialDatas(response) {
$scope.canNotFetch = true;
$scope.couldNotConnect = false;
}
}
function getRequestStatus() {
url = "/managephp/getRequestStatus";
var data = {
size: size,
extensionName: extName,
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
if (response.data.extensionRequestStatus === 1) {
if (response.data.finished === 1) {
$scope.loadingExtensions = true;
$scope.phpSelectionDisabled = false;
$scope.requestData = response.data.requestStatus;
$scope.goback = false;
$timeout.cancel();
}
function cantLoadInitialDatas(response) {
$scope.canNotFetch = true;
$scope.couldNotConnect = false;
$scope.canNotPerform = true;
else {
size = Number(response.data.size);
$scope.requestData = response.data.requestStatus;
$timeout(getRequestStatus, 1000);
}
};
}
else {
$scope.uninstallExt = function(extensionName){
}
extName = extensionName;
}
$scope.phpSelectionDisabled = true;
$scope.requestData = "";
$scope.goback = true;
function cantLoadInitialDatas(response) {
$scope.loadingExtensions = false;
$scope.availableExtensions = true;
$scope.request = false;
$scope.canNotFetch = true;
$scope.couldNotConnect = false;
url = "/managephp/submitExtensionRequest";
var data = {
extensionName:extensionName,
type:"uninstall"
};
}
var config = {
headers : {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
if(response.data.extensionRequestStatus == 1){
getRequestStatus();
$scope.canNotPerform = true;
}
else{
$scope.canNotPerform = false;
$scope.errorMessage = response.data.error_message;
}
}
function cantLoadInitialDatas(response) {
$scope.canNotFetch = true;
$scope.couldNotConnect = false;
$scope.canNotPerform = true;
}
};
function populateCurrentRecords(){
var phpSelection = $scope.phpSelection;
url = "/managephp/getExtensionsInformation";
var data = {
phpSelection:phpSelection,
};
var config = {
headers : {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
if(response.data.fetchStatus === 1){
$scope.records = JSON.parse(response.data.data);
$scope.availableExtensions = false;
$scope.loadingExtensions = true;
$scope.canNotFetch = true;
$scope.couldNotConnect = true;
}
else{
$scope.errorMessage = response.data.error_message;
$scope.canNotFetch = false;
$scope.couldNotConnect = true;
}
}
function cantLoadInitialDatas(response) {
$scope.canNotFetch = true;
$scope.couldNotConnect = false;
}
};
function getRequestStatus(){
url = "/managephp/getRequestStatus";
var data = {
size:size,
extensionName:extName,
};
var config = {
headers : {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
if(response.data.extensionRequestStatus === 1){
if(response.data.finished === 1){
$scope.loadingExtensions = true;
$scope.phpSelectionDisabled = false;
$scope.requestData = response.data.requestStatus;
$scope.goback = false;
$timeout.cancel();
}
else{
size = Number(response.data.size);
$scope.requestData = response.data.requestStatus;
$timeout(getRequestStatus,1000);
}
}
else{
}
}
function cantLoadInitialDatas(response) {
$scope.canNotFetch = true;
$scope.couldNotConnect = false;
}
};
}
});
app.controller('editPHPConfig', function($scope,$http,$timeout) {
app.controller('editPHPConfig', function ($scope, $http, $timeout) {
$scope.loadingPHP = true;
$scope.canNotFetch = true;
$scope.phpDetailsBox = true;
$scope.couldNotConnect = true;
$scope.detailsSaved = true;
$scope.savebtn = true;
$scope.configDataView = true;
$scope.canNotFetchAdvanced = true;
$scope.detailsSavedAdvanced = true;
$scope.savebtnAdvance = true;
$scope.loadingPHP = true;
$scope.canNotFetch = true;
$scope.phpDetailsBox = true;
$scope.couldNotConnect = true;
$scope.detailsSaved = true;
$scope.savebtn = true;
$scope.configDataView = true;
$scope.canNotFetchAdvanced = true;
$scope.detailsSavedAdvanced = true;
$scope.savebtnAdvance = true;
var allow_url_fopen = false;
var display_errors = false;
var file_uploads = false;
var allow_url_include = false;
var allow_url_fopen = false;
var display_errors = false;
var file_uploads = false;
var allow_url_include = false;
$('#allow_url_fopen').change(function() {
allow_url_fopen = $(this).prop('checked');
});
$('#allow_url_fopen').change(function () {
allow_url_fopen = $(this).prop('checked');
});
$('#display_errors').change(function() {
display_errors = $(this).prop('checked');
});
$('#display_errors').change(function () {
display_errors = $(this).prop('checked');
});
$('#file_uploads').change(function() {
file_uploads = $(this).prop('checked');
});
$('#file_uploads').change(function () {
file_uploads = $(this).prop('checked');
});
$('#allow_url_include').change(function() {
allow_url_include = $(this).prop('checked');
});
$('#allow_url_include').change(function () {
allow_url_include = $(this).prop('checked');
});
$scope.fetchPHPDetails = function(){
$scope.loadingPHP = false;
$scope.canNotFetch = true;
$scope.detailsSaved = true;
$scope.fetchPHPDetails = function () {
$scope.loadingPHP = false;
$scope.canNotFetch = true;
$scope.detailsSaved = true;
$('#allow_url_fopen').bootstrapToggle('off');
$('#display_errors').bootstrapToggle('off');
$('#file_uploads').bootstrapToggle('off');
$('#allow_url_include').bootstrapToggle('off');
$('#allow_url_fopen').bootstrapToggle('off');
$('#display_errors').bootstrapToggle('off');
$('#file_uploads').bootstrapToggle('off');
$('#allow_url_include').bootstrapToggle('off');
url = "/managephp/getCurrentPHPConfig";
url = "/managephp/getCurrentPHPConfig";
var phpSelection = $scope.phpSelection;
var phpSelection = $scope.phpSelection;
var data = {
phpSelection:phpSelection,
};
var data = {
phpSelection: phpSelection,
};
var config = {
headers : {
'X-CSRFToken': getCookie('csrftoken')
}
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
function ListInitialDatas(response) {
if(response.data.fetchStatus == 1){
if (response.data.fetchStatus == 1) {
$scope.savebtn = false;
$scope.savebtn = false;
if(response.data.allow_url_fopen==="1"){
$('#allow_url_fopen').bootstrapToggle('on');
}
if(response.data.display_errors==="1"){
$('#display_errors').bootstrapToggle('on');
}
if(response.data.file_uploads==="1"){
$('#file_uploads').bootstrapToggle('on');
}
if(response.data.allow_url_include==="1"){
$('#allow_url_include').bootstrapToggle('on');
}
$scope.loadingPHP = true;
$scope.memory_limit = response.data.memory_limit;
$scope.max_execution_time = response.data.max_execution_time;
$scope.upload_max_filesize = response.data.upload_max_filesize;
$scope.max_input_time = response.data.max_input_time;
$scope.post_max_size = response.data.post_max_size;
$scope.phpDetailsBox = false;
}
else{
$scope.errorMessage = response.data.error_message;
$scope.canNotFetch = false;
$scope.loadingPHP = true;
$scope.phpDetailsBox = true;
}
if (response.data.allow_url_fopen === "1") {
$('#allow_url_fopen').bootstrapToggle('on');
}
function cantLoadInitialDatas(response) {
$scope.couldNotConnect = false;
if (response.data.display_errors === "1") {
$('#display_errors').bootstrapToggle('on');
}
if (response.data.file_uploads === "1") {
$('#file_uploads').bootstrapToggle('on');
}
if (response.data.allow_url_include === "1") {
$('#allow_url_include').bootstrapToggle('on');
}
};
$scope.loadingPHP = true;
$scope.memory_limit = response.data.memory_limit;
$scope.max_execution_time = response.data.max_execution_time;
$scope.upload_max_filesize = response.data.upload_max_filesize;
$scope.max_input_time = response.data.max_input_time;
$scope.post_max_size = response.data.post_max_size;
$scope.phpDetailsBox = false;
$scope.saveChanges = function () {
$scope.loadingPHP = false;
}
else {
var phpSelection = $scope.phpSelection;
$scope.errorMessage = response.data.error_message;
$scope.canNotFetch = false;
$scope.loadingPHP = true;
$scope.phpDetailsBox = true;
}
url = "/managephp/savePHPConfigBasic";
}
var data = {
phpSelection:phpSelection,
allow_url_fopen:allow_url_fopen,
display_errors:display_errors,
file_uploads:file_uploads,
allow_url_include:allow_url_include,
memory_limit:$scope.memory_limit,
max_execution_time:$scope.max_execution_time,
upload_max_filesize:$scope.upload_max_filesize,
max_input_time:$scope.max_input_time,
post_max_size: $scope.post_max_size,
};
function cantLoadInitialDatas(response) {
var config = {
headers : {
'X-CSRFToken': getCookie('csrftoken')
}
};
$scope.couldNotConnect = false;
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
}
};
function ListInitialDatas(response) {
$scope.saveChanges = function () {
if(response.data.saveStatus === 1){
$scope.loadingPHP = false;
$scope.detailsSaved = false;
$scope.loadingPHP = true;
var phpSelection = $scope.phpSelection;
}
else{
$scope.errorMessage = response.data.error_message;
$scope.canNotFetch = false;
$scope.couldNotConnect = true;
$scope.loadingPHP = true;
}
url = "/managephp/savePHPConfigBasic";
}
function cantLoadInitialDatas(response) {
var data = {
phpSelection: phpSelection,
allow_url_fopen: allow_url_fopen,
display_errors: display_errors,
file_uploads: file_uploads,
allow_url_include: allow_url_include,
memory_limit: $scope.memory_limit,
max_execution_time: $scope.max_execution_time,
upload_max_filesize: $scope.upload_max_filesize,
max_input_time: $scope.max_input_time,
post_max_size: $scope.post_max_size,
};
$scope.canNotFetch = true;
$scope.couldNotConnect = false;
$scope.loadingPHP = true;
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
}
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
};
function ListInitialDatas(response) {
$scope.fetchAdvancePHPDetails = function(){
$scope.loadingPHP = false;
$scope.savebtnAdvance = true;
if (response.data.saveStatus === 1) {
$scope.detailsSaved = false;
$scope.loadingPHP = true;
url = "/managephp/getCurrentAdvancedPHPConfig";
}
else {
$scope.errorMessage = response.data.error_message;
$scope.canNotFetch = false;
$scope.couldNotConnect = true;
$scope.loadingPHP = true;
}
var phpSelection = $scope.phpSelection;
}
var data = {
phpSelection:phpSelection,
};
function cantLoadInitialDatas(response) {
var config = {
headers : {
'X-CSRFToken': getCookie('csrftoken')
}
};
$scope.canNotFetch = true;
$scope.couldNotConnect = false;
$scope.loadingPHP = true;
}
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
};
function ListInitialDatas(response) {
$scope.fetchAdvancePHPDetails = function () {
$scope.loadingPHP = false;
$scope.savebtnAdvance = true;
if(response.data.fetchStatus == 1){
$scope.configDataView = false;
$scope.configData = response.data.configData;
$scope.loadingPHP = true;
url = "/managephp/getCurrentAdvancedPHPConfig";
$scope.canNotFetchAdvanced = true;
$scope.detailsSavedAdvanced = true;
$scope.savebtnAdvance = false;
var phpSelection = $scope.phpSelection;
var data = {
phpSelection: phpSelection,
};
}
else{
$scope.canNotFetchAdvanced = false;
$scope.detailsSavedAdvanced = true;
$scope.loadingPHP = true;
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$scope.errorMessage = response.data.error_message;
$scope.configDataView = true;
}
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
}
function cantLoadInitialDatas(response) {
function ListInitialDatas(response) {
$scope.couldNotConnect = false;
$scope.loadingPHP = true;
if (response.data.fetchStatus == 1) {
}
$scope.configDataView = false;
$scope.configData = response.data.configData;
$scope.loadingPHP = true;
};
$scope.canNotFetchAdvanced = true;
$scope.detailsSavedAdvanced = true;
$scope.savebtnAdvance = false;
}
else {
$scope.canNotFetchAdvanced = false;
$scope.detailsSavedAdvanced = true;
$scope.loadingPHP = true;
$scope.saveChangesAdvance = function () {
$scope.errorMessage = response.data.error_message;
$scope.configDataView = true;
$scope.loadingPHP = false;
}
var phpSelection = $scope.phpSelection;
}
url = "/managephp/savePHPConfigAdvance";
function cantLoadInitialDatas(response) {
var data = {
phpSelection:phpSelection,
configData:$scope.configData,
};
var config = {
headers : {
'X-CSRFToken': getCookie('csrftoken')
}
};
$scope.couldNotConnect = false;
$scope.loadingPHP = true;
}
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
};
function ListInitialDatas(response) {
$scope.saveChangesAdvance = function () {
$scope.loadingPHP = false;
if(response.data.saveStatus == 1){
var phpSelection = $scope.phpSelection;
$scope.detailsSavedAdvanced = false;
$scope.loadingPHP = true;
url = "/managephp/savePHPConfigAdvance";
}
else{
$scope.errorMessage = response.data.error_message;
$scope.canNotFetchAdvanced = false;
$scope.couldNotConnect = true;
$scope.loadingPHP = true;
}
var data = {
phpSelection: phpSelection,
configData: $scope.configData,
};
}
function cantLoadInitialDatas(response) {
$scope.couldNotConnect = false;
$scope.canNotFetchAdvanced = true;
$scope.couldNotConnect = true;
$scope.loadingPHP = true;
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
}
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
};
function ListInitialDatas(response) {
if (response.data.saveStatus == 1) {
$scope.detailsSavedAdvanced = false;
$scope.loadingPHP = true;
}
else {
$scope.errorMessage = response.data.error_message;
$scope.canNotFetchAdvanced = false;
$scope.couldNotConnect = true;
$scope.loadingPHP = true;
}
}
function cantLoadInitialDatas(response) {
$scope.couldNotConnect = false;
$scope.canNotFetchAdvanced = true;
$scope.couldNotConnect = true;
$scope.loadingPHP = true;
}
};
});

View File

@@ -17,8 +17,6 @@ app.controller('sslIssueCtrl', function($scope,$http) {
$scope.issueSSLBtn = false;
};
$scope.issueSSL = function(){
$scope.manageSSLLoading = false;

View File

@@ -0,0 +1,430 @@
/**
* Created by usman on 6/22/18.
*/
/* Java script code */
app.controller('powerDNS', function ($scope, $http, $timeout, $window) {
$scope.pdnsLoading = true;
$scope.failedToFetch = true;
$scope.couldNotConnect = true;
$scope.changesApplied = true;
$scope.slaveIPs = true;
$scope.masterServerHD = true;
var pdnsStatus = false;
$('#pdnsStatus').change(function () {
pdnsStatus = $(this).prop('checked');
});
fetchPDNSStatus('powerdns');
function fetchPDNSStatus(service) {
$scope.pdnsLoading = false;
$('#pdnsStatus').bootstrapToggle('off');
url = "/manageservices/fetchStatus";
var data = {
'service': service
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
$scope.pdnsLoading = true;
if (response.data.status === 1) {
if (response.data.installCheck === 1) {
$('#pdnsStatus').bootstrapToggle('on');
}
$scope.slaveIPData = response.data.slaveIPData;
} else {
$scope.failedToFetch = false;
$scope.couldNotConnect = true;
$scope.changesApplied = true;
$scope.errorMessage = response.data.error_message;
}
}
function cantLoadInitialDatas(response) {
$scope.pdnsLoading = true;
$scope.failedToFetch = true;
$scope.couldNotConnect = false;
$scope.changesApplied = true;
}
}
$scope.saveStatus = function (service) {
$scope.pdnsLoading = false;
$scope.failedToFetch = true;
$scope.couldNotConnect = true;
$scope.changesApplied = true;
url = "/manageservices/saveStatus";
if (service === 'powerdns') {
var data = {
status: pdnsStatus,
service: service,
dnsMode: $scope.dnsMode,
slaveServerNS: $scope.slaveServerNS,
masterServerIP: $scope.masterServerIP,
slaveServer: $scope.slaveServer,
slaveServerIP: $scope.slaveServerIP,
slaveServer2: $scope.slaveServer2,
slaveServerIP2: $scope.slaveServerIP2,
slaveServer3: $scope.slaveServer3,
slaveServerIP3: $scope.slaveServerIP3,
};
}else {
var data = {
status: pdnsStatus,
service: service
};
}
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
$scope.pdnsLoading = true;
if (response.data.status === 1) {
$scope.failedToFetch = true;
$scope.couldNotConnect = true;
$scope.changesApplied = false;
}
else {
$scope.errorMessage = response.data.error_message;
$scope.failedToFetch = false;
$scope.couldNotConnect = true;
$scope.changesApplied = true;
}
}
function cantLoadInitialDatas(response) {
$scope.policyServerLoading = true;
$scope.failedToFetch = true;
$scope.couldNotConnect = false;
$scope.changesApplied = true;
}
};
$scope.modeChange = function () {
if ($scope.dnsMode === 'MASTER') {
$scope.slaveIPs = false;
$scope.masterServerHD = true;
} else if($scope.dnsMode == 'SLAVE') {
$scope.slaveIPs = true;
$scope.masterServerHD = false;
}else{
$scope.slaveIPs = true;
$scope.masterServerHD = true;
}
}
});
/* Java script code */
/* Java script code */
app.controller('postfix', function ($scope, $http, $timeout, $window) {
$scope.serviceLoading = true;
$scope.failedToFetch = true;
$scope.couldNotConnect = true;
$scope.changesApplied = true;
var serviceStatus = false;
$('#serviceStatus').change(function () {
serviceStatus = $(this).prop('checked');
});
fetchPDNSStatus('postfix');
function fetchPDNSStatus(service) {
$scope.serviceLoading = false;
$('#serviceStatus').bootstrapToggle('off');
url = "/manageservices/fetchStatus";
var data = {
'service': service
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
$scope.serviceLoading = true;
if (response.data.status === 1) {
if (response.data.installCheck === 1) {
$('#serviceStatus').bootstrapToggle('on');
}
} else {
$scope.failedToFetch = false;
$scope.couldNotConnect = true;
$scope.changesApplied = true;
$scope.errorMessage = response.data.error_message;
}
}
function cantLoadInitialDatas(response) {
$scope.serviceLoading = true;
$scope.failedToFetch = true;
$scope.couldNotConnect = false;
$scope.changesApplied = true;
}
}
$scope.saveStatus = function (service) {
$scope.serviceLoading = false;
$scope.failedToFetch = true;
$scope.couldNotConnect = true;
$scope.changesApplied = true;
url = "/manageservices/saveStatus";
var data = {
status: serviceStatus,
service: service
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
$scope.serviceLoading = true;
if (response.data.status === 1) {
$scope.failedToFetch = true;
$scope.couldNotConnect = true;
$scope.changesApplied = false;
}
else {
$scope.errorMessage = response.data.error_message;
$scope.failedToFetch = false;
$scope.couldNotConnect = true;
$scope.changesApplied = true;
}
}
function cantLoadInitialDatas(response) {
$scope.serviceLoading = true;
$scope.failedToFetch = true;
$scope.couldNotConnect = false;
$scope.changesApplied = true;
}
};
});
/* Java script code */
/* Java script code */
app.controller('pureFTPD', function ($scope, $http, $timeout, $window) {
$scope.serviceLoading = true;
$scope.failedToFetch = true;
$scope.couldNotConnect = true;
$scope.changesApplied = true;
var serviceStatus = false;
$('#serviceStatus').change(function () {
serviceStatus = $(this).prop('checked');
});
fetchPDNSStatus('pureftpd');
function fetchPDNSStatus(service) {
$scope.serviceLoading = false;
$('#serviceStatus').bootstrapToggle('off');
url = "/manageservices/fetchStatus";
var data = {
'service': service
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
$scope.serviceLoading = true;
if (response.data.status === 1) {
if (response.data.installCheck === 1) {
$('#serviceStatus').bootstrapToggle('on');
}
} else {
$scope.failedToFetch = false;
$scope.couldNotConnect = true;
$scope.changesApplied = true;
$scope.errorMessage = response.data.error_message;
}
}
function cantLoadInitialDatas(response) {
$scope.serviceLoading = true;
$scope.failedToFetch = true;
$scope.couldNotConnect = false;
$scope.changesApplied = true;
}
}
$scope.saveStatus = function (service) {
$scope.serviceLoading = false;
$scope.failedToFetch = true;
$scope.couldNotConnect = true;
$scope.changesApplied = true;
url = "/manageservices/saveStatus";
var data = {
status: serviceStatus,
service: service
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
$scope.serviceLoading = true;
if (response.data.status === 1) {
$scope.failedToFetch = true;
$scope.couldNotConnect = true;
$scope.changesApplied = false;
}
else {
$scope.errorMessage = response.data.error_message;
$scope.failedToFetch = false;
$scope.couldNotConnect = true;
$scope.changesApplied = true;
}
}
function cantLoadInitialDatas(response) {
$scope.serviceLoading = true;
$scope.failedToFetch = true;
$scope.couldNotConnect = false;
$scope.changesApplied = true;
}
};
});
/* Java script code */

View File

@@ -3,13 +3,11 @@
*/
/**
* Created by usman on 7/25/17.
*/
/* Utilities */
function getCookie(name) {
@@ -31,72 +29,74 @@ function getCookie(name) {
/* Utilities ends here */
/* Java script code to create Pacakge */
$("#packageCreationFailed").hide();
$("#packageCreated").hide();
app.controller('createPackage', function($scope,$http) {
app.controller('createPackage', function ($scope, $http) {
//$scope.pname = /([A-Z]){3,10}/gi;
$scope.insertPackInDB = function(){
var packageName = $scope.packageName;
var diskSpace = $scope.diskSpace;
var bandwidth = $scope.bandwidth;
var ftpAccounts = $scope.ftpAccounts;
var dataBases = $scope.dataBases;
var emails = $scope.emails;
$scope.insertPackInDB = function () {
url = "/packages/submitPackage";
var packageName = $scope.packageName;
var diskSpace = $scope.diskSpace;
var bandwidth = $scope.bandwidth;
var ftpAccounts = $scope.ftpAccounts;
var dataBases = $scope.dataBases;
var emails = $scope.emails;
var data = {
packageName: packageName,
diskSpace: diskSpace,
bandwidth: bandwidth,
ftpAccounts: ftpAccounts,
dataBases: dataBases,
emails:emails,
allowedDomains:$scope.allowedDomains
};
var config = {
headers : {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
if ($scope.allowFullDomain === undefined) {
$scope.allowFullDomain = 0;
}
function ListInitialDatas(response) {
console.log(response.data)
url = "/packages/submitPackage";
if (response.data.saveStatus == 0)
{
$scope.errorMessage = response.data.error_message;
$("#packageCreationFailed").fadeIn();
$("#packageCreated").hide();
var data = {
packageName: packageName,
diskSpace: diskSpace,
bandwidth: bandwidth,
ftpAccounts: ftpAccounts,
dataBases: dataBases,
emails: emails,
allowedDomains: $scope.allowedDomains,
allowFullDomain: $scope.allowFullDomain
};
}
else{
$("#packageCreationFailed").hide();
$("#packageCreated").fadeIn();
$scope.createdPackage = $scope.packageName;
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
}
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
}
function cantLoadInitialDatas(response) {
console.log("not good");
}
function ListInitialDatas(response) {
console.log(response.data)
if (response.data.saveStatus == 0) {
$scope.errorMessage = response.data.error_message;
$("#packageCreationFailed").fadeIn();
$("#packageCreated").hide();
} else {
$("#packageCreationFailed").hide();
$("#packageCreated").fadeIn();
$scope.createdPackage = $scope.packageName;
}
}
function cantLoadInitialDatas(response) {
console.log("not good");
}
};
@@ -107,7 +107,6 @@ app.controller('createPackage', function($scope,$http) {
/* Java script code to to create Pacakge ends here */
/* Java script code to delete Pacakge */
@@ -117,62 +116,60 @@ $("#deleteSuccess").hide();
$("#deletePackageButton").hide();
app.controller('deletePackage', function($scope,$http) {
app.controller('deletePackage', function ($scope, $http) {
$scope.deletePackage = function(){
$scope.deletePackage = function () {
$("#deletePackageButton").fadeIn();
};
$scope.deletePackageFinal = function(){
$scope.deletePackageFinal = function () {
var packageName = $scope.packageToBeDeleted;
var packageName = $scope.packageToBeDeleted;
url = "/packages/submitDelete";
url = "/packages/submitDelete";
var data = {
packageName: packageName,
};
var data = {
packageName: packageName,
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
var config = {
headers : {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
console.log(response.data)
function ListInitialDatas(response) {
console.log(response.data)
if (response.data.deleteStatus == 0)
{
$scope.errorMessage = response.data.error_message;
$("#deleteFailure").fadeIn();
$("#deleteSuccess").hide();
$("#deletePackageButton").hide();
if (response.data.deleteStatus == 0) {
$scope.errorMessage = response.data.error_message;
$("#deleteFailure").fadeIn();
$("#deleteSuccess").hide();
$("#deletePackageButton").hide();
}
else{
$("#deleteFailure").hide();
$("#deleteSuccess").fadeIn();
$("#deletePackageButton").hide();
$scope.deletedPackage = packageName;
} else {
$("#deleteFailure").hide();
$("#deleteSuccess").fadeIn();
$("#deletePackageButton").hide();
$scope.deletedPackage = packageName;
}
}
}
function cantLoadInitialDatas(response) {
console.log("not good");
}
}
function cantLoadInitialDatas(response) {
console.log("not good");
}
};
@@ -180,11 +177,9 @@ app.controller('deletePackage', function($scope,$http) {
});
/* Java script code to delete package ends here */
/* Java script code modify package */
$("#packageDetailsToBeModified").hide();
@@ -194,9 +189,9 @@ $("#modifyButton").hide();
$("#packageLoading").hide();
$("#successfullyModified").hide();
app.controller('modifyPackages', function($scope,$http) {
app.controller('modifyPackages', function ($scope, $http) {
$scope.fetchDetails = function(){
$scope.fetchDetails = function () {
$("#packageLoading").show();
$("#successfullyModified").hide();
@@ -207,63 +202,65 @@ app.controller('modifyPackages', function($scope,$http) {
url = "/packages/submitModify";
var data = {
packageName: packageName,
};
var data = {
packageName: packageName,
};
var config = {
headers : {
'X-CSRFToken': getCookie('csrftoken')
}
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
function ListInitialDatas(response) {
if (response.data.modifyStatus == 0)
{
$scope.errorMessage = response.data.error_message;
$("#modifyFailure").fadeIn();
$("#modifySuccess").hide();
$("#modifyButton").hide();
$("#packageLoading").hide();
if (response.data.modifyStatus === 0) {
$scope.errorMessage = response.data.error_message;
$("#modifyFailure").fadeIn();
$("#modifySuccess").hide();
$("#modifyButton").hide();
$("#packageLoading").hide();
}
else{
$("#modifyButton").show();
$scope.diskSpace = response.data.diskSpace;
$scope.bandwidth = response.data.bandwidth;
$scope.ftpAccounts = response.data.ftpAccounts;
$scope.dataBases = response.data.dataBases;
$scope.emails = response.data.emails;
$scope.allowedDomains = response.data.allowedDomains;
$scope.modifyButton = "Save Details"
$("#packageDetailsToBeModified").fadeIn();
$("#modifyFailure").hide();
$("#modifySuccess").fadeIn();
$("#packageLoading").hide();
}
} else {
$("#modifyButton").show();
$scope.diskSpace = response.data.diskSpace;
$scope.bandwidth = response.data.bandwidth;
$scope.ftpAccounts = response.data.ftpAccounts;
$scope.dataBases = response.data.dataBases;
$scope.emails = response.data.emails;
$scope.allowedDomains = response.data.allowedDomains;
if (response.data.allowFullDomain === 1) {
$scope.allowFullDomain = true;
} else {
$scope.allowFullDomain = false;
}
function cantLoadInitialDatas(response) {
console.log("not good");
}
$scope.modifyButton = "Save Details";
$("#packageDetailsToBeModified").fadeIn();
$("#modifyFailure").hide();
$("#modifySuccess").fadeIn();
$("#packageLoading").hide();
}
}
function cantLoadInitialDatas(response) {
console.log("not good");
}
};
$scope.modifyPackageFunc = function () {
var packageName = $scope.packageToBeModified;
@@ -281,56 +278,53 @@ app.controller('modifyPackages', function($scope,$http) {
url = "/packages/saveChanges";
var data = {
packageName: packageName,
diskSpace:diskSpace,
bandwidth:bandwidth,
ftpAccounts:ftpAccounts,
dataBases:dataBases,
emails:emails,
allowedDomains:$scope.allowedDomains,
};
var data = {
packageName: packageName,
diskSpace: diskSpace,
bandwidth: bandwidth,
ftpAccounts: ftpAccounts,
dataBases: dataBases,
emails: emails,
allowedDomains: $scope.allowedDomains,
allowFullDomain: $scope.allowFullDomain
};
var config = {
headers : {
'X-CSRFToken': getCookie('csrftoken')
}
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
function ListInitialDatas(response) {
if (response.data.saveStatus == 0)
{
$scope.errorMessage = response.data.error_message;
$("#modifyFailure").fadeIn();
$("#modifySuccess").hide();
$("#modifyButton").hide();
$("#packageLoading").hide();
if (response.data.saveStatus === 0) {
$scope.errorMessage = response.data.error_message;
$("#modifyFailure").fadeIn();
$("#modifySuccess").hide();
$("#modifyButton").hide();
$("#packageLoading").hide();
}
else{
$("#modifyButton").hide();
} else {
$("#modifyButton").hide();
$("#successfullyModified").fadeIn();
$("#modifyFailure").hide();
$("#packageLoading").hide();
$scope.packageModified = packageName;
$("#successfullyModified").fadeIn();
$("#modifyFailure").hide();
$("#packageLoading").hide();
$scope.packageModified = packageName;
}
}
}
function cantLoadInitialDatas(response) {
console.log("not good");
}
}
function cantLoadInitialDatas(response) {
console.log("not good");
}
};
@@ -338,5 +332,200 @@ app.controller('modifyPackages', function($scope,$http) {
});
/* Java script code to Modify Pacakge ends here */
app.controller('listPackageTables', function ($scope, $http) {
$scope.cyberpanelLoading = true;
$scope.populateCurrentRecords = function () {
$scope.cyberpanelLoading = false;
url = "/packages/fetchPackagesTable";
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);
new PNotify({
title: 'Success!',
text: 'Packages successfully fetched!',
type: 'success'
});
} else {
new PNotify({
title: 'Error!',
text: response.data.error_message,
type: 'error'
});
}
}
function cantLoadInitialDatas(response) {
$scope.cyberpanelLoading = true;
new PNotify({
title: 'Error!',
text: 'Could not connect to server, please refresh this page.',
type: 'error'
});
}
};
$scope.populateCurrentRecords();
$scope.deletePackageFinal = function (packageToBeDeleted) {
$scope.cyberpanelLoading = false;
url = "/packages/submitDelete";
var data = {
packageName: packageToBeDeleted,
};
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.populateCurrentRecords();
new PNotify({
title: 'Success!',
text: 'Package successfully deleted!',
type: 'success'
});
} else {
new PNotify({
title: 'Error!',
text: response.data.error_message,
type: 'error'
});
}
}
function cantLoadInitialDatas(response) {
$scope.cyberpanelLoading = true;
new PNotify({
title: 'Error!',
text: 'Could not connect to server, please refresh this page.',
type: 'error'
});
}
};
$scope.editInitial = function (package, diskSpace, bandwidth,
emailAccounts, dataBases, ftpAccounts, allowedDomains, allowFullDomain) {
$scope.name = package;
$scope.diskSpace = diskSpace;
$scope.bandwidth = bandwidth;
$scope.emails = emailAccounts;
$scope.dataBases = dataBases;
$scope.ftpAccounts = ftpAccounts;
$scope.allowedDomains = allowedDomains;
$scope.allowFullDomain = allowFullDomain;
if (allowFullDomain === 1) {
$scope.allowFullDomain = true;
} else {
$scope.allowFullDomain = false;
}
};
$scope.saveChanges = function () {
var packageName = $scope.name;
var diskSpace = $scope.diskSpace;
var bandwidth = $scope.bandwidth;
var ftpAccounts = $scope.ftpAccounts;
var dataBases = $scope.dataBases;
var emails = $scope.emails;
url = "/packages/saveChanges";
var data = {
packageName: packageName,
diskSpace: diskSpace,
bandwidth: bandwidth,
ftpAccounts: ftpAccounts,
dataBases: dataBases,
emails: emails,
allowedDomains: $scope.allowedDomains,
allowFullDomain: $scope.allowFullDomain
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
$scope.cyberpanelLoading = true;
if (response.data.saveStatus === 1) {
$scope.populateCurrentRecords();
new PNotify({
title: 'Success!',
text: 'Package successfully updated!',
type: 'success'
});
} else {
new PNotify({
title: 'Error!',
text: response.data.error_message,
type: 'error'
});
}
}
function cantLoadInitialDatas(response) {
$scope.cyberpanelLoading = true;
new PNotify({
title: 'Error!',
text: 'Could not connect to server, please refresh this page.',
type: 'error'
});
}
};
});

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -11,4 +11,229 @@
border-color:#3498db
}
.table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>th {
color: #777777;
font-weight: 400;
border-color: #cccccc;
border-width: 1px;
background-color: transparent;
}
.table {
font-size: 14px;
width: 100%;
border-spacing: 0;
border-collapse: separate;
border-radius: 5px;
background: #fdfdfd;
padding: 0px 12px;
margin: 10px 12px;
}
.table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th {
/* padding: 10px; */
border-top-width: 1px;
border-top-style: solid;
text-align: left;
}
.mt-5 {
margin-top: 5px;
}
.mt-10 {
margin-top: 10px;
}
.mt-20 {
margin-top: 20px;
}
.mt-30 {
margin-top: 30px;
}
.mr-10 {
margin-right: 10px;
}
.mb-10 {
margin-bottom: 10px;
}
.ml-10 {
margin-left: 10px;
}
.my-10 {
margin-top: 10px;
margin-bottom: 10px;
}
.mx-5 {
margin-left: 5px;
margin-right: 5px;
}
.mx-10 {
margin-left: 10px;
margin-right: 10px;
}
.title-hero {
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
margin: 0 0 15px;
padding: 0;
text-transform: none;
font-size: 14px;
opacity: 1;
color: #777777;
font-weight: 400;
}
.bs-badge {
font-size: 11px;
font-weight: 400;
line-height: 19px;
display: inline-block;
min-width: 20px;
padding: 0 5px 0 4px;
border-radius: 2px;
}
.row-title {
color: #778899;
}
/*span.h4 {
white-space: nowrap;
}*/
/*.panel-body {
white-space: nowrap;
}
*/
.bg-gradient-9 {
background: #0daeff; /* Old browsers */
background: -moz-linear-gradient(-45deg, #0daeff 0%,#3939ad 30%); /* FF3.6-15 */
background: -webkit-linear-gradient(-45deg, #0daeff 0%,#3939ad 30%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(-45deg, #0daeff 0%,#3939ad 30%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3939ad', endColorstr='#0daeff',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
}
#page-header .user-account-btn>a.user-profile .glyph-icon, .logo-bg {
background-color: rgba(0,0,0,.15);
}
a:hover {
text-decoration: none;
}
.text-success {
color: #29A329 !important;
}
.alert-success, .alert-success a, .parsley-success {
color: #1e620f;
border-color: #7cd362;
background: #E4FFE4;
}
.flex {
display: flex;
}
.align-center {
margin: 0 auto;
}
.text-bold {
font-weight: 600;
}
.tile-box-shortcut .tile-header {
background: 0 0;
padding: 25px;
position: absolute;
font-size: 18px;
font-weight: 400;
left: 3em;
bottom: 0px;
}
.tile-box-shortcut .tile-content-wrapper>.glyph-icon {
position: absolute;
left: 25px;
top: 40px;
}
.fa {
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
font-size: 2.25em;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
position: absolute;
left: 25px;
top: 28px;
}
.bs-badge {
font-size: 18px;
font-weight: 100;
line-height: 19px;
display: inline-block;
min-width: 20px;
padding: 0 5px 0 4px;
border-radius: 2px;
color: #afeeee;
}
.tile-box-shortcut .bs-badge {
left: auto;
right: 10px;
top: 30px;
background: transparent;
}
#sidebar-menu {
background: #EAEAF1;
}
#page-sidebar ul li a .glyph-icon {
color: #191970;
}
#header-logo .logo-content-big, .logo-content-small {
height: 40px;
left: 15px;
}
#mobile-navigation .logo-content-small {
width: 50px;
display: block;
left: 75px;
}
#header-nav-left {
margin: 0 20px;
}
#page-content {
background: #ffffff;
}
.service-panel {
background: #A1BDC6 !important;
}
.serviceImg img {
box-shadow: 0 0 2px 1px rgba(0,0,0,.05);
}
.btn-icon {
top: 0px;
left: 0px;
margin: 0px auto;
position: relative;
font-size: 16px;
}
.tab-mod {
color: #777777;
background: transparent;
border-color: #dddddd;
}
.btn-primary {
background: #33ADFF;
border-color: #0099FF;
}
.btn-primary:hover,.btn-primary:focus {
background: #5CBDFF;
border-color: #33ADFF;
}
.btn-min-width {
min-width: 350px;
}

File diff suppressed because it is too large Load Diff