diff --git a/components/dashboard/network-timeline.tsx b/components/dashboard/network-timeline.tsx index 83e1bf5..305d565 100644 --- a/components/dashboard/network-timeline.tsx +++ b/components/dashboard/network-timeline.tsx @@ -136,6 +136,31 @@ export function NetworkTimeline({ return () => clearInterval(interval); }, [lastUpdate]); + // 复制任务ID + const copyTaskId = async (taskId: string) => { + try { + if (navigator.clipboard && window.isSecureContext) { + await navigator.clipboard.writeText(taskId); + setCopiedTaskId(taskId); + setTimeout(() => setCopiedTaskId(null), 1500); + } else { + const textArea = document.createElement('textarea'); + textArea.value = taskId; + textArea.style.position = 'fixed'; + textArea.style.left = '-9999px'; + document.body.appendChild(textArea); + textArea.focus(); + textArea.select(); + document.execCommand('copy'); + document.body.removeChild(textArea); + setCopiedTaskId(taskId); + setTimeout(() => setCopiedTaskId(null), 1500); + } + } catch (e) { + // noop + } + }; + // 计算任务统计信息 const taskStats = useMemo(() => { if (!tasks || tasks.length === 0) { @@ -1203,7 +1228,7 @@ export function NetworkTimeline({
状态
{/* 展开/折叠按钮列 */} -
任务名称
+
任务名称
状态
类型
进度
@@ -1251,7 +1276,13 @@ export function NetworkTimeline({
{task.level === 0 && task.subTasks && task.subTasks.length > 0 && ( { + e.stopPropagation(); + toggleTaskExpansion(task.id); + }} + title={expandedTasks.has(task.id) ? '收起子任务' : '展开子任务'} + data-alt="expand-toggle" whileHover={{ scale: 1.1 }} > -
任务ID: {task.name}
+
+ 任务ID: + {task.id} + +
层级: {task.level === 0 ? '主任务' : '子任务'}
{/* 子任务完成状况 */}