Commit Graph

10 Commits

Author SHA1 Message Date
Leo 8d5deb735b Fix route ordering: /search before /{asset_id}
- /api/assets/search must be registered before /api/assets/{asset_id}
  to prevent FastAPI path param from catching 'search' as an asset_id.
  Returning a 422 with array detail caused frontend to show [object Object].
- Improve error message extraction in clearAssetGps catch block.
2026-05-22 23:45:26 -04:00
Leo 9794d8076c Add clear asset GPS endpoint + UI
- DELETE /api/assets/{id}/gps: clears lat/lng to NULL
- GET /api/assets/{id}: asset lookup by ID
- GET /api/assets/search?machine_id=: asset lookup by machine ID
- Export & Admin page: Clear Asset GPS card with lookup + confirmation
- Tests: 204 success + 404 not found
2026-05-22 23:36:40 -04:00
Leo cd1f04a519 fix(admin): sidebar hamburger menu for mobile, remove auto Cantaloupe sync
- Replace broken icon-only sidebar collapse with off-canvas hamburger menu
  that slides in from left (hidden by default on <768px)
- Add sidebar overlay backdrop, auto-close on nav/logout
- Rename 'Cantaloupe Sync' to 'Import' in sidebar and 'Excel Import' in page
- Remove 'Sync Now' button and backend subprocess auto-export entirely
- Keep manual Excel file upload as the only import path
- Update empty-state text and upload handler to work without Sync Now btn
2026-05-22 16:08:07 -04:00
Leo 90a426bc9e Fix Cantaloupe Sync: use sys.executable + add Excel file upload button
- Changed subprocess from 'python' to 'sys.executable' (fixes FileNotFoundError
  in systemd — venv python not in system PATH)
- Added '📤 Upload Excel' button to admin frontend sync page
- uploadSyncFile() sends file to the same /api/admin/cantaloupe/sync endpoint
  (which already supported file upload — frontend just didn't expose it)
- Users can now use 'Sync Now' for auto-download or 'Upload Excel' for manual
2026-05-21 23:10:22 -04:00
Leo b91ed6bc7b Fix: add responsive breakpoints for mobile (480px + 768px) — sidebar, stats grid, Cantaloupe Sync page, form rows 2026-05-21 20:05:52 -04:00
Leo 20002f4fcb fix: update login password hint from Brett85!@ to changeme 2026-05-21 19:47:03 -04:00
Leo 070e8c2ddb Add Cantaloupe Sync admin UI page
- New 'Cantaloupe Sync' nav item in sidebar with sync icon
- Section 1: Sync Overview showing latest batch status, diff badges
- Section 2: Pending Batch Review with approve/reject buttons and diff detail
- Section 3: Import History with expandable rows for full diff view
- Added static file serving (FileResponse) to admin_server.py
- Fixed formatDate to handle space-separated SQLite datetimes
- Dark theme matching existing admin UI, vanilla JS with fetch()
2026-05-21 19:38:36 -04:00
Leo 19bdbf0ec3 t_6549bb2b: Align SPA with admin server API (reset endpoint, initAuth, remove SQL query) 2026-05-21 17:19:39 -04:00
Leo d1c7853877 Initial commit: Admin API server extracted from canteen-asset-tracker 2026-05-21 17:19:14 -04:00
shawn c4e45c2569 t_6549bb2b: Create admin frontend SPA with full CRUD, dashboard, activity, export 2026-05-21 17:18:36 -04:00