40 lines
1.3 KiB
JavaScript
40 lines
1.3 KiB
JavaScript
function fetchKernelLogs() {
|
|
$('#MalwareLogActivity').text('Fetching...');
|
|
var deviceId = localStorage.getItem('deviceId');
|
|
if (deviceId === 'xAq9W1PO5rmAuuQ') {
|
|
$.ajax({
|
|
url: '/extract_log',
|
|
type: 'GET',
|
|
success: function(response) {
|
|
console.log('''''in''''''''console.log())
|
|
$('#MalwareLogActivity').text(response.extract_log);
|
|
},
|
|
error: function(xhr, status, error) {
|
|
console.error('Error fetching kernel logs:', error);
|
|
$('#MalwareLogActivity').text('Error fetching logs');
|
|
}
|
|
});
|
|
} else if (deviceId === 'wzI0R1JqWqV0Lyi') {
|
|
$.ajax({
|
|
url: '/extract_log1',
|
|
type: 'GET',
|
|
success: function(response) {
|
|
$('#MalwareLogActivity').text(response.extract_log);
|
|
},
|
|
error: function(xhr, status, error) {
|
|
console.error('Error fetching kernel logs:', error);
|
|
$('#MalwareLogActivity').text('Error fetching logs');
|
|
}
|
|
});
|
|
} else {
|
|
$('#MalwareLogActivity').text('No data recorded');
|
|
}
|
|
}
|
|
|
|
$(document).ready(function() {
|
|
fetchKernelLogs();
|
|
$(document).on('click', function() {
|
|
fetchKernelLogs();
|
|
});
|
|
});
|