Files
dealplustech/dist/admin/consent-logs/index.html
Kunthawat Greethong 3ed9f3f3ff 🎨 Fix CSS: Import global.css + plain CSS styles
CSS was not being imported! Fixed:

 Added 'import ../styles/global.css' to BaseLayout.astro
 Rewrote CSS with plain CSS (not @apply which wasn't working)
 Cookie banner has inline styles as backup
 Font size: 16px base
 Solid colors: green-600 (#16a34a), gray-900 (#111827)
 Footer has policy links

Build: 12 pages 
2026-03-10 08:21:30 +07:00

64 lines
3.9 KiB
HTML

<!DOCTYPE html><html lang="th" data-astro-cid-5yvbipfl> <head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Consent Logs | ดีล พลัส เทค Admin</title><link rel="icon" type="image/svg+xml" href="/favicon.svg"><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link href="https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&display=swap" rel="stylesheet"><style>html{font-family:Kanit,system-ui,sans-serif}
</style></head> <body class="bg-gray-100 min-h-screen" data-astro-cid-5yvbipfl> <div class="min-h-screen flex items-center justify-center" data-astro-cid-5yvbipfl> <div class="bg-white p-8 rounded-xl shadow-lg w-full max-w-md" data-astro-cid-5yvbipfl> <h1 class="text-xl font-bold text-gray-900 mb-4" data-astro-cid-5yvbipfl>เข้าสู่ระบบ Admin</h1> <form method="get" class="space-y-4" data-astro-cid-5yvbipfl> <div data-astro-cid-5yvbipfl> <label class="block text-sm font-medium text-gray-700 mb-1" data-astro-cid-5yvbipfl>Password</label> <input type="password" name="password" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-green-500" placeholder="Enter admin password" required data-astro-cid-5yvbipfl> </div> <button type="submit" class="w-full px-4 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700" data-astro-cid-5yvbipfl>
เข้าสู่ระบบ
</button> </form> </div> </div> <script>(function(){const ADMIN_PASSWORD = "dealplustech";
document.addEventListener('DOMContentLoaded', () => {
const deleteButtons = document.querySelectorAll('.delete-btn');
deleteButtons.forEach(btn => {
btn.addEventListener('click', async () => {
if (!confirm('คุณแน่ใจว่าต้องการลบรายการนี้?')) return;
const sessionId = btn.getAttribute('data-session-id');
try {
const response = await fetch(`/api/consent/${sessionId}`, {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${ADMIN_PASSWORD}`
}
});
if (response.ok) {
location.reload();
} else {
alert('ไม่สามารถลบข้อมูลได้');
}
} catch (error) {
alert('เกิดข้อผิดพลาด');
}
});
});
const exportBtn = document.getElementById('export-csv');
exportBtn?.addEventListener('click', () => {
const rows = [['ID', 'Session ID', 'Timestamp', 'Essential', 'Analytics', 'Marketing', 'IP Hash', 'Version']];
document.querySelectorAll('tbody tr').forEach(tr => {
if (tr.querySelectorAll('td').length > 1) {
const cells = Array.from(tr.querySelectorAll('td'));
rows.push([
cells[0].textContent,
cells[1].textContent,
cells[2].textContent,
cells[3].querySelector('span')?.classList.contains('bg-green-500') ? 'Yes' : 'No',
cells[4].querySelector('span')?.classList.contains('bg-green-500') ? 'Yes' : 'No',
cells[5].querySelector('span')?.classList.contains('bg-green-500') ? 'Yes' : 'No',
cells[6].textContent,
cells[7].textContent,
]);
}
});
const csvContent = rows.map(row => row.join(',')).join('\n');
const blob = new Blob(['\ufeff' + csvContent], { type: 'text/csv;charset=utf-8;' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = `consent_logs_${new Date().toISOString().split('T')[0]}.csv`;
link.click();
URL.revokeObjectURL(url);
});
});
})();</script></body></html>