`;
modal.classList.remove('hidden');
feather.replace();
}
function renderFlowDiagram(nodes) {
const allNodes = [
"search/kb", "validate/kb", "search/web", "steps/perform",
"script/generate", "email/send", "ticket/route", "ticket/create", "issue/auto-resolve"
];
let html = '';
for (let i = 0; i < allNodes.length; i++) {
const nodeName = allNodes[i];
const nodeData = nodes.find(n => n.node_name === nodeName);
// Determine node status
let nodeStatus;
if (nodeData) {
nodeStatus = nodeData.status === 'success' ? 'success' : 'failed';
} else {
nodeStatus = 'pending';
}
// Node element
html += `
${i+1}
${i < allNodes.length - 1 ? `
` : ''}
`;
}
return html;
}
function renderNodeDetails(node) {
return `
${node.node_name}
${node.status}
${new Date(node.timestamp).toLocaleString()}
Input
${JSON.stringify(node.input_json, null, 2)}
Output
${JSON.stringify(node.output_json, null, 2)}
`;
}
function startNewRun() {
// In a real app, this would call the API to start a new run
alert('Starting a new SmartTriage run...');
// Then we would navigate to the run details page or refresh the list
}