Refocus dashboard on device monitoring

This commit is contained in:
chick
2026-07-07 23:33:27 +08:00
parent 2505ee561a
commit 0e746f961c
6 changed files with 247 additions and 91 deletions
+26
View File
@@ -0,0 +1,26 @@
import test from 'node:test'
import assert from 'node:assert/strict'
import { readFile } from 'node:fs/promises'
const root = new URL('../', import.meta.url)
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 () => {
const html = await text('public/index.html')
const app = await text('public/app.js')
assert.match(html, /设备监控|设备详情|实时状态/)
assert.match(app, /renderDeviceDetails/)
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|接口路径/)
})