Commit Graph

8 Commits

Author SHA1 Message Date
APAW Agent Sync
4af3e7cd9d fix(admin): wire all dashboard buttons + fix 401/login console errors + chart period switching
- dashboard.html: add onclick handlers for Exportar, date range, chart periods
  (week/month/year), Ver todos, quick actions, remove stale inline lead IDs
- admin.js: add exportDashboard(), filterByDateRange(), setChartPeriod(),
  initDateRange(), updateChartsWithData() with period slicing, loadAnalytics()
  on dashboard init
- login.html: guard /api/auth/me with session cookie check to prevent 401 noise
- server/index.ts: fix Secure cookie flag: only set when HTTPS + production + !localhost
2026-05-18 15:54:56 +01:00
APAW Agent Sync
32eb1827e2 fix(admin): init charts and settings after section load + wired settings save fields 2026-05-16 01:03:45 +01:00
APAW Agent Sync
8c1b897b9d feat(admin): replace prompt() with Bootstrap modals for CRUD operations
Replace browser prompt()-based editing with proper Bootstrap 5 modal
dialogs for testimonials, services, FAQs, and leads. This provides
better UX with form validation, structured input fields, and i18n
support (ES/RU) instead of raw prompt dialogs.

- Add testimonialModal, serviceModal, faqModal, leadModal to admin.html
- Add show*/save* methods in admin.js for each entity type
- Wire leads.html 'Add lead' button to leadModal
- Add modal JS modules (FAQModal, LeadModal, ServiceModal)
- Add unit and e2e tests for modals and API client
2026-05-16 00:43:04 +01:00
APAW Agent Sync
bbe9a42691 fix(perf): fix admin panel 30s load + add loader + abort controller
1. Replace serveStatic with Bun.file() to fix Content-Length: 0 bug
   that caused Nginx to wait 12-30s per file.
2. Add section loader (spinner + 'Cargando...') while sections load.
3. Add AbortController to cancel previous fetch when switching menus.
4. Add credentials: 'same-origin' to ensure cookies are sent.
5. Add error handling for empty responses and HTTP errors.

Fixes: admin panel empty sections, 30s menu load, DOMException aborts.

Refs: production server tenerifeprop.es
2026-05-14 09:51:33 +01:00
APAW Agent Sync
08e2d21f7d fix(client): use getAdminProperties in admin panel
- Add getAdminProperties() to api.js with admin endpoint
- Update admin.js loadProperties() to use getAdminProperties
- Returns full dataset with admin filtering support

Refs: production admin panel
2026-05-14 09:26:22 +01:00
APAW Agent Sync
60a51026cf fix(auth): add checkAuth to admin.js before init
Previously admin.js did not verify authentication on load.
Admin was accessible without login if user navigated directly.
Now checkAuth() is called before init() and redirects to /login
if user is not authenticated.

Refs: production server, admin panel security
2026-05-14 00:40:14 +01:00
Kilo
916455351d fix(admin): connect api.js and admin.js, fix property modal, add analytics endpoint
- admin.html: removed conflicting inline script, added api.js + admin.js
- admin.js: dynamic section loader with fetch, init navigates to hash
- api.js: credentials: 'include' for all admin requests
- propertyModal: added name attributes to all form fields, saveProperty onclick handler
- server/index.ts: added POST /api/analytics/event with daily aggregation
- server/validation.ts: removed min(6) from password for 401 on invalid credentials
- capability-index.yaml: added 11 MCP capability routes
- docker-compose-mcp.yml: created for MCP servers
2026-04-27 11:42:05 +01:00
TenerifeProp Dev
3bbbb126ab feat: add authentication, admin API, and security improvements
- Add session-based authentication system
- Implement admin CRUD endpoints for properties, leads, testimonials, FAQ, services
- Fix security issue: remove public GET /api/leads endpoint
- Add basic input validation for leads endpoint
- Add global error handler
- Fix Docker healthcheck using bun's fetch
- Add @types/bcrypt dependency
- Add .dockerignore
- Add host reboot prohibition to global rules
2026-04-05 00:01:54 +01:00