diff --git a/frontend/src/components/DeviceControl.vue b/frontend/src/components/DeviceControl.vue new file mode 100644 index 0000000..036a9ac --- /dev/null +++ b/frontend/src/components/DeviceControl.vue @@ -0,0 +1,82 @@ + + + 控制 + + + + {{ isOn ? '关闭' : '开启' }} + + + + + 发送命令 + + + + 发送 + + + 此设备未配置命令主题 + + + + + diff --git a/frontend/src/components/DeviceLogList.vue b/frontend/src/components/DeviceLogList.vue new file mode 100644 index 0000000..d9a2e3f --- /dev/null +++ b/frontend/src/components/DeviceLogList.vue @@ -0,0 +1,46 @@ + + + 消息日志 + 暂无日志 + + + + {{ log.direction === 'rx' ? 'RX' : 'TX' }} + + {{ log.payload }} + {{ formatTime(log.timestamp) }} + + + + + + diff --git a/frontend/src/views/BrokerView.vue b/frontend/src/views/BrokerView.vue index cece242..d3473cb 100644 --- a/frontend/src/views/BrokerView.vue +++ b/frontend/src/views/BrokerView.vue @@ -1 +1,99 @@ -Broker + + + Broker 管理 + + + 状态 + + + 状态 + 运行中 + + + 连接数 + {{ metrics['client.connected'] || 0 }} + + + 订阅数 + {{ metrics['client.subscribe'] || 0 }} + + + 消息发布 + {{ metrics['messages.publish'] || 0 }} + + + {{ statusRaw }} + + + + + + 已连接客户端 ({{ clients.length }}) + + 暂无客户端 + + + + + {{ client.clientid }} + + {{ client.ip_address }} + + + + + + + 活跃主题 ({{ topics.length }}) + + 暂无活跃主题 + + + {{ topic.topic }} + + + + + + + + diff --git a/frontend/src/views/DeviceDetailView.vue b/frontend/src/views/DeviceDetailView.vue index c4f4780..663765a 100644 --- a/frontend/src/views/DeviceDetailView.vue +++ b/frontend/src/views/DeviceDetailView.vue @@ -1 +1,72 @@ -Device Detail + + + 加载中... + + + + ← 返回设备列表 + + + + + + + {{ device.name }} + + + + {{ device.type }} + {{ device.protocol === 'ha_discovery' ? 'HA Discovery' : '自定义' }} + ID: {{ device.id.slice(0, 8) }} + + + + 删除设备 + + + + + 状态主题:{{ device.mqtt_topic }} + 命令主题:{{ device.command_topic || '无' }} + 当前状态:{{ device.state || '无' }} + 最后活跃:{{ device.last_seen || '从未' }} + + + + + + + + + + + +
此设备未配置命令主题
运行中
{{ metrics['client.connected'] || 0 }}
{{ metrics['client.subscribe'] || 0 }}
{{ metrics['messages.publish'] || 0 }}