|
@@ -236,6 +236,7 @@ docker compose up -d --build api-server web-dashboard worker simulator
|
|
|
|
|
|
|
|
**Env mới**:
|
|
**Env mới**:
|
|
|
- `UPLOAD_DIR=/uploads/captures` (api-server)
|
|
- `UPLOAD_DIR=/uploads/captures` (api-server)
|
|
|
|
|
+- `UPLOAD_BASE_URL` (api-server — URL prefix cho ảnh, mặc định `http://localhost:3001`)
|
|
|
- `SIM_INTERNAL_KEY` (api-server + simulator)
|
|
- `SIM_INTERNAL_KEY` (api-server + simulator)
|
|
|
|
|
|
|
|
---
|
|
---
|
|
@@ -294,6 +295,30 @@ curl -X POST http://localhost:3001/v1/devices/test-device/heartbeat \
|
|
|
- [ ] **Dashboard captures gallery** — xem ảnh đã upload
|
|
- [ ] **Dashboard captures gallery** — xem ảnh đã upload
|
|
|
- [ ] **Pi 4 IP** — cập nhật Gogs webhook URL
|
|
- [ ] **Pi 4 IP** — cập nhật Gogs webhook URL
|
|
|
|
|
|
|
|
|
|
+### 2026-03-26 — Device config form + image preview gallery
|
|
|
|
|
+
|
|
|
|
|
+Backend:
|
|
|
|
|
+- Static file serving: `GET /uploads/captures/*` → file system (`NestExpressApplication`)
|
|
|
|
|
+- `UPLOAD_BASE_URL` env: prefix URL cho ảnh, mặc định `http://localhost:3001`
|
|
|
|
|
+- Captures API: mọi response đều có `imageUrl` field (full URL)
|
|
|
|
|
+- `PATCH /v1/devices/:id/config` — update device config (JWT auth)
|
|
|
|
|
+- `UpdateDeviceConfigDto`: captureInterval/resolution/quality/storage/heartbeat/nightMode/timezone
|
|
|
|
|
+
|
|
|
|
|
+Dashboard (`devices/[id].tsx`):
|
|
|
|
|
+- Image preview gallery: lưới 10 cột, hover overlay hiện time/ISO/aperture
|
|
|
|
|
+- Lightbox: click thumbnail → xem ảnh lớn + metadata (time/res/size/exposure/ISO/aperture)
|
|
|
|
|
+- Auto-refresh captures mỗi 30s
|
|
|
|
|
+- Config editor: form cho 8 fields + toggle WiFi-only, Save button với trạng thái
|
|
|
|
|
+- Heartbeat timeline: bảng 10 dòng gần nhất (temp/storage/captures/network)
|
|
|
|
|
+- Device info bar: serial/firmware/lastseen/project
|
|
|
|
|
+- Commit: `290f089 feat: device config form + image preview gallery + static file serving`
|
|
|
|
|
+
|
|
|
|
|
+Trên Pi: rebuild để thấy ảnh placeholder từ simulator.
|
|
|
|
|
+**Cần set `UPLOAD_BASE_URL` = URL thật của Pi** trong `.env`:
|
|
|
|
|
+```
|
|
|
|
|
+UPLOAD_BASE_URL=http://<pi-ip>:3001
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
---
|
|
---
|
|
|
|
|
|
|
|
## Nhật ký phát triển
|
|
## Nhật ký phát triển
|