diff --git a/welcome.html b/welcome.html index 794d607..6c734bc 100644 --- a/welcome.html +++ b/welcome.html @@ -237,7 +237,7 @@ async function loadDevices() { document.getElementById('sys-status').textContent = '\u2705 运行中'; try { var r = await api('GET', '/api/states'); - if (!r.ok) throw new Error('获取设备失败'); + if (!r.ok) throw new Error('HTTP ' + r.status + ' ' + r.statusText); var states = await r.json(); document.getElementById('dev-count').textContent = states.length + ' 个实体'; @@ -247,7 +247,7 @@ async function loadDevices() { }); document.getElementById('dev-list').innerHTML = html || '
暂无设备,接入硬件后自动发现
'; } catch(e) { - document.getElementById('sys-status').textContent = '\u274c 连接失败'; + document.getElementById('sys-status').textContent = '\u274c ' + e.message; document.getElementById('dev-list').innerHTML = '
' + e.message + '
'; } }