diff --git a/frontend/src/components/AddDeviceModal.vue b/frontend/src/components/AddDeviceModal.vue new file mode 100644 index 0000000..a148953 --- /dev/null +++ b/frontend/src/components/AddDeviceModal.vue @@ -0,0 +1,65 @@ + + + + 添加设备 + + + 设备名称 + + + + 设备类型 + + Switch 开关 + Light 灯光 + Sensor 传感器 + Binary Sensor + Climate 温控 + + + + 状态主题 (State Topic) + + + + 命令主题 (Command Topic) + + + + 取消 + 添加 + + + + + + + diff --git a/frontend/src/components/DeviceCard.vue b/frontend/src/components/DeviceCard.vue new file mode 100644 index 0000000..6c5ef0e --- /dev/null +++ b/frontend/src/components/DeviceCard.vue @@ -0,0 +1,78 @@ + + + + + + {{ device.name }} + + {{ device.type }} + + + + 状态 + + {{ displayState || '未知' }} + + + + 协议 + {{ device.protocol === 'ha_discovery' ? 'HA' : '自定义' }} + + + + {{ isOn ? '关闭' : '开启' }} + + + + + diff --git a/frontend/src/components/StatsCard.vue b/frontend/src/components/StatsCard.vue new file mode 100644 index 0000000..6fbdbae --- /dev/null +++ b/frontend/src/components/StatsCard.vue @@ -0,0 +1,24 @@ + + + + + {{ label }} + {{ value }} + + + + + + + + + diff --git a/frontend/src/views/DashboardView.vue b/frontend/src/views/DashboardView.vue index 5a928f7..0e88f45 100644 --- a/frontend/src/views/DashboardView.vue +++ b/frontend/src/views/DashboardView.vue @@ -1 +1,84 @@ -Dashboard + + + 仪表盘 + + + + + + + + + 最近活动 + + 暂无活动 + + + + + {{ log.direction === 'rx' ? '接收' : '发送' }} + + {{ log.topic }} + {{ log.payload }} + {{ formatTime(log.timestamp) }} + + + + + + + diff --git a/frontend/src/views/DevicesView.vue b/frontend/src/views/DevicesView.vue index 10003c3..cf09042 100644 --- a/frontend/src/views/DevicesView.vue +++ b/frontend/src/views/DevicesView.vue @@ -1 +1,38 @@ -Devices + + + + 设备管理 + + + 添加设备 + + + + 加载中... + + + 暂无设备 + 点击"添加设备"手动注册,或通过 HA Discovery 自动发现 + + + + + + + + + + +
{{ label }}
{{ value }}
暂无设备
点击"添加设备"手动注册,或通过 HA Discovery 自动发现