diff --git a/src/pages/admin/consent-logs/index.astro b/src/pages/admin/consent-logs/index.astro new file mode 100644 index 0000000..8c28920 --- /dev/null +++ b/src/pages/admin/consent-logs/index.astro @@ -0,0 +1,92 @@ +--- +import BaseLayout from '@/layouts/BaseLayout.astro'; +import Header from '@/components/common/Header.astro'; +import Footer from '@/components/common/Footer.astro'; + +const adminPassword = import.meta.env.ADMIN_PASSWORD || 'Coolm@n1234mo'; +const submitted = Astro.request.method === 'POST'; +const password = Astro.url.searchParams.get('password') || ''; +const isAuthorized = password === adminPassword; +--- + + +
+ +
+
+
+ {isAuthorized ? ( +
+

Consent Logs

+ +
+

วิธีใช้งาน

+
    +
  • หน้านี้แสดง log การยอมรับ cookie consent ที่ส่งมาจากผู้เยี่ยมชมเว็บไซต์
  • +
  • ข้อมูลถูกบันทึกใน log file ของ server
  • +
  • สำหรับดู log จริง ให้ SSH ไปที่ server แล้วดูที่ pm2 logs หรือ docker logs
  • +
+
+ +
+

ตัวอย่างข้อมูลที่บันทึก

+
+{`[
+  {
+    "id": "550e8400-e29b-41d4-a716-446655440000",
+    "essential": true,
+    "analytics": true,
+    "marketing": false,
+    "timestamp": 1709300000000,
+    "policyVersion": "1.0",
+    "ip": "127.0.0.1",
+    "userAgent": "Mozilla/5.0...",
+    "createdAt": "2024-03-01T12:00:00.000Z"
+  }
+]`}
+
+ + +
+ ) : ( +
+
+

Admin Login

+ +
+
+ + +
+ + +
+ + {submitted && ( +

รหัสผ่านไม่ถูกต้อง

+ )} +
+
+ )} +
+
+
+ +