M5-T06: add Energy device management UI and sidebar entry
This commit is contained in:
@@ -363,7 +363,7 @@ Phase C(MQTT / Discovery,依赖 B 的设备数据与 provider 接口)
|
||||
- **Reviewer checklist**: 删除受 RESTRICT 保护、无批量删/清表路径;查询走 `(device_id, recorded_at)` 索引;test 端点确不落库;路径键用 `uuid`。
|
||||
|
||||
### M5-T06 — 前端:设备管理 UI(Energy 视图)
|
||||
- **Status**: `todo` · **Depends**: M5-T01, M5-T05
|
||||
- **Status**: `done` · **Depends**: M5-T01, M5-T05
|
||||
- **Context**: 在侧栏加 Energy 入口与 `/energy` 路由;设备增删改 + 试读。
|
||||
- **Files**: `create frontend/src/pages/EnergyPage.tsx`、`frontend/src/energy/DeviceForm.tsx`、`frontend/src/energy/hooks.ts`;`modify frontend/src/App.tsx`(路由)、`frontend/src/components/AppSidebar.tsx`(Energy 项);`create` 对应 `*.test.tsx`
|
||||
- **Steps**: `useQuery`/`useMutation` 接 `/api/modbus/devices` API;列表 + 新建/编辑表单(friendly_name/host/port/unit_id/profile 下拉/poll/enabled)+ 删除二次确认(删失败 409 提示改用禁用);"试读"按钮调 `POST {uuid}/test` 显示结果。
|
||||
|
||||
Reference in New Issue
Block a user