diff --git a/web/package-lock.json b/web/package-lock.json index 8aa6273..df53a5e 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -1,13 +1,14 @@ { "name": "graphbook-web", - "version": "0.8.1", + "version": "0.9.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "graphbook-web", - "version": "0.8.1", + "version": "0.9.3", "dependencies": { + "@ant-design/icons": "^5.5.1", "@codemirror/lang-python": "^6.1.5", "@microlink/react-json-view": "^1.23.1", "@uiw/codemirror-theme-basic": "^4.21.25", @@ -84,13 +85,13 @@ } }, "node_modules/@ant-design/icons": { - "version": "5.3.5", - "resolved": "https://registry.npmjs.org/@ant-design/icons/-/icons-5.3.5.tgz", - "integrity": "sha512-Vyv/OsKz56BsKBtcRlLP6G8RGaRW43f7G5dK3XNPCaeV4YyehLVaITuNKi2YJG9hMVURkBdzdGhveNQlnKTFqw==", + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/@ant-design/icons/-/icons-5.5.2.tgz", + "integrity": "sha512-xc53rjVBl9v2BqFxUjZGti/RfdDeA8/6KYglmInM2PNqSXc/WfuGDTifJI/ZsokJK0aeKvOIbXc9y2g8ILAhEA==", "dependencies": { "@ant-design/colors": "^7.0.0", "@ant-design/icons-svg": "^4.4.0", - "@babel/runtime": "^7.11.2", + "@babel/runtime": "^7.24.8", "classnames": "^2.2.6", "rc-util": "^5.31.1" }, @@ -402,9 +403,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.1.tgz", - "integrity": "sha512-+BIznRzyqBf+2wCTxcKE3wDjfGeCoVE61KSHGpkzqrLi8qxqFwBeUFyId2cxkTmm55fzDGnm0+yCxaxygrLUnQ==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.0.tgz", + "integrity": "sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==", "dependencies": { "regenerator-runtime": "^0.14.0" }, diff --git a/web/src/components/Monitor.tsx b/web/src/components/Monitor.tsx index 0d3417d..48348d3 100644 --- a/web/src/components/Monitor.tsx +++ b/web/src/components/Monitor.tsx @@ -294,31 +294,49 @@ function StatsView({ data }) { function LogsView({ data, shouldScrollToBottom }) { const bottomRef = useRef(null); + const { token } = theme.useToken(); + useEffect(() => { if (shouldScrollToBottom) { - bottomRef.current?.scrollIntoView({ behavior: 'instant' }); + bottomRef.current?.scrollIntoView({ block: "nearest", inline: "nearest", behavior: 'instant' }); } }, [data, shouldScrollToBottom]); + const bg = useCallback((i) => { + return i % 2 === 0 ? token.colorBgBase : token.colorBgLayout; + }, [token]); + + const textOf = useCallback((t) => { + if (typeof t === 'string') { + return t; + } + return JSON.stringify(t); + }, []); + return ( - data && - ( + !data || data.length === 0 ? + : { data.map((log, i) => { const { msg } = log; + const style: React.CSSProperties = { + backgroundColor: bg(i), + margin: '1px 0', + fontSize: '.8em', + lineHeight: 1, + borderLeft: `2px solid ${token.colorBorder}`, + padding: '1px 0 1px 4px' + }; return ( - - {msg} - + {textOf(msg)} ); }) }
- ) - ) + ); } type NotesViewType = 'default' | 'image'; diff --git a/web/src/components/Nodes/Step.tsx b/web/src/components/Nodes/Step.tsx index e7569b2..6c28f01 100644 --- a/web/src/components/Nodes/Step.tsx +++ b/web/src/components/Nodes/Step.tsx @@ -67,7 +67,7 @@ export function Step({ id, data, selected }) { if (isPromptNode) { t.push({ label: 'Prompts', - children: , + children: , icon: }); } @@ -144,6 +144,13 @@ function LogsView({ data }) { return i % 2 === 0 ? token.colorBgBase : token.colorBgLayout; }, [token]); + const textOf = useCallback((t) => { + if (typeof t === 'string') { + return t; + } + return JSON.stringify(t); + }, []); + return ( data.length === 0 ? : @@ -160,7 +167,7 @@ function LogsView({ data }) { padding: '1px 0 1px 4px' }; return ( - {msg} + {textOf(msg)} ); }) }