mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 22:06:05 +01:00
feature: add search and ordering to dropdowns
This commit is contained in:
@@ -98,6 +98,23 @@ app.filter('getwebsitename', function () {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function getWebsiteName(domain){
|
||||||
|
if (domain !== undefined) {
|
||||||
|
|
||||||
|
domain = domain.replace(/-/g, '');
|
||||||
|
|
||||||
|
var domainName = domain.split(".");
|
||||||
|
|
||||||
|
var finalDomainName = domainName[0];
|
||||||
|
|
||||||
|
if (finalDomainName.length > 5) {
|
||||||
|
finalDomainName = finalDomainName.substring(0, 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
return finalDomainName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
app.controller('systemStatusInfo', function ($scope, $http, $timeout) {
|
app.controller('systemStatusInfo', function ($scope, $http, $timeout) {
|
||||||
|
|
||||||
//getStuff();
|
//getStuff();
|
||||||
|
|||||||
@@ -98,7 +98,7 @@
|
|||||||
<link rel="stylesheet" type="text/css" href="{% static 'websiteFunctions/websiteFunctions.css' %}">
|
<link rel="stylesheet" type="text/css" href="{% static 'websiteFunctions/websiteFunctions.css' %}">
|
||||||
<link rel="stylesheet" type="text/css" href="https://www.jsdelivr.com/package/npm/fontawesome">
|
<link rel="stylesheet" type="text/css" href="https://www.jsdelivr.com/package/npm/fontawesome">
|
||||||
<link rel="icon" type="image/png" href="{% static 'baseTemplate/assets/finalBase/favicon.png' %}">
|
<link rel="icon" type="image/png" href="{% static 'baseTemplate/assets/finalBase/favicon.png' %}">
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
|
||||||
{% block styles %}
|
{% block styles %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
@@ -963,6 +963,7 @@
|
|||||||
|
|
||||||
<!-- Sparklines charts -->
|
<!-- Sparklines charts -->
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/qrious/4.0.2/qrious.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/qrious/4.0.2/qrious.js"></script>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
|
||||||
<script src="{% static 'baseTemplate/custom-js/pnotify.custom.min.js' %}"></script>
|
<script src="{% static 'baseTemplate/custom-js/pnotify.custom.min.js' %}"></script>
|
||||||
<script src="{% static 'baseTemplate/custom-js/system-status.js' %}"></script>
|
<script src="{% static 'baseTemplate/custom-js/system-status.js' %}"></script>
|
||||||
<script src="{% static 'packages/packages.js' %}"></script>
|
<script src="{% static 'packages/packages.js' %}"></script>
|
||||||
|
|||||||
@@ -6,25 +6,31 @@
|
|||||||
/* Java script code to create database */
|
/* Java script code to create database */
|
||||||
app.controller('createDatabase', function ($scope, $http) {
|
app.controller('createDatabase', function ($scope, $http) {
|
||||||
|
|
||||||
$scope.createDatabaseLoading = true;
|
$(document).ready(function () {
|
||||||
$scope.dbDetails = true;
|
$(".dbDetails").hide();
|
||||||
$scope.databaseCreationFailed = true;
|
$(".generatedPasswordDetails").hide();
|
||||||
$scope.databaseCreated = true;
|
$('#create-database-select').select2();
|
||||||
$scope.couldNotConnect = true;
|
});
|
||||||
$scope.generatedPasswordView = true;
|
|
||||||
|
$('#create-database-select').on('select2:select', function (e) {
|
||||||
|
var data = e.params.data;
|
||||||
|
$scope.databaseWebsite = data.text;
|
||||||
|
$(".dbDetails").show();
|
||||||
|
$("#domainDatabase").text(getWebsiteName(data.text));
|
||||||
|
$("#domainUsername").text(getWebsiteName(data.text));
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
$scope.showDetailsBoxes = function () {
|
$scope.showDetailsBoxes = function () {
|
||||||
$scope.dbDetails = false;
|
$scope.dbDetails = false;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
$scope.createDatabaseLoading = true;
|
||||||
|
|
||||||
$scope.createDatabase = function () {
|
$scope.createDatabase = function () {
|
||||||
|
|
||||||
$scope.createDatabaseLoading = false;
|
$scope.createDatabaseLoading = false;
|
||||||
$scope.dbDetails = false;
|
$scope.dbDetails = false;
|
||||||
$scope.databaseCreationFailed = true;
|
|
||||||
$scope.databaseCreated = true;
|
|
||||||
$scope.couldNotConnect = true;
|
|
||||||
|
|
||||||
|
|
||||||
var databaseWebsite = $scope.databaseWebsite;
|
var databaseWebsite = $scope.databaseWebsite;
|
||||||
@@ -65,26 +71,24 @@ app.controller('createDatabase', function ($scope, $http) {
|
|||||||
function ListInitialDatas(response) {
|
function ListInitialDatas(response) {
|
||||||
|
|
||||||
|
|
||||||
if (response.data.createDBStatus == 1) {
|
if (response.data.createDBStatus === 1) {
|
||||||
|
|
||||||
$scope.createDatabaseLoading = true;
|
$scope.createDatabaseLoading = true;
|
||||||
$scope.dbDetails = false;
|
$scope.dbDetails = false;
|
||||||
$scope.databaseCreationFailed = true;
|
new PNotify({
|
||||||
$scope.databaseCreated = false;
|
title: 'Success!',
|
||||||
$scope.couldNotConnect = true;
|
text: 'Database successfully created.',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else {
|
|
||||||
|
|
||||||
|
|
||||||
$scope.createDatabaseLoading = true;
|
$scope.createDatabaseLoading = true;
|
||||||
$scope.dbDetails = false;
|
$scope.dbDetails = false;
|
||||||
$scope.databaseCreationFailed = false;
|
new PNotify({
|
||||||
$scope.databaseCreated = true;
|
title: 'Operation Failed!',
|
||||||
$scope.couldNotConnect = true;
|
text: response.data.error_message,
|
||||||
$scope.errorMessage = response.data.error_message;
|
type: 'error'
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -96,21 +100,23 @@ app.controller('createDatabase', function ($scope, $http) {
|
|||||||
|
|
||||||
$scope.createDatabaseLoading = true;
|
$scope.createDatabaseLoading = true;
|
||||||
$scope.dbDetails = true;
|
$scope.dbDetails = true;
|
||||||
$scope.databaseCreationFailed = true;
|
new PNotify({
|
||||||
$scope.databaseCreated = true;
|
title: 'Operation Failed!',
|
||||||
$scope.couldNotConnect = false;
|
text: 'Could not connect to server, please refresh this page',
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.generatePassword = function () {
|
$scope.generatePassword = function () {
|
||||||
$scope.generatedPasswordView = false;
|
$(".generatedPasswordDetails").show();
|
||||||
$scope.dbPassword = randomPassword(16);
|
$scope.dbPassword = randomPassword(16);
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.usePassword = function () {
|
$scope.usePassword = function () {
|
||||||
$scope.generatedPasswordView = true;
|
$(".generatedPasswordDetails").hide();
|
||||||
};
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -170,9 +176,7 @@ app.controller('deleteDatabase', function ($scope, $http) {
|
|||||||
$scope.couldNotConnect = true;
|
$scope.couldNotConnect = true;
|
||||||
|
|
||||||
|
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else {
|
|
||||||
$scope.deleteDatabaseLoading = true;
|
$scope.deleteDatabaseLoading = true;
|
||||||
$scope.fetchedDatabases = true;
|
$scope.fetchedDatabases = true;
|
||||||
$scope.databaseDeletionFailed = false;
|
$scope.databaseDeletionFailed = false;
|
||||||
@@ -240,9 +244,7 @@ app.controller('deleteDatabase', function ($scope, $http) {
|
|||||||
$scope.couldNotConnect = true;
|
$scope.couldNotConnect = true;
|
||||||
|
|
||||||
|
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else {
|
|
||||||
$scope.deleteDatabaseLoading = true;
|
$scope.deleteDatabaseLoading = true;
|
||||||
$scope.fetchedDatabases = true;
|
$scope.fetchedDatabases = true;
|
||||||
$scope.databaseDeletionFailed = false;
|
$scope.databaseDeletionFailed = false;
|
||||||
@@ -344,8 +346,7 @@ app.controller('listDBs', function ($scope, $http) {
|
|||||||
$scope.dbLoading = true;
|
$scope.dbLoading = true;
|
||||||
$scope.domainFeteched = $scope.selectedDomain;
|
$scope.domainFeteched = $scope.selectedDomain;
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$scope.notificationsBox = false;
|
$scope.notificationsBox = false;
|
||||||
$scope.canNotChangePassword = false;
|
$scope.canNotChangePassword = false;
|
||||||
$scope.dbLoading = true;
|
$scope.dbLoading = true;
|
||||||
@@ -411,8 +412,7 @@ app.controller('listDBs', function ($scope, $http) {
|
|||||||
|
|
||||||
$scope.domainFeteched = $scope.selectedDomain;
|
$scope.domainFeteched = $scope.selectedDomain;
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$scope.recordsFetched = true;
|
$scope.recordsFetched = true;
|
||||||
$scope.passwordChanged = true;
|
$scope.passwordChanged = true;
|
||||||
$scope.canNotChangePassword = true;
|
$scope.canNotChangePassword = true;
|
||||||
@@ -481,8 +481,7 @@ app.controller('listDBs', function ($scope, $http) {
|
|||||||
|
|
||||||
$scope.dbHost = response.data.dbHost;
|
$scope.dbHost = response.data.dbHost;
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
new PNotify({
|
new PNotify({
|
||||||
title: 'Operation Failed!',
|
title: 'Operation Failed!',
|
||||||
text: response.data.error_message,
|
text: response.data.error_message,
|
||||||
@@ -537,8 +536,7 @@ app.controller('listDBs', function ($scope, $http) {
|
|||||||
type: 'success'
|
type: 'success'
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
new PNotify({
|
new PNotify({
|
||||||
title: 'Operation Failed!',
|
title: 'Operation Failed!',
|
||||||
text: response.data.error_message,
|
text: response.data.error_message,
|
||||||
@@ -570,7 +568,7 @@ app.controller('listDBs', function ($scope, $http) {
|
|||||||
app.controller('phpMyAdmin', function ($scope, $http, $window) {
|
app.controller('phpMyAdmin', function ($scope, $http, $window) {
|
||||||
$scope.cyberPanelLoading = true;
|
$scope.cyberPanelLoading = true;
|
||||||
|
|
||||||
$scope.generateAccess = function() {
|
$scope.generateAccess = function () {
|
||||||
|
|
||||||
$scope.cyberPanelLoading = false;
|
$scope.cyberPanelLoading = false;
|
||||||
|
|
||||||
@@ -593,12 +591,14 @@ app.controller('phpMyAdmin', function ($scope, $http, $window) {
|
|||||||
if (response.data.status === 1) {
|
if (response.data.status === 1) {
|
||||||
var rUrl = '/phpmyadmin/phpmyadminsignin.php?username=' + response.data.username + '&token=' + response.data.token;
|
var rUrl = '/phpmyadmin/phpmyadminsignin.php?username=' + response.data.username + '&token=' + response.data.token;
|
||||||
$window.location.href = rUrl;
|
$window.location.href = rUrl;
|
||||||
|
} else {
|
||||||
}
|
}
|
||||||
else {}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function cantLoadInitialDatas(response) {$scope.cyberPanelLoading = true;}
|
function cantLoadInitialDatas(response) {
|
||||||
|
$scope.cyberPanelLoading = true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">{% trans "Select Website" %}</label>
|
<label class="col-sm-3 control-label">{% trans "Select Website" %}</label>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<select ng-change="showDetailsBoxes()" ng-model="databaseWebsite" class="form-control">
|
<select id="create-database-select" ng-model="databaseWebsite" class="form-control">
|
||||||
{% for items in websitesList %}
|
{% for items in websitesList %}
|
||||||
<option>{{ items }}</option>
|
<option>{{ items }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -35,24 +35,23 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group dbDetails">
|
||||||
<div ng-hide="dbDetails" class="form-group">
|
|
||||||
<label class="col-sm-3 control-label">{% trans "Database Name" %}</label>
|
<label class="col-sm-3 control-label">{% trans "Database Name" %}</label>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input name="dom" type="text" class="form-control" ng-model="dbName" required>
|
<input name="dom" type="text" class="form-control" ng-model="dbName" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="current-pack">{$databaseWebsite|getwebsitename$}_{$ dbName $}</div>
|
<div class="current-pack"><span id="domainDatabase"></span>_{$ dbName $}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div ng-hide="dbDetails" class="form-group">
|
<div class="form-group dbDetails">
|
||||||
<label class="col-sm-3 control-label">{% trans "User Name" %}</label>
|
<label class="col-sm-3 control-label">{% trans "User Name" %}</label>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input type="text" name="email" class="form-control" ng-model="dbUsername" required>
|
<input type="text" name="email" class="form-control" ng-model="dbUsername" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="current-pack">{$databaseWebsite|getwebsitename$}_{$ dbUsername $}</div>
|
<div class="current-pack"><span id="domainUsername"></span>_{$ dbUsername $}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div ng-hide="dbDetails" class="form-group">
|
<div class="form-group dbDetails">
|
||||||
<label class="col-sm-3 control-label">{% trans "Password" %}</label>
|
<label class="col-sm-3 control-label">{% trans "Password" %}</label>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input type="password" name="email" class="form-control" ng-model="dbPassword" required>
|
<input type="password" name="email" class="form-control" ng-model="dbPassword" required>
|
||||||
@@ -62,7 +61,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div ng-hide="generatedPasswordView" class="form-group">
|
<div class="form-group generatedPasswordDetails">
|
||||||
<label class="col-sm-3 control-label">{% trans "Generated Password" %}</label>
|
<label class="col-sm-3 control-label">{% trans "Generated Password" %}</label>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input type="text" name="email" class="form-control" ng-model="dbPassword" required>
|
<input type="text" name="email" class="form-control" ng-model="dbPassword" required>
|
||||||
@@ -73,37 +72,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div ng-hide="dbDetails" class="form-group">
|
<div class="form-group dbDetails">
|
||||||
<label class="col-sm-3 control-label"></label>
|
<label class="col-sm-3 control-label"></label>
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
<button type="button" ng-click="createDatabase()" class="btn btn-primary btn-lg">{% trans "Create Database" %}</button>
|
<button type="button" ng-click="createDatabase()" class="btn btn-primary btn-lg">{% trans "Create Database" %}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label"></label>
|
|
||||||
<div class="col-sm-4">
|
|
||||||
<div ng-hide="databaseCreationFailed" class="alert alert-danger">
|
|
||||||
<p>{% trans "Cannot create database. Error message:" %} {$ errorMessage $}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div ng-hide="databaseCreated" class="alert alert-success">
|
|
||||||
<p>{% trans "Database created successfully." %}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div ng-hide="couldNotConnect" class="alert alert-danger">
|
|
||||||
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,22 +6,22 @@
|
|||||||
/* Java script code to create account */
|
/* Java script code to create account */
|
||||||
app.controller('createFTPAccount', function ($scope, $http) {
|
app.controller('createFTPAccount', function ($scope, $http) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$(document).ready(function () {
|
||||||
|
$( ".ftpDetails" ).hide();
|
||||||
|
$( ".ftpPasswordView" ).hide();
|
||||||
|
$('.create-ftp-acct-select').select2();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.create-ftp-acct-select').on('select2:select', function (e) {
|
||||||
|
var data = e.params.data;
|
||||||
|
$scope.ftpDomain = data.text;
|
||||||
|
$( ".ftpDetails" ).show();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
$scope.ftpLoading = true;
|
$scope.ftpLoading = true;
|
||||||
$scope.ftpDetails = true;
|
|
||||||
$scope.canNotCreate = true;
|
|
||||||
$scope.successfullyCreated = true;
|
|
||||||
$scope.couldNotConnect = true;
|
|
||||||
|
|
||||||
$scope.showFTPDetails = function () {
|
|
||||||
|
|
||||||
$scope.ftpLoading = true;
|
|
||||||
$scope.ftpDetails = false;
|
|
||||||
$scope.canNotCreate = true;
|
|
||||||
$scope.successfullyCreated = true;
|
|
||||||
$scope.couldNotConnect = true;
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.createFTPAccount = function () {
|
$scope.createFTPAccount = function () {
|
||||||
|
|
||||||
@@ -62,37 +62,35 @@ app.controller('createFTPAccount', function ($scope, $http) {
|
|||||||
function ListInitialDatas(response) {
|
function ListInitialDatas(response) {
|
||||||
|
|
||||||
|
|
||||||
if (response.data.creatFTPStatus == 1) {
|
if (response.data.creatFTPStatus === 1) {
|
||||||
|
|
||||||
$scope.ftpLoading = true;
|
$scope.ftpLoading = true;
|
||||||
$scope.ftpDetails = false;
|
new PNotify({
|
||||||
$scope.canNotCreate = true;
|
title: 'Success!',
|
||||||
$scope.successfullyCreated = false;
|
text: 'FTP account successfully created.',
|
||||||
$scope.couldNotConnect = true;
|
type: 'success'
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$scope.ftpLoading = true;
|
$scope.ftpLoading = true;
|
||||||
$scope.ftpDetails = false;
|
new PNotify({
|
||||||
$scope.canNotCreate = false;
|
title: 'Operation Failed!',
|
||||||
$scope.successfullyCreated = true;
|
text: response.data.error_message,
|
||||||
$scope.couldNotConnect = true;
|
type: 'error'
|
||||||
|
});
|
||||||
$scope.errorMessage = response.data.error_message;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function cantLoadInitialDatas(response) {
|
function cantLoadInitialDatas(response) {
|
||||||
|
|
||||||
$scope.ftpLoading = true;
|
$scope.ftpLoading = true;
|
||||||
$scope.ftpDetails = false;
|
new PNotify({
|
||||||
$scope.canNotCreate = true;
|
title: 'Operation Failed!',
|
||||||
$scope.successfullyCreated = true;
|
text: 'Could not connect to server, please refresh this page',
|
||||||
$scope.couldNotConnect = false;
|
type: 'error'
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -109,15 +107,13 @@ app.controller('createFTPAccount', function ($scope, $http) {
|
|||||||
|
|
||||||
///
|
///
|
||||||
|
|
||||||
$scope.generatedPasswordView = true;
|
|
||||||
|
|
||||||
$scope.generatePassword = function () {
|
$scope.generatePassword = function () {
|
||||||
$scope.generatedPasswordView = false;
|
$( ".ftpPasswordView" ).show();
|
||||||
$scope.ftpPassword = randomPassword(16);
|
$scope.ftpPassword = randomPassword(16);
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.usePassword = function () {
|
$scope.usePassword = function () {
|
||||||
$scope.generatedPasswordView = true;
|
$(".ftpPasswordView" ).hide();
|
||||||
};
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">{% trans "Select Website" %} </label>
|
<label class="col-sm-3 control-label">{% trans "Select Website" %} </label>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<select ng-change="showFTPDetails()" ng-model="ftpDomain" class="form-control">
|
<select class="create-ftp-acct-select" ng-model="ftpDomain" class="form-control">
|
||||||
{% for items in websiteList %}
|
{% for items in websiteList %}
|
||||||
<option>{{ items }}</option>
|
<option>{{ items }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
<!------ Modification form that appears after a click --------------->
|
<!------ Modification form that appears after a click --------------->
|
||||||
|
|
||||||
|
|
||||||
<div ng-hide="ftpDetails" class="form-group">
|
<div class="form-group ftpDetails">
|
||||||
<label class="col-sm-3 control-label">{% trans "User Name" %}</label>
|
<label class="col-sm-3 control-label">{% trans "User Name" %}</label>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input ng-change="hideFewDetails()" type="text" class="form-control"
|
<input ng-change="hideFewDetails()" type="text" class="form-control"
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div ng-hide="ftpDetails" class="form-group">
|
<div class="form-group ftpDetails">
|
||||||
<label class="col-sm-3 control-label">{% trans "FTP Password" %}</label>
|
<label class="col-sm-3 control-label">{% trans "FTP Password" %}</label>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input type="password" class="form-control" ng-model="ftpPassword" required>
|
<input type="password" class="form-control" ng-model="ftpPassword" required>
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div ng-hide="generatedPasswordView" class="form-group">
|
<div class="form-group ftpPasswordView">
|
||||||
<label class="col-sm-3 control-label">{% trans "Generated Password" %}</label>
|
<label class="col-sm-3 control-label">{% trans "Generated Password" %}</label>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input type="text" name="email" class="form-control" ng-model="ftpPassword"
|
<input type="text" name="email" class="form-control" ng-model="ftpPassword"
|
||||||
@@ -86,7 +86,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div ng-hide="ftpDetails" class="form-group">
|
<div ng-hide="ftpDetails" class="form-group ftpDetails">
|
||||||
<label class="col-sm-3 control-label">{% trans "Path (Relative)" %}</label>
|
<label class="col-sm-3 control-label">{% trans "Path (Relative)" %}</label>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input placeholder="{% trans 'Leave empty to select default home directory.' %}"
|
<input placeholder="{% trans 'Leave empty to select default home directory.' %}"
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
<!------ Modification form that appears after a click --------------->
|
<!------ Modification form that appears after a click --------------->
|
||||||
|
|
||||||
|
|
||||||
<div ng-hide="ftpDetails" class="form-group">
|
<div class="form-group dbDetails">
|
||||||
<label class="col-sm-3 control-label"></label>
|
<label class="col-sm-3 control-label"></label>
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
<button type="button" ng-click="createFTPAccount()"
|
<button type="button" ng-click="createFTPAccount()"
|
||||||
@@ -106,29 +106,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-3 control-label"></label>
|
|
||||||
<div class="col-sm-6">
|
|
||||||
<div ng-hide="canNotCreate" class="alert alert-danger">
|
|
||||||
<p>{% trans "Cannot create FTP account. Error message:" %} {$ errorMessage
|
|
||||||
$}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div ng-hide="successfullyCreated" class="alert alert-success">
|
|
||||||
<p>{% trans "FTP Account with username:" %} {$ ftpUserName
|
|
||||||
$} {% trans "is successfully created." %}</p>
|
|
||||||
</div>
|
|
||||||
<div ng-hide="couldNotConnect" class="alert alert-success">
|
|
||||||
<p>{% trans "FTP Account with username:" %} {$ ftpUserName
|
|
||||||
$} {% trans "is successfully created." %}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -409,35 +409,34 @@ class ACLManager:
|
|||||||
websiteNames = []
|
websiteNames = []
|
||||||
|
|
||||||
if currentACL['admin'] == 1:
|
if currentACL['admin'] == 1:
|
||||||
allWebsites = Websites.objects.all()
|
allWebsites = Websites.objects.all().order_by('domain')
|
||||||
|
|
||||||
for items in allWebsites:
|
for items in allWebsites:
|
||||||
websiteNames.append(items.domain)
|
websiteNames.append(items.domain)
|
||||||
|
|
||||||
if fetchChilds:
|
if fetchChilds:
|
||||||
for child in items.childdomains_set.all():
|
for child in items.childdomains_set.all().order_by('domain'):
|
||||||
websiteNames.append(child.domain)
|
websiteNames.append(child.domain)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
admin = Administrator.objects.get(pk=userID)
|
admin = Administrator.objects.get(pk=userID)
|
||||||
|
|
||||||
websites = admin.websites_set.all()
|
websites = admin.websites_set.all().order_by('domain')
|
||||||
admins = Administrator.objects.filter(owner=admin.pk)
|
admins = Administrator.objects.filter(owner=admin.pk)
|
||||||
|
|
||||||
for items in websites:
|
for items in websites:
|
||||||
websiteNames.append(items.domain)
|
websiteNames.append(items.domain)
|
||||||
|
|
||||||
if fetchChilds:
|
if fetchChilds:
|
||||||
for child in items.childdomains_set.all():
|
for child in items.childdomains_set.all().order_by('domain'):
|
||||||
websiteNames.append(child.domain)
|
websiteNames.append(child.domain)
|
||||||
|
|
||||||
for items in admins:
|
for items in admins:
|
||||||
webs = items.websites_set.all()
|
webs = items.websites_set.all().order_by('domain')
|
||||||
for web in webs:
|
for web in webs:
|
||||||
websiteNames.append(web.domain)
|
websiteNames.append(web.domain)
|
||||||
|
|
||||||
if fetchChilds:
|
if fetchChilds:
|
||||||
for child in web.childdomains_set.all():
|
for child in web.childdomains_set.all().order_by('domain'):
|
||||||
websiteNames.append(child.domain)
|
websiteNames.append(child.domain)
|
||||||
|
|
||||||
|
|
||||||
@@ -469,13 +468,13 @@ class ACLManager:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def findWebsiteObjects(currentACL, userID):
|
def findWebsiteObjects(currentACL, userID):
|
||||||
if currentACL['admin'] == 1:
|
if currentACL['admin'] == 1:
|
||||||
return Websites.objects.all()
|
return Websites.objects.all().order_by('domain')
|
||||||
else:
|
else:
|
||||||
|
|
||||||
websiteList = []
|
websiteList = []
|
||||||
admin = Administrator.objects.get(pk=userID)
|
admin = Administrator.objects.get(pk=userID)
|
||||||
|
|
||||||
websites = admin.websites_set.all()
|
websites = admin.websites_set.all().order_by('domain')
|
||||||
|
|
||||||
for items in websites:
|
for items in websites:
|
||||||
websiteList.append(items)
|
websiteList.append(items)
|
||||||
@@ -483,7 +482,7 @@ class ACLManager:
|
|||||||
admins = Administrator.objects.filter(owner=admin.pk)
|
admins = Administrator.objects.filter(owner=admin.pk)
|
||||||
|
|
||||||
for items in admins:
|
for items in admins:
|
||||||
webs = items.websites_set.all()
|
webs = items.websites_set.all().order_by('domain')
|
||||||
for web in webs:
|
for web in webs:
|
||||||
websiteList.append(web)
|
websiteList.append(web)
|
||||||
|
|
||||||
@@ -494,12 +493,12 @@ class ACLManager:
|
|||||||
domainsList = []
|
domainsList = []
|
||||||
|
|
||||||
if currentACL['admin'] == 1:
|
if currentACL['admin'] == 1:
|
||||||
domains = Websites.objects.all()
|
domains = Websites.objects.all().order_by('domain')
|
||||||
for items in domains:
|
for items in domains:
|
||||||
domainsList.append(items.domain)
|
domainsList.append(items.domain)
|
||||||
else:
|
else:
|
||||||
admin = Administrator.objects.get(pk=userID)
|
admin = Administrator.objects.get(pk=userID)
|
||||||
domains = admin.websites_set.all()
|
domains = admin.websites_set.all().order_by('domain')
|
||||||
|
|
||||||
for items in domains:
|
for items in domains:
|
||||||
domainsList.append(items.domain)
|
domainsList.append(items.domain)
|
||||||
@@ -507,7 +506,7 @@ class ACLManager:
|
|||||||
admins = Administrator.objects.filter(owner=admin.pk)
|
admins = Administrator.objects.filter(owner=admin.pk)
|
||||||
|
|
||||||
for items in admins:
|
for items in admins:
|
||||||
doms = items.websites_set.all()
|
doms = items.websites_set.all().order_by('domain')
|
||||||
for dom in doms:
|
for dom in doms:
|
||||||
domainsList.append(dom.domain)
|
domainsList.append(dom.domain)
|
||||||
|
|
||||||
@@ -518,12 +517,12 @@ class ACLManager:
|
|||||||
domainsList = []
|
domainsList = []
|
||||||
|
|
||||||
if currentACL['admin'] == 1:
|
if currentACL['admin'] == 1:
|
||||||
domains = Websites.objects.order_by('domain').all()
|
domains = Websites.objects.all().order_by('domain')
|
||||||
for items in domains:
|
for items in domains:
|
||||||
domainsList.append(items.domain)
|
domainsList.append(items.domain)
|
||||||
else:
|
else:
|
||||||
admin = Administrator.objects.get(pk=userID)
|
admin = Administrator.objects.get(pk=userID)
|
||||||
domains = admin.websites_set.all()
|
domains = admin.websites_set.all().order_by('domain')
|
||||||
|
|
||||||
for items in domains:
|
for items in domains:
|
||||||
domainsList.append(items.domain)
|
domainsList.append(items.domain)
|
||||||
@@ -531,7 +530,7 @@ class ACLManager:
|
|||||||
admins = Administrator.objects.filter(owner=admin.pk)
|
admins = Administrator.objects.filter(owner=admin.pk)
|
||||||
|
|
||||||
for items in admins:
|
for items in admins:
|
||||||
doms = items.websites_set.all()
|
doms = items.websites_set.all().order_by('domain')
|
||||||
for dom in doms:
|
for dom in doms:
|
||||||
domainsList.append(dom.domain)
|
domainsList.append(dom.domain)
|
||||||
return domainsList
|
return domainsList
|
||||||
@@ -675,7 +674,7 @@ class ACLManager:
|
|||||||
|
|
||||||
for items in websiteNames:
|
for items in websiteNames:
|
||||||
website = Websites.objects.get(domain = items)
|
website = Websites.objects.get(domain = items)
|
||||||
for childDomain in website.childdomains_set.all():
|
for childDomain in website.childdomains_set.all().order_by('domain'):
|
||||||
childDomains.append(childDomain.domain)
|
childDomains.append(childDomain.domain)
|
||||||
|
|
||||||
return childDomains
|
return childDomains
|
||||||
|
|||||||
@@ -98,6 +98,23 @@ app.filter('getwebsitename', function () {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function getWebsiteName(domain){
|
||||||
|
if (domain !== undefined) {
|
||||||
|
|
||||||
|
domain = domain.replace(/-/g, '');
|
||||||
|
|
||||||
|
var domainName = domain.split(".");
|
||||||
|
|
||||||
|
var finalDomainName = domainName[0];
|
||||||
|
|
||||||
|
if (finalDomainName.length > 5) {
|
||||||
|
finalDomainName = finalDomainName.substring(0, 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
return finalDomainName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
app.controller('systemStatusInfo', function ($scope, $http, $timeout) {
|
app.controller('systemStatusInfo', function ($scope, $http, $timeout) {
|
||||||
|
|
||||||
//getStuff();
|
//getStuff();
|
||||||
|
|||||||
@@ -6,25 +6,31 @@
|
|||||||
/* Java script code to create database */
|
/* Java script code to create database */
|
||||||
app.controller('createDatabase', function ($scope, $http) {
|
app.controller('createDatabase', function ($scope, $http) {
|
||||||
|
|
||||||
$scope.createDatabaseLoading = true;
|
$(document).ready(function () {
|
||||||
$scope.dbDetails = true;
|
$(".dbDetails").hide();
|
||||||
$scope.databaseCreationFailed = true;
|
$(".generatedPasswordDetails").hide();
|
||||||
$scope.databaseCreated = true;
|
$('#create-database-select').select2();
|
||||||
$scope.couldNotConnect = true;
|
});
|
||||||
$scope.generatedPasswordView = true;
|
|
||||||
|
$('#create-database-select').on('select2:select', function (e) {
|
||||||
|
var data = e.params.data;
|
||||||
|
$scope.databaseWebsite = data.text;
|
||||||
|
$(".dbDetails").show();
|
||||||
|
$("#domainDatabase").text(getWebsiteName(data.text));
|
||||||
|
$("#domainUsername").text(getWebsiteName(data.text));
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
$scope.showDetailsBoxes = function () {
|
$scope.showDetailsBoxes = function () {
|
||||||
$scope.dbDetails = false;
|
$scope.dbDetails = false;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
$scope.createDatabaseLoading = true;
|
||||||
|
|
||||||
$scope.createDatabase = function () {
|
$scope.createDatabase = function () {
|
||||||
|
|
||||||
$scope.createDatabaseLoading = false;
|
$scope.createDatabaseLoading = false;
|
||||||
$scope.dbDetails = false;
|
$scope.dbDetails = false;
|
||||||
$scope.databaseCreationFailed = true;
|
|
||||||
$scope.databaseCreated = true;
|
|
||||||
$scope.couldNotConnect = true;
|
|
||||||
|
|
||||||
|
|
||||||
var databaseWebsite = $scope.databaseWebsite;
|
var databaseWebsite = $scope.databaseWebsite;
|
||||||
@@ -65,26 +71,24 @@ app.controller('createDatabase', function ($scope, $http) {
|
|||||||
function ListInitialDatas(response) {
|
function ListInitialDatas(response) {
|
||||||
|
|
||||||
|
|
||||||
if (response.data.createDBStatus == 1) {
|
if (response.data.createDBStatus === 1) {
|
||||||
|
|
||||||
$scope.createDatabaseLoading = true;
|
$scope.createDatabaseLoading = true;
|
||||||
$scope.dbDetails = false;
|
$scope.dbDetails = false;
|
||||||
$scope.databaseCreationFailed = true;
|
new PNotify({
|
||||||
$scope.databaseCreated = false;
|
title: 'Success!',
|
||||||
$scope.couldNotConnect = true;
|
text: 'Database successfully created.',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else {
|
|
||||||
|
|
||||||
|
|
||||||
$scope.createDatabaseLoading = true;
|
$scope.createDatabaseLoading = true;
|
||||||
$scope.dbDetails = false;
|
$scope.dbDetails = false;
|
||||||
$scope.databaseCreationFailed = false;
|
new PNotify({
|
||||||
$scope.databaseCreated = true;
|
title: 'Operation Failed!',
|
||||||
$scope.couldNotConnect = true;
|
text: response.data.error_message,
|
||||||
$scope.errorMessage = response.data.error_message;
|
type: 'error'
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -96,21 +100,23 @@ app.controller('createDatabase', function ($scope, $http) {
|
|||||||
|
|
||||||
$scope.createDatabaseLoading = true;
|
$scope.createDatabaseLoading = true;
|
||||||
$scope.dbDetails = true;
|
$scope.dbDetails = true;
|
||||||
$scope.databaseCreationFailed = true;
|
new PNotify({
|
||||||
$scope.databaseCreated = true;
|
title: 'Operation Failed!',
|
||||||
$scope.couldNotConnect = false;
|
text: 'Could not connect to server, please refresh this page',
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.generatePassword = function () {
|
$scope.generatePassword = function () {
|
||||||
$scope.generatedPasswordView = false;
|
$(".generatedPasswordDetails").show();
|
||||||
$scope.dbPassword = randomPassword(16);
|
$scope.dbPassword = randomPassword(16);
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.usePassword = function () {
|
$scope.usePassword = function () {
|
||||||
$scope.generatedPasswordView = true;
|
$(".generatedPasswordDetails").hide();
|
||||||
};
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -170,9 +176,7 @@ app.controller('deleteDatabase', function ($scope, $http) {
|
|||||||
$scope.couldNotConnect = true;
|
$scope.couldNotConnect = true;
|
||||||
|
|
||||||
|
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else {
|
|
||||||
$scope.deleteDatabaseLoading = true;
|
$scope.deleteDatabaseLoading = true;
|
||||||
$scope.fetchedDatabases = true;
|
$scope.fetchedDatabases = true;
|
||||||
$scope.databaseDeletionFailed = false;
|
$scope.databaseDeletionFailed = false;
|
||||||
@@ -240,9 +244,7 @@ app.controller('deleteDatabase', function ($scope, $http) {
|
|||||||
$scope.couldNotConnect = true;
|
$scope.couldNotConnect = true;
|
||||||
|
|
||||||
|
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else {
|
|
||||||
$scope.deleteDatabaseLoading = true;
|
$scope.deleteDatabaseLoading = true;
|
||||||
$scope.fetchedDatabases = true;
|
$scope.fetchedDatabases = true;
|
||||||
$scope.databaseDeletionFailed = false;
|
$scope.databaseDeletionFailed = false;
|
||||||
@@ -344,8 +346,7 @@ app.controller('listDBs', function ($scope, $http) {
|
|||||||
$scope.dbLoading = true;
|
$scope.dbLoading = true;
|
||||||
$scope.domainFeteched = $scope.selectedDomain;
|
$scope.domainFeteched = $scope.selectedDomain;
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$scope.notificationsBox = false;
|
$scope.notificationsBox = false;
|
||||||
$scope.canNotChangePassword = false;
|
$scope.canNotChangePassword = false;
|
||||||
$scope.dbLoading = true;
|
$scope.dbLoading = true;
|
||||||
@@ -411,8 +412,7 @@ app.controller('listDBs', function ($scope, $http) {
|
|||||||
|
|
||||||
$scope.domainFeteched = $scope.selectedDomain;
|
$scope.domainFeteched = $scope.selectedDomain;
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$scope.recordsFetched = true;
|
$scope.recordsFetched = true;
|
||||||
$scope.passwordChanged = true;
|
$scope.passwordChanged = true;
|
||||||
$scope.canNotChangePassword = true;
|
$scope.canNotChangePassword = true;
|
||||||
@@ -481,8 +481,7 @@ app.controller('listDBs', function ($scope, $http) {
|
|||||||
|
|
||||||
$scope.dbHost = response.data.dbHost;
|
$scope.dbHost = response.data.dbHost;
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
new PNotify({
|
new PNotify({
|
||||||
title: 'Operation Failed!',
|
title: 'Operation Failed!',
|
||||||
text: response.data.error_message,
|
text: response.data.error_message,
|
||||||
@@ -537,8 +536,7 @@ app.controller('listDBs', function ($scope, $http) {
|
|||||||
type: 'success'
|
type: 'success'
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
new PNotify({
|
new PNotify({
|
||||||
title: 'Operation Failed!',
|
title: 'Operation Failed!',
|
||||||
text: response.data.error_message,
|
text: response.data.error_message,
|
||||||
@@ -570,7 +568,7 @@ app.controller('listDBs', function ($scope, $http) {
|
|||||||
app.controller('phpMyAdmin', function ($scope, $http, $window) {
|
app.controller('phpMyAdmin', function ($scope, $http, $window) {
|
||||||
$scope.cyberPanelLoading = true;
|
$scope.cyberPanelLoading = true;
|
||||||
|
|
||||||
$scope.generateAccess = function() {
|
$scope.generateAccess = function () {
|
||||||
|
|
||||||
$scope.cyberPanelLoading = false;
|
$scope.cyberPanelLoading = false;
|
||||||
|
|
||||||
@@ -593,12 +591,14 @@ app.controller('phpMyAdmin', function ($scope, $http, $window) {
|
|||||||
if (response.data.status === 1) {
|
if (response.data.status === 1) {
|
||||||
var rUrl = '/phpmyadmin/phpmyadminsignin.php?username=' + response.data.username + '&token=' + response.data.token;
|
var rUrl = '/phpmyadmin/phpmyadminsignin.php?username=' + response.data.username + '&token=' + response.data.token;
|
||||||
$window.location.href = rUrl;
|
$window.location.href = rUrl;
|
||||||
|
} else {
|
||||||
}
|
}
|
||||||
else {}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function cantLoadInitialDatas(response) {$scope.cyberPanelLoading = true;}
|
function cantLoadInitialDatas(response) {
|
||||||
|
$scope.cyberPanelLoading = true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,22 +6,22 @@
|
|||||||
/* Java script code to create account */
|
/* Java script code to create account */
|
||||||
app.controller('createFTPAccount', function ($scope, $http) {
|
app.controller('createFTPAccount', function ($scope, $http) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$(document).ready(function () {
|
||||||
|
$( ".ftpDetails" ).hide();
|
||||||
|
$( ".ftpPasswordView" ).hide();
|
||||||
|
$('.create-ftp-acct-select').select2();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.create-ftp-acct-select').on('select2:select', function (e) {
|
||||||
|
var data = e.params.data;
|
||||||
|
$scope.ftpDomain = data.text;
|
||||||
|
$( ".ftpDetails" ).show();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
$scope.ftpLoading = true;
|
$scope.ftpLoading = true;
|
||||||
$scope.ftpDetails = true;
|
|
||||||
$scope.canNotCreate = true;
|
|
||||||
$scope.successfullyCreated = true;
|
|
||||||
$scope.couldNotConnect = true;
|
|
||||||
|
|
||||||
$scope.showFTPDetails = function () {
|
|
||||||
|
|
||||||
$scope.ftpLoading = true;
|
|
||||||
$scope.ftpDetails = false;
|
|
||||||
$scope.canNotCreate = true;
|
|
||||||
$scope.successfullyCreated = true;
|
|
||||||
$scope.couldNotConnect = true;
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.createFTPAccount = function () {
|
$scope.createFTPAccount = function () {
|
||||||
|
|
||||||
@@ -62,37 +62,35 @@ app.controller('createFTPAccount', function ($scope, $http) {
|
|||||||
function ListInitialDatas(response) {
|
function ListInitialDatas(response) {
|
||||||
|
|
||||||
|
|
||||||
if (response.data.creatFTPStatus == 1) {
|
if (response.data.creatFTPStatus === 1) {
|
||||||
|
|
||||||
$scope.ftpLoading = true;
|
$scope.ftpLoading = true;
|
||||||
$scope.ftpDetails = false;
|
new PNotify({
|
||||||
$scope.canNotCreate = true;
|
title: 'Success!',
|
||||||
$scope.successfullyCreated = false;
|
text: 'FTP account successfully created.',
|
||||||
$scope.couldNotConnect = true;
|
type: 'success'
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$scope.ftpLoading = true;
|
$scope.ftpLoading = true;
|
||||||
$scope.ftpDetails = false;
|
new PNotify({
|
||||||
$scope.canNotCreate = false;
|
title: 'Operation Failed!',
|
||||||
$scope.successfullyCreated = true;
|
text: response.data.error_message,
|
||||||
$scope.couldNotConnect = true;
|
type: 'error'
|
||||||
|
});
|
||||||
$scope.errorMessage = response.data.error_message;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function cantLoadInitialDatas(response) {
|
function cantLoadInitialDatas(response) {
|
||||||
|
|
||||||
$scope.ftpLoading = true;
|
$scope.ftpLoading = true;
|
||||||
$scope.ftpDetails = false;
|
new PNotify({
|
||||||
$scope.canNotCreate = true;
|
title: 'Operation Failed!',
|
||||||
$scope.successfullyCreated = true;
|
text: 'Could not connect to server, please refresh this page',
|
||||||
$scope.couldNotConnect = false;
|
type: 'error'
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -109,15 +107,13 @@ app.controller('createFTPAccount', function ($scope, $http) {
|
|||||||
|
|
||||||
///
|
///
|
||||||
|
|
||||||
$scope.generatedPasswordView = true;
|
|
||||||
|
|
||||||
$scope.generatePassword = function () {
|
$scope.generatePassword = function () {
|
||||||
$scope.generatedPasswordView = false;
|
$( ".ftpPasswordView" ).show();
|
||||||
$scope.ftpPassword = randomPassword(16);
|
$scope.ftpPassword = randomPassword(16);
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.usePassword = function () {
|
$scope.usePassword = function () {
|
||||||
$scope.generatedPasswordView = true;
|
$(".ftpPasswordView" ).hide();
|
||||||
};
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -140,8 +140,7 @@ class WebsiteManager:
|
|||||||
else:
|
else:
|
||||||
return ACLManager.loadError()
|
return ACLManager.loadError()
|
||||||
|
|
||||||
websitesName = ACLManager.findAllSites(currentACL, userID)
|
return render(request, 'websiteFunctions/listCron.html', {'domain': request.GET.get('domain')})
|
||||||
return render(request, 'websiteFunctions/listCron.html', {'domain': request.GET.get('domain'), 'websiteList': websitesName})
|
|
||||||
except BaseException as msg:
|
except BaseException as msg:
|
||||||
return HttpResponse(str(msg))
|
return HttpResponse(str(msg))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user