Commit Graph

5 Commits

Author SHA1 Message Date
Kunthawat
88fcde1d62 Implement moreminimore-style consent backend with better-sqlite3
- Add @astrojs/node adapter for hybrid SSR mode
- Replace console logging with better-sqlite3 database storage
- Create data/ directory for consent.db persistence
- Full consent API: POST (log), GET (fetch), DELETE (remove)
- Admin dashboard at /admin/consent-logs.astro with:
  - Password auth via sessionStorage
  - Stats cards (total, analytics accepted, rejected, rate %)
  - 100 latest logs table
  - Export to CSV functionality
  - Delete individual records
- New Dockerfile: node:20-alpine + sqlite-libs runtime
- Admin password: Coolm@n1234mo

Note: Static pages remain prerendered, only API/admin routes are SSR.
2026-04-01 15:41:46 +07:00
Kunthawat
a1c9930d49 Fix build: simplify consent API to static-compatible console logging
- Remove [sessionId].ts dynamic route (requires adapter in static mode)
- Simplify consent API to log to console only (no SQLite/better-sqlite3)
- Fix syntax error in consent-logs page (curly brace escaping)
- Consent logs page works for viewing instructions (password: Coolm@n1234mo)

Note: In static mode, API routes cannot actually handle POST requests.
For full runtime consent logging, would need hybrid/SSR deployment.
2026-04-01 15:23:54 +07:00
Kunthawat
41bf954d80 Implement full consent logging system with SQLite database
- Install better-sqlite3 and @astrojs/node adapter
- Update consent API to use SQLite database
- Add DELETE endpoint for consent logs
- Update admin consent-logs page with full UI (stats, table, export, delete)
- Add sessionId to consent tracking
- Admin password: Coolm@n1234mo

Note: Database stored at data/consent.db (gitignored)
2026-04-01 15:09:16 +07:00
Kunthawat
07cdc0dce3 Fix consent API: handle empty/invalid JSON body gracefully 2026-04-01 14:52:20 +07:00
Kunthawat
9cddd3da57 Refactor: Update category structure, mega menu, footer, and remove unused pages
- Move DURGO from ระบบน้ำ to อุปกรณ์ปรับอากาศ
- Add -category suffix to อุปกรณ์ดับเพลิง and ฉนวนหุ้มท่อ category pages
- Update Header mega menu with correct category slugs
- Fix Footer layout: split categories to 2 columns, remove quick links
- Delete unused pages: all-projects, join-us, services, product
- All product images fixed to 1:1 aspect ratio
2026-03-31 22:54:54 +07:00