feat: Default to OCR scanner, auto-start camera, hide viewport after capture

- Default add-asset mode changed from barcode to OCR
- Auto-start OCR camera when switching to OCR mode or Add Asset tab
- Camera viewport hidden entirely after photo capture (no placeholder showing)
- Retake button added to all OCR result states (found, not-found, error)
- 'Retake' resets UI and re-starts camera for a new photo
This commit is contained in:
2026-06-01 19:12:01 -04:00
parent 03cf4b9281
commit 86975e2e2b
4 changed files with 42 additions and 22 deletions
+7 -13
View File
@@ -1,16 +1,10 @@
#!/bin/bash
# Restart canteen-asset-tracker server
cd /home/oplabs/projects/canteen-asset-tracker
# Kill existing server
pkill -f "python.*server.py" 2>/dev/null || true
pkill -f "uvicorn.*server:app.*8901" 2>/dev/null || true
sleep 1
# Activate venv and start
source .venv/bin/activate
nohup python server.py > /tmp/canteen-server.log 2>&1 &
echo "Server PID: $!"
sleep 3
# Check health
curl -s http://localhost:8901/health 2>/dev/null || curl -s http://localhost:8900/health 2>/dev/null || echo "Health check failed"
python -m uvicorn server:app --host 0.0.0.0 --port 8901 \
--ssl-keyfile key.pem --ssl-certfile cert.pem --log-level info \
> /tmp/canteen-server.log 2>&1 &
echo "PID=$!"
sleep 2
curl -sk https://localhost:8901/health 2>/dev/null