fix windows numpy import and add node timestamps
This commit is contained in:
@@ -492,6 +492,10 @@ function Flow() {
|
||||
console.log('[argonode] WS:', msg.type, msg.data?.node_id || msg.data?.node || '');
|
||||
switch (msg.type) {
|
||||
case 'execution_start':
|
||||
setNodes((ns) => ns.map((n) => ({
|
||||
...n,
|
||||
data: { ...n.data, processingTimeMs: null },
|
||||
})));
|
||||
setStatus({ text: 'Running workflow…', level: 'info' });
|
||||
break;
|
||||
case 'executing':
|
||||
@@ -518,6 +522,9 @@ function Flow() {
|
||||
},
|
||||
});
|
||||
break;
|
||||
case 'node_timing':
|
||||
updateNodeData(msg.data.node_id, { processingTimeMs: msg.data.elapsed_ms });
|
||||
break;
|
||||
case 'mesh3d':
|
||||
updateNodeData(msg.data.node_id, { meshData: msg.data.mesh });
|
||||
break;
|
||||
@@ -696,6 +703,7 @@ function Flow() {
|
||||
meshData: null,
|
||||
overlay: null,
|
||||
scalarValue: null,
|
||||
processingTimeMs: null,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -326,6 +326,16 @@ function formatScalarDisplay(scalarValue) {
|
||||
};
|
||||
}
|
||||
|
||||
function formatProcessingTime(value) {
|
||||
const ms = Number(value);
|
||||
if (!Number.isFinite(ms) || ms < 0) return null;
|
||||
if (ms < 1) return `${ms.toFixed(2)} ms`;
|
||||
if (ms < 10) return `${ms.toFixed(1)} ms`;
|
||||
if (ms < 1000) return `${Math.round(ms)} ms`;
|
||||
if (ms < 10000) return `${(ms / 1000).toFixed(2)} s`;
|
||||
return `${(ms / 1000).toFixed(1)} s`;
|
||||
}
|
||||
|
||||
function getSourceTypeForInput(store, nodeId, inputName) {
|
||||
const targetHandle = `input::${inputName}::`;
|
||||
const edge = store.edges?.find((e) => e.target === nodeId && e.targetHandle?.startsWith(targetHandle));
|
||||
@@ -428,6 +438,7 @@ function CustomNode({ id, data }) {
|
||||
const ctx = useContext(NodeContext);
|
||||
const def = data.definition;
|
||||
const scalarDisplay = formatScalarDisplay(data.scalarValue);
|
||||
const processingTimeText = formatProcessingTime(data.processingTimeMs);
|
||||
|
||||
// Parse inputs into data handles and widgets
|
||||
const required = def.input.required || {};
|
||||
@@ -699,6 +710,11 @@ function CustomNode({ id, data }) {
|
||||
<NodeTable rows={data.tableRows} />
|
||||
</CollapsibleSection>
|
||||
)}
|
||||
{processingTimeText && (
|
||||
<div className="node-benchmark" title={`Processed in ${processingTimeText}`}>
|
||||
{processingTimeText}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -150,6 +150,8 @@ html, body, #root {
|
||||
|
||||
.node-body {
|
||||
padding: 4px 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.node-warning {
|
||||
@@ -628,6 +630,20 @@ html, body, #root {
|
||||
text-align: right !important;
|
||||
}
|
||||
|
||||
.node-benchmark {
|
||||
align-self: flex-end;
|
||||
margin: 8px 10px 4px;
|
||||
padding: 3px 7px;
|
||||
border: 1px solid rgba(148, 163, 184, 0.28);
|
||||
border-radius: 999px;
|
||||
background: rgba(15, 23, 42, 0.92);
|
||||
color: #94a3b8;
|
||||
font-family: "SF Mono", "Fira Code", monospace;
|
||||
font-size: 10px;
|
||||
line-height: 1;
|
||||
font-variant-numeric: tabular-nums lining-nums;
|
||||
}
|
||||
|
||||
/* ── Node resize handles ───────────────────────────────────────────── */
|
||||
.node-resize-line {
|
||||
border-color: #90caf9 !important;
|
||||
|
||||
@@ -4,6 +4,7 @@ import react from '@vitejs/plugin-react';
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
server: {
|
||||
host: true,
|
||||
port: 5173,
|
||||
proxy: {
|
||||
'/nodes': 'http://127.0.0.1:8188',
|
||||
|
||||
Reference in New Issue
Block a user