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();
    });
});


