From 87346f66295c0b9c813f216d25113f73b7006137 Mon Sep 17 00:00:00 2001 From: xiaoou Date: Fri, 10 Jul 2026 13:30:05 +0800 Subject: [PATCH] =?UTF-8?q?Welcome:=20=E4=B8=AD=E6=96=87=E5=90=8D+?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E7=BF=BB=E8=AF=91,=20=E9=80=80=E5=87=BA?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E5=B0=8F=E5=AD=97=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- welcome.html | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/welcome.html b/welcome.html index 6c734bc..a5d3c04 100644 --- a/welcome.html +++ b/welcome.html @@ -79,7 +79,9 @@ input:focus { border-color: #1371FF; }
加载设备列表...
刷新设备列表
- +
+ 退出登录 +
朴小护智慧家居 v1.0 | HA + Hermes
@@ -234,7 +236,17 @@ async function createUser() { } async function loadDevices() { - document.getElementById('sys-status').textContent = '\u2705 运行中'; + document.getElementById('sys-status').textContent = '运行中'; + // 实体中文名映射 + var names = { + 'zone.home': '家庭区域', + 'person.admin': '管理员', + 'event.backup': '备份事件', + 'sensor.backup': '备份状态', + 'sensor.backup_2': '备份详情2', + 'sensor.backup_3': '备份详情3', + 'sensor.backup_4': '备份详情4', + }; try { var r = await api('GET', '/api/states'); if (!r.ok) throw new Error('HTTP ' + r.status + ' ' + r.statusText); @@ -243,11 +255,13 @@ async function loadDevices() { var html = ''; states.forEach(function(e) { - html += '
' + e.entity_id + '' + e.state + '
'; + var label = names[e.entity_id] || e.entity_id; + var stateText = e.state === 'unknown' ? '待检测' : (e.state === 'idle' ? '空闲' : e.state); + html += '
' + label + '' + stateText + '
'; }); document.getElementById('dev-list').innerHTML = html || '
暂无设备,接入硬件后自动发现
'; } catch(e) { - document.getElementById('sys-status').textContent = '\u274c ' + e.message; + document.getElementById('sys-status').textContent = e.message; document.getElementById('dev-list').innerHTML = '
' + e.message + '
'; } }