feature: edit incremental backup plans

This commit is contained in:
Usman Nasir
2020-01-21 22:10:58 +05:00
parent 4e783f0a2f
commit be4b85cbe3
5 changed files with 251 additions and 2 deletions

View File

@@ -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'
});
}
}
});