Refocus UI on device card details

This commit is contained in:
chick
2026-07-08 00:17:22 +08:00
parent 0e746f961c
commit 4f80e951d4
4 changed files with 224 additions and 196 deletions
+17 -6
View File
@@ -8,19 +8,30 @@ async function text(path) {
return readFile(new URL(path, root), 'utf8')
}
test('dashboard primary surface is a device monitoring board, not an API catalog', async () => {
test('home screen is a simadmin card wall and device detail owns interactions', async () => {
const html = await text('public/index.html')
const app = await text('public/app.js')
assert.match(html, /设备监控|设备详情|实时状态/)
assert.match(app, /renderDeviceDetails/)
assert.match(html, /id="homeView"/)
assert.match(html, /id="homeDeviceGrid"/)
assert.match(html, /设备卡片|设备卡片墙|SimAdmin 卡片/)
assert.match(html, /id="detailView"/)
assert.match(html, /id="backToFleetBtn"/)
assert.match(html, /id="detailActions"/)
assert.match(html, /id="detailDeviceGrid"/)
assert.match(app, /function renderHomeCards/)
assert.match(app, /function openDeviceDetail/)
assert.match(app, /function renderDeviceDetails/)
assert.match(app, /data-open-detail/)
assert.match(app, /\['home', 'detail', 'rawpage', 'api'\]/)
assert.match(app, /温度/)
assert.match(app, /流量|速率/)
assert.match(app, /内存|磁盘/)
assert.match(app, /SIM|ICCID/)
assert.match(app, /短信/)
const dashboardBlock = html.match(/<section id="dashboardView"[\s\S]*?<\/section>\s*<section id="apiView"/)
assert.ok(dashboardBlock, 'dashboardView block should exist before apiView')
assert.doesNotMatch(dashboardBlock[0], /API 地图|endpointList|接口路径/)
const homeBlock = html.match(/<section id="homeView"[\s\S]*?<\/section>\s*<section id="detailView"/)
assert.ok(homeBlock, 'homeView should exist before detailView')
assert.doesNotMatch(homeBlock[0], /API 地图|endpointList|接口路径|rawOutput/)
})