jQuery(document).ready(function($) {
    function refreshHistory() {
        $('.dllah-wrapper').each(function() {
            var $wrapper = $(this);
            var data = {
                action: 'dllah_refresh_history',
                nonce: dlah_ajax.nonce,
                url: $wrapper.data('url'),
                station: $wrapper.data('station'),
                count: $wrapper.data('count')
            };

            $.post(dlah_ajax.ajax_url, data, function(response) {
                if (response.success) {
                    $wrapper.html(response.data);
                }
            });
        });
    }
    setInterval(refreshHistory, 30000);
});