fix(polling): resolve mixed-content HTTP blocking and cache prevention for real-time polling

This commit is contained in:
Ray1111-aa
2026-10-29 14:40:11 +07:00
parent f7b92a1c71
commit b0469611d7
7 changed files with 17 additions and 9 deletions
+3 -2
View File
@@ -1162,10 +1162,11 @@
isPollingInProgress = true;
try {
const response = await fetch(`{{ route('employee.activity.status_polling') }}?activity_id=${activityId}`, {
const response = await fetch(`{{ route('employee.activity.status_polling', [], false) }}?activity_id=${activityId}&_t=${Date.now()}`, {
headers: {
'Accept': 'application/json',
'X-Requested-With': 'XMLHttpRequest'
'X-Requested-With': 'XMLHttpRequest',
'Cache-Control': 'no-cache'
}
});
+2 -2
View File
@@ -560,11 +560,11 @@
const pdfBtn = document.getElementById('modalDownloadPdfBtn');
const tableBody = document.getElementById('modalItemsTableBody');
pdfBtn.href = "{{ url('/karyawan/riwayat/p2h') }}/" + recordId + "/pdf";
pdfBtn.href = "{{ url('/karyawan/riwayat/p2h', [], false) }}/" + recordId + "/pdf";
tableBody.innerHTML = '<tr><td colspan="4" class="py-4 text-center text-slate-400">Memuat data...</td></tr>';
modal.classList.remove('hidden');
fetch("{{ url('/karyawan/riwayat/p2h') }}/" + recordId)
fetch("{{ url('/karyawan/riwayat/p2h', [], false) }}/" + recordId)
.then(res => {
if (!res.ok) throw new Error('Gagal memuat detail data.');
return res.json();
+4 -3
View File
@@ -344,10 +344,11 @@
isSyncing = true;
try {
const response = await fetch("{{ route('pg.gate.live_queue') }}?gate_id={{ $gate ? $gate->id : '' }}", {
const response = await fetch("{{ route('pg.gate.live_queue', [], false) }}?gate_id={{ $gate ? $gate->id : '' }}&_t=" + Date.now(), {
headers: {
'X-Requested-With': 'XMLHttpRequest',
'Accept': 'application/json'
'Accept': 'application/json',
'Cache-Control': 'no-cache'
}
});
@@ -404,7 +405,7 @@
// 3. Update Daftar Kartu Antrean Secara Halus (Hanya Jika Ada Perubahan)
const listContainer = document.getElementById('queueListContainer');
if (listContainer && lastQueueHtml !== null && lastQueueHtml !== data.html) {
if (listContainer && data.html && lastQueueHtml !== data.html) {
listContainer.innerHTML = data.html;
}