From 242b0d223f650bfa919bcd2e3291d9d9b64fe63a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=A1=E5=8F=A3=E6=B5=AA=E4=BA=BA?= Date: Sat, 17 Oct 2026 23:34:26 +0800 Subject: [PATCH] Show task name before enabled state --- plugin/ui/index.js | 2 +- tests/ui.cjs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/ui/index.js b/plugin/ui/index.js index 9abd319..1b97bb4 100644 --- a/plugin/ui/index.js +++ b/plugin/ui/index.js @@ -37,7 +37,7 @@ export function hostCard(entry) { const kind = !current || unknown || result === undefined ? 'unknown' : result === 1 ? 'normal' : 'error'; const stateLabel = kind === 'normal' ? text('正常', 'Normal') : kind === 'error' ? text('失败', 'Failed') : text('待确认', 'Unconfirmed'); const title = /轮播/.test(resource.name || '') ? text('轮播任务', 'Slideshow task') : resource.name || text('任务', 'Job'); - return [card(title, enabled ? text('启用', 'Enabled') : text('停用', 'Disabled'), status(kind, stateLabel))]; + return [card(title, `${resource.name || text('任务', 'Job')} · ${enabled ? text('启用', 'Enabled') : text('停用', 'Disabled')}`, status(kind, stateLabel))]; } return metrics.filter(m => m.resource_id === resource.id).map(metric => { const title = label(metric); diff --git a/tests/ui.cjs b/tests/ui.cjs index 3430405..b5dfac9 100644 --- a/tests/ui.cjs +++ b/tests/ui.cjs @@ -26,6 +26,7 @@ assert.equal(result.nested,0); assert.equal(result.subtitle,'渡口浪人的相框'); assert.equal(result.status,lang==='zh'?'正常':'Normal'); assert(result.text.includes(lang==='zh'?'轮播任务':'Slideshow task')); +assert(result.text.includes('家庭照片轮播 · '+(lang==='zh'?'启用':'Enabled'))); await page.close(); } console.log('6 browser checks passed');