feat: promote tasks as batch execution domain

This commit is contained in:
tian 2026-04-27 10:38:47 +08:00
parent 74dfbbf7b5
commit a0a1812b8a
2 changed files with 18 additions and 3 deletions

View File

@ -6,7 +6,7 @@
</div>
<div class="card">
<h2>任务详情</h2>
<h2>任务概览</h2>
<div class="summary-strip control-summary" style="margin-top:10px">
<div class="summary-chip">
<div class="summary-chip-label">任务标识</div>
@ -33,7 +33,7 @@
</div>
<div class="card">
<h2>设备结果</h2>
<h2>设备结果</h2>
<div class="table-wrap" style="margin-top:10px">
<table>
<thead>
@ -67,7 +67,7 @@
</div>
<div class="card">
<h2>实时进度</h2>
<h2>执行进度</h2>
<div class="muted small">任务执行过程中会持续推送每台设备的状态变化。</div>
<div class="actions compact" style="margin-top:8px">
<button type="button" onclick="startSSE()">连接</button>

View File

@ -2171,3 +2171,18 @@ func TestUI_DeviceWorkspaceContainsSingleDeviceOperations(t *testing.T) {
}
}
}
func TestUI_TaskDetailPresentsExecutionSections(t *testing.T) {
ui := newTestUI(t)
task, err := ui.tasks.CreateTask("config_apply", []string{"edge-01"}, map[string]any{"config": map[string]any{}})
if err != nil {
t.Fatalf("create task: %v", err)
}
html := renderPage(t, ui, "/ui/tasks/"+task.ID)
for _, text := range []string{"任务概览", "执行进度", "设备结果"} {
if !strings.Contains(html, text) {
t.Fatalf("expected task detail section %q in html: %s", text, html)
}
}
}