MCPcopy Create free account
hub / github.com/MiroMindAI/MiroThinker / loadTraceFile

Function loadTraceFile

apps/visualize-trace/static/js/script.js:464–511  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

462}
463
464async function loadTraceFile() {
465 const selectedFile = elements.fileSelect.value;
466 if (!selectedFile) {
467 showError('请选择一个trace文件');
468 return;
469 }
470
471 showLoading();
472
473 try {
474 // 加载文件
475 await apiCall('/api/load_trace', {
476 method: 'POST',
477 body: JSON.stringify({ file_path: selectedFile })
478 });
479
480 // 并行加载所有数据
481 const [basicInfo, executionSummary, performanceSummary, executionFlow, spansStats, stepLogsStats] = await Promise.all([
482 apiCall('/api/basic_info'),
483 apiCall('/api/execution_summary'),
484 apiCall('/api/performance_summary'),
485 apiCall('/api/execution_flow'),
486 apiCall('/api/spans_summary'),
487 apiCall('/api/step_logs_summary')
488 ]);
489
490 // 更新界面
491 updateBasicInfo(basicInfo);
492 updateExecutionSummary(executionSummary);
493 updatePerformanceSummary(performanceSummary);
494 updateExecutionFlow(executionFlow);
495 updateSpansStats(spansStats);
496 updateStepLogsStats(stepLogsStats);
497
498 // 显示当前文件信息
499 const currentFile = currentFileList[currentFileIndex];
500 if (currentFile) {
501 showSuccess(`文件加载成功: ${currentFile.name} (${currentFileIndex + 1}/${currentFileList.length})`);
502 } else {
503 showSuccess('文件加载成功');
504 }
505
506 } catch (error) {
507 showError('加载文件失败: ' + error.message);
508 } finally {
509 hideLoading();
510 }
511}
512
513// 界面更新函数
514function updateBasicInfo(data) {

Callers 3

gotoPrevFileFunction · 0.85
gotoNextFileFunction · 0.85
handleKeyboardShortcutsFunction · 0.85

Calls 11

showErrorFunction · 0.85
showLoadingFunction · 0.85
apiCallFunction · 0.85
updateBasicInfoFunction · 0.85
updateExecutionSummaryFunction · 0.85
updatePerformanceSummaryFunction · 0.85
updateExecutionFlowFunction · 0.85
updateSpansStatsFunction · 0.85
updateStepLogsStatsFunction · 0.85
showSuccessFunction · 0.85
hideLoadingFunction · 0.85

Tested by

no test coverage detected