${esc(entry.host.name || 'Frame Flow')}
${frames.map(frame => `${esc(frame.name || text('画框', 'Frame'))}`).join('')}
${current ? text('在线', 'Online') : text('状态未确认', 'Unconfirmed')} ${!current ? `${text('以下为上次采集数据', 'Showing the last collected data')}
` : ''}${cards}
${alertRows ? `${text('当前告警', 'Current alerts')}
${alertRows}` : ''}`;
+ return `${esc(entry.host.name || 'Frame Flow')}
${frames.map(frame => `${esc(frame.name || text('画框', 'Frame'))}`).join('')}
${current ? text('在线', 'Online') : text('状态未确认', 'Unconfirmed')} ${!current ? `${text('以下为上次采集数据', 'Showing the last collected data')}
` : ''}${cards}
${text('已读取范围内的告警', 'Alerts within monitored scope')}${summaryStatus(scopeAlertHealth(snapshot.alerts, snapshot.alerts_complete, current), state.LANG)}
${alertRows || (current && snapshot.alerts_complete ? text('无告警', 'No alerts') : text('状态未确认', 'Unconfirmed'))}
`;
}
diff --git a/tests/ui.cjs b/tests/ui.cjs
index b5dfac9..4f52aa6 100644
--- a/tests/ui.cjs
+++ b/tests/ui.cjs
@@ -9,9 +9,10 @@ const entry={host:{name:'Frame Flow'},dataCurrent:true,snapshot:{resources:[{id:
entry.snapshot.resources.push({id:'job:slideshow',name:'家庭照片轮播',type:'job'});
entry.snapshot.metrics.push({resource_id:'job:slideshow',key:'job_enabled',value:1,unit:'boolean'},{resource_id:'job:slideshow',key:'last_run_success',value:1,unit:'boolean'});
for(const lang of ['zh','en'])for(const width of [1440,820,390]) {
-const page=await browser.newPage({viewport:{width,height:1000}});
+const page=await browser.newPage({bypassCSP:true,viewport:{width,height:1000}});
await page.goto('http://192.168.89.19/');
-const result=await page.evaluate(({source,entry,lang})=>{
+const result=await page.evaluate(async ({source,entry,lang})=>{
+ const {scopeAlertHealth,summaryStatus}=await import('/assets/js/overview-health.js');
const state={LANG:lang};const text=(zh,en)=>lang==='zh'?zh:en;
const esc=v=>String(v??'').replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
const html=eval(source+'\nhostCard(entry)');