mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 13:56:01 +01:00
allow cp port change, ref: https://feedback.cyberpanel.net/b/requests/p/change-port-change-default-username-add-recaptcha-in-login-page-or-change-url-login-page
This commit is contained in:
@@ -824,6 +824,7 @@ app.controller('listOSPackages', function ($scope, $http, $timeout) {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.cyberpanelLoading = true;
|
||||
new PNotify({
|
||||
@@ -867,6 +868,7 @@ app.controller('listOSPackages', function ($scope, $http, $timeout) {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.cyberpanelLoading = true;
|
||||
new PNotify({
|
||||
@@ -909,6 +911,7 @@ app.controller('listOSPackages', function ($scope, $http, $timeout) {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.cyberpanelLoading = true;
|
||||
new PNotify({
|
||||
@@ -997,6 +1000,7 @@ app.controller('listOSPackages', function ($scope, $http, $timeout) {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.cyberpanelLoading = true;
|
||||
new PNotify({
|
||||
@@ -1009,4 +1013,56 @@ app.controller('listOSPackages', function ($scope, $http, $timeout) {
|
||||
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
app.controller('changePort', function ($scope, $http, $timeout) {
|
||||
|
||||
$scope.cyberpanelLoading = true;
|
||||
|
||||
$scope.changeCPPort = function () {
|
||||
$scope.cyberpanelLoading = false;
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
var data = {
|
||||
port: $scope.port
|
||||
};
|
||||
|
||||
dataurl = "/serverstatus/submitPortChange";
|
||||
|
||||
$http.post(dataurl, data, config).then(ListInitialData, cantLoadInitialData);
|
||||
|
||||
function ListInitialData(response) {
|
||||
$scope.cyberpanelLoading = true;
|
||||
if (response.data.status === 1) {
|
||||
new PNotify({
|
||||
title: 'Success!',
|
||||
text: 'Port changed, open CyberPanel on new port.',
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
new PNotify({
|
||||
title: 'Error!',
|
||||
text: response.data.error_message,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.cyberpanelLoading = true;
|
||||
new PNotify({
|
||||
title: 'Success!',
|
||||
text: 'Port changed, open CyberPanel on new port.',
|
||||
type: 'success'
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user