mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 22:06:05 +01:00
feature: edit incremental backup plans
This commit is contained in:
@@ -1685,6 +1685,61 @@ app.controller('listTableUsers', function ($scope, $http) {
|
||||
|
||||
|
||||
};
|
||||
|
||||
$scope.controlUserState = function (userName, state) {
|
||||
$scope.cyberpanelLoading = false;
|
||||
|
||||
var url = "/users/controlUserState";
|
||||
|
||||
var data = {
|
||||
accountUsername: userName,
|
||||
state : state
|
||||
};
|
||||
|
||||
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: 'Action successfully started.',
|
||||
type: 'success'
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
new PNotify({
|
||||
title: 'Error!',
|
||||
text: response.data.error_message,
|
||||
type: 'error'
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.cyberpanelLoading = false;
|
||||
new PNotify({
|
||||
title: 'Error!',
|
||||
text: 'Could not connect to server, please refresh this page.',
|
||||
type: 'error'
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user