diff --git a/Home.md b/Home.md index b6d1818..40a6f4c 100644 --- a/Home.md +++ b/Home.md @@ -12,6 +12,18 @@ Mobile-first web app for tracking physical assets via barcode scanning, OCR stic - Username: `admin` - Password: `Brett85!@` +### T4 Connect Label Upload — May 2026 +- **"🏷️ Connect" mode toggle** on Add Asset tab (alongside Barcode/OCR/Manual) +- **Camera + Gallery buttons**: `connectFromCamera()` opens device camera, `connectFromGallery()` triggers file picker in connect mode +- **`processConnectLabelPhoto(file)`**: Runs OCR (server-first, Tesseract.js client-side fallback) and GPS extraction (exifr.js) in parallel +- **Results card**: Photo thumbnail, editable Machine ID, editable GPS coords (lat/lng), Leaflet mini-map preview, category select +- **`POST /api/connect-label`**: Multipart endpoint accepting photo upload + form fields (machine_id, name, latitude, longitude, category). Auto reverse-geocodes address from GPS. Saves photo to uploads/connect_labels/ +- **Connect Label section** in Assets list: Shows last 20 scanned labels from localStorage with machine_id, GPS coords, and timestamp. Clear button to reset history +- **Edge cases**: OCR failure → manual machine_id entry allowed; missing EXIF GPS → prompt to enter coordinates or skip +- JS functions: `connectFromCamera()`, `connectFromGallery()`, `captureConnectPhoto()`, `stopConnectCamera()`, `processConnectLabelPhoto()`, `runConnectOcr()`, `renderConnectResults()`, `createConnectAsset()`, `resetConnectMode()`, `saveConnectLabel()`, `renderConnectLabels()`, `clearConnectLabels()` +- Server: `ConnectLabelRequest` Pydantic model, `connect_label()` async endpoint +- Commit: 6229966 + ### T3 EXIF GPS Extraction from Photo — May 2026 - **exifr.js CDN**: Loaded `exifr@7/dist/lite.umd.js` in `` for JPEG EXIF GPS reading - **`extractGpsFromPhoto(file)`**: Async function using `exifr.gps()`, returns `{lat, lng, accuracy}` or null, catches errors gracefully @@ -187,6 +199,7 @@ When building_number is entered in the manual asset form or location form, it au | `/api/assets/search?machine_id=` | GET | Lookup by machine ID | | `/api/checkins` | POST/GET | GPS check-ins | | `/api/ocr` | POST | Extract machine_id from sticker image | +| `/api/connect-label` | POST | Unified photo + OCR + GPS asset creation | | `/api/geocode?lat=&lng=` | GET | Reverse geocode GPS → address | | `/api/geocode-address?address=` | GET | Forward geocode address → GPS | | `/api/checkins/heatmap?days=&limit=` | GET | Real check-in GPS coords for heatmap |