Ver código fonte

docs: update memory.md — device config + image preview entry

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
kingkong 2 meses atrás
pai
commit
215cf1451a
1 arquivos alterados com 25 adições e 0 exclusões
  1. 25 0
      memory.md

+ 25 - 0
memory.md

@@ -236,6 +236,7 @@ docker compose up -d --build api-server web-dashboard worker simulator
 
 **Env mới**:
 - `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)
 
 ---
@@ -294,6 +295,30 @@ curl -X POST http://localhost:3001/v1/devices/test-device/heartbeat \
 - [ ] **Dashboard captures gallery** — xem ảnh đã upload
 - [ ] **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