web_defender/static/dashboard/js/running-processes.js
2024-12-09 13:43:16 +05:30

38 lines
1.1 KiB
JavaScript

function fetchKernelLogs() {
var deviceId = localStorage.getItem('deviceId');
if (deviceId === 'xAq9W1PO5rmAuuQ') {
$.ajax({
url: '/processes_log',
type: 'GET',
success: function(response) {
$('#running-proccesses').text(response.processes_log);
},
error: function(xhr, status, error) {
console.error('Error fetching kernel logs:', error);
}
});
} else if (deviceId === 'wzI0R1JqWqV0Lyi'){
$.ajax({
url: '/processes_log1',
type: 'GET',
success: function(response) {
$('#running-proccesses').text(response.processes_log);
},
error: function(xhr, status, error) {
console.error('Error fetching kernel logs:', error);
}
});
} else {
$('#running-proccesses').text('No data recorded');
}
}
$(document).ready(function() {
fetchKernelLogs();
$(document).on('click', function() {
fetchKernelLogs();
});
});