feat: prepare 2.2.0 with UI and execution fixes
Add dark theme, richer Markdown and readable plugin results. Improve Android input evidence, response integrity and diagnostics. Unify lifecycle, guidance receipts and evidence sources across clients. Keep direct action dispatch without an added AI quota approval layer. Align version metadata at 2.2.0 and bundle Helper 1.2.2. Validation: 3063 backend tests before the version bump; 44 after. Frontend: 317 tests and production build passed.
This commit is contained in:
1 parent
83bcfd54d5
commit
fac4ccb760
146 files changed
+5689
-2033
No files matched your search
@@ -0,0 +1,50 @@
|
||||
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { TaskLifecycle } from '../../core/models/session.model';
|
||||
|
||||
export function durationText(value: number | null | undefined): string {
|
||||
if (value == null || !Number.isFinite(value)) return '未记录';
|
||||
const seconds = Math.max(0, Math.floor(value));
|
||||
return seconds < 60 ? `${seconds} 秒` : `${Math.floor(seconds / 60)} 分 ${seconds % 60} 秒`;
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'app-task-lifecycle', standalone: true, imports: [DatePipe],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
template: `@if (value(); as progress) {
|
||||
<details class="lifecycle">
|
||||
<summary>任务进度 · {{ phase(progress.phase) }}</summary>
|
||||
<dl>
|
||||
@for (item of items; track item.key) {
|
||||
<div><dt>{{ item.label }}</dt><dd>{{ duration(progress.durations[item.key]) }}</dd></div>
|
||||
}
|
||||
</dl>
|
||||
<p>{{ progress.note || '分项使用实际记录;缺失为未知。执行完成不等于验证通过。' }}</p>
|
||||
@if (progress.observed_at != null) { <small>记录更新于 {{ progress.observed_at * 1000 | date:'HH:mm:ss' }}</small> }
|
||||
</details>
|
||||
}`,
|
||||
styles: [`
|
||||
:host { display: block; }
|
||||
.lifecycle { margin: 8px 0; padding: 10px 12px; border: 1px solid var(--app-border-control, #cbd5e1); border-radius: 8px; color: var(--app-text-control, #1e293b); background: var(--app-surface, #fff); font-size: 12px; }
|
||||
summary { cursor: pointer; font-weight: 600; }
|
||||
dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 12px 0; }
|
||||
dt, p, small { color: var(--app-text-muted, #64748b); }
|
||||
dd { margin: 4px 0 0; font-variant-numeric: tabular-nums; }
|
||||
p { margin: 8px 0; line-height: 1.6; overflow-wrap: anywhere; }
|
||||
`]
|
||||
})
|
||||
export class TaskLifecycleComponent {
|
||||
value = input<TaskLifecycle | null>(null);
|
||||
duration = durationText;
|
||||
items = [
|
||||
{key:'total', label:'总历时'}, {key:'queued', label:'后台排队'},
|
||||
{key:'resource_wait', label:'等待设备/资源'}, {key:'paused', label:'暂停与示范'},
|
||||
{key:'execution', label:'执行与整理'}, {key:'final_review', label:'最终验收'},
|
||||
{key:'report_export', label:'报告导出'}
|
||||
];
|
||||
phase(value: string): string {
|
||||
return ({queued:'后台排队', waiting_resources:'等待设备/资源', running:'执行中', paused:'已暂停',
|
||||
demonstrating:'人工示范中', analyzing_demo:'正在分析示范', final_review:'正在最终验收',
|
||||
report_export:'正在导出报告', finished:'执行已结束', unknown:'状态未记录'} as Record<string,string>)[value] || '状态待确认';
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user