auto-sync: 2026-05-17 12:37:14

This commit is contained in:
cfdaily
2026-05-17 12:37:14 +08:00
parent 424a05265a
commit cd7925baa3
+22 -11
View File
@@ -41,18 +41,26 @@ const MOCK_EXPERIENCES = [
// ── 常量 ──
const STATUS_META: Record<string, { color: string; label: string }> = {
pending: { color: '#7a9aff', label: '待认领' },
claimed: { color: '#a07aff', label: '已认领' },
working: { color: '#6a9eff', label: '执行中' },
done: { color: '#2ecc8a', label: '已完成' },
failed: { color: '#ff5270', label: '失败' },
pending: { color: '#7a9aff', label: '待认领' },
claimed: { color: '#a07aff', label: '已认领' },
working: { color: '#6a9eff', label: '执行中' },
review: { color: '#818cf8', label: '审查中' },
done: { color: '#2ecc8a', label: '已完成' },
failed: { color: '#ff5270', label: '失败' },
blocked: { color: '#f59e0b', label: '阻塞' },
cancelled: { color: '#6b7280', label: '已取消' },
};
// P1: 对齐后端 VALID_TRANSITIONSdb.py
const VALID_TRANSITIONS: Record<string, string[]> = {
pending: ['cancelled'],
claimed: ['working', 'cancelled'],
working: ['done', 'failed', 'cancelled'],
failed: ['pending', 'cancelled'],
pending: ['claimed', 'cancelled'],
claimed: ['working', 'pending', 'cancelled'],
working: ['review', 'blocked', 'failed', 'cancelled'],
review: ['done', 'pending', 'failed', 'cancelled'],
blocked: ['pending', 'cancelled'],
failed: ['pending'],
done: [],
cancelled: [],
};
const AGENT_EMOJI: Record<string, string> = {
@@ -99,9 +107,12 @@ function SectionLabel({ icon, title, count }: { icon: string; title: string; cou
function StatusButtons({ status }: { status: string }) {
const transitions = VALID_TRANSITIONS[status] || [];
const btnMap: Record<string, { label: string; icon: string; bg: string; color: string; border: string }> = {
claimed: { label: '认领任务', icon: '👤', bg: '#a07aff22', color: '#a07aff', border: '#a07aff44' },
working: { label: '开始执行', icon: '⚔️', bg: '#2ecc8a22', color: '#2ecc8a', border: '#2ecc8a44' },
review: { label: '提交审查', icon: '🔍', bg: '#818cf822', color: '#818cf8', border: '#818cf844' },
done: { label: '标记完成', icon: '✅', bg: '#2ecc8a22', color: '#2ecc8a', border: '#2ecc8a44' },
failed: { label: '标记失败', icon: '❌', bg: '#ff527022', color: '#ff5270', border: '#ff527044' },
blocked: { label: '标记阻塞', icon: '🚧', bg: '#f59e0b22', color: '#f59e0b', border: '#f59e0b44' },
pending: { label: '重置待认领', icon: '🔄', bg: '#6a9eff22', color: '#6a9eff', border: '#6a9eff44' },
cancelled: { label: '取消任务', icon: '🚫', bg: '#6b728022', color: '#6b7280', border: '#6b728044' },
};
@@ -164,7 +175,7 @@ export default function TaskModal() {
status: 'working',
assignee: 'zhangfei-dev',
assigned_by: 'pangtong-fujunshi',
priority: 'high',
priority: 7,
task_type: 'backtest',
created_at: '2026-05-17T08:30:00',
updated_at: '2026-05-17T11:20:00',
@@ -213,7 +224,7 @@ export default function TaskModal() {
<div style={{ display: 'flex', alignItems: 'center', gap: 8, marginBottom: 4 }}>
<span style={{ fontSize: 11, color: 'var(--acc)', fontWeight: 700, letterSpacing: '.04em' }}>{task.id}</span>
<span style={{ fontSize: 10, padding: '2px 6px', borderRadius: 4, background: sm.color + '22', color: sm.color, fontWeight: 600 }}>{sm.label}</span>
<span style={{ fontSize: 10, padding: '2px 6px', borderRadius: 4, background: '#f59e0b22', color: '#f59e0b', fontWeight: 600 }}></span>
<span style={{ fontSize: 10, padding: '2px 6px', borderRadius: 4, background: '#ff527022', color: '#ff5270', fontWeight: 600 }}></span>
</div>
<div style={{ fontSize: 18, fontWeight: 700, lineHeight: 1.3 }}>{task.title}</div>
</div>