fetch package details on ubuntu

This commit is contained in:
Usman Nasir
2020-05-04 00:52:34 +05:00
parent 27f43468f5
commit ef663f0be5
4 changed files with 95 additions and 24 deletions

View File

@@ -836,15 +836,9 @@ app.controller('listOSPackages', function ($scope, $http, $timeout) {
};
$scope.fetchPackages('upgrade');
$scope.killProcess = function (pid) {
$scope.cyberPanelLoading = false;
url = "/serverstatus/killProcess";
var data = {
pid: pid
};
$scope.fetchPackageDetails = function (package) {
$scope.cyberpanelLoading = false;
$scope.package = package;
var config = {
headers: {
@@ -852,30 +846,28 @@ app.controller('listOSPackages', function ($scope, $http, $timeout) {
}
};
var data = {
package: package
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
dataurl = "/serverstatus/fetchPackageDetails";
$http.post(dataurl, data, config).then(ListInitialData, cantLoadInitialData);
function ListInitialDatas(response) {
$scope.cyberPanelLoading = true;
function ListInitialData(response) {
$scope.cyberpanelLoading = true;
if (response.data.status === 1) {
new PNotify({
title: 'Success',
text: 'Process successfully killed.',
type: 'success'
});
$scope.packageDetails = response.data.packageDetails;
} else {
new PNotify({
title: 'Operation Failed!',
title: 'Error!',
text: response.data.error_message,
type: 'error'
});
}
}
function cantLoadInitialDatas(response) {
$scope.cyberPanelLoading = true;
function cantLoadInitialData(response) {
$scope.cyberpanelLoading = true;
new PNotify({
title: 'Operation Failed!',
text: 'Could not connect to server, please refresh this page',
@@ -883,6 +875,7 @@ app.controller('listOSPackages', function ($scope, $http, $timeout) {
});
}
};
});