ssửa lại chức năng frontend
This commit is contained in:
@@ -4,7 +4,7 @@ Dashboard giám sát camera IP gọn nhẹ chạy trên Orange Pi, dựa trên M
|
||||
|
||||
- Live View (WebRTC WHEP) dạng grid, auto reconnect, lazy load
|
||||
- Playback fMP4 theo camera + ngày (file list + HTML5 video)
|
||||
- Settings: quản lý camera + lịch ghi hình (scheduler ở backend)
|
||||
- Settings: quản lý camera trực tiếp trong `mediamtx.yml` + lịch ghi hình
|
||||
|
||||
## Cấu trúc thư mục
|
||||
|
||||
@@ -16,10 +16,14 @@ Dashboard giám sát camera IP gọn nhẹ chạy trên Orange Pi, dựa trên M
|
||||
|
||||
- `GET /api/health`
|
||||
- `GET /api/config`
|
||||
- `POST /api/cameras` / `DELETE /api/cameras/{name}`
|
||||
- `GET /api/paths` (proxy trạng thái từ MediaMTX)
|
||||
- `POST /api/recording` (bật/tắt ghi hình ngay)
|
||||
- `POST /api/scheduler/enabled` / `POST /api/scheduler/schedule`
|
||||
- `GET /api/mediamtx/config`
|
||||
- `POST /api/mediamtx/cameras` (body: `{ "rtsp_url": "..." }`)
|
||||
- `DELETE /api/mediamtx/cameras/{name}`
|
||||
- `POST /api/mediamtx/recording` (ghi `pathDefaults.record` vào `mediamtx.yml`)
|
||||
- `POST /api/mediamtx/restart` (restart container `mediamtx`)
|
||||
- `GET /api/recordings?camera=cam1&date=YYYY-MM-DD`
|
||||
- `GET /videos/<camera>/<file>.fmp4`
|
||||
|
||||
@@ -53,7 +57,7 @@ Backend chỉ dùng file `api/data/config.json` (không đọc `.env`).
|
||||
- `mediamtx_api_pass`: password API (nếu bật auth trong MediaMTX)
|
||||
- `recordings_dir`: ví dụ `./mediamtx/recordings` (cùng máy) hoặc đường dẫn mount NFS/SMB
|
||||
- `api_port`: cổng chạy backend (mặc định `8008`)
|
||||
- `cameras`: danh sách camera (name + rtsp_url)
|
||||
- `cameras`: danh sách camera đồng bộ từ `mediamtx.yml` (`name` + `rtsp_url`)
|
||||
- `schedule`: lịch ghi hình
|
||||
|
||||
Ví dụ `config.json`:
|
||||
|
||||
Reference in New Issue
Block a user