diff --git a/src/components/ContainerCard.tsx b/src/components/ContainerCard.tsx index 5aa8285..aafbc7a 100644 --- a/src/components/ContainerCard.tsx +++ b/src/components/ContainerCard.tsx @@ -47,6 +47,12 @@ const ContainerCard: React.FC = ({ const handleStart = async () => { await onStart(key); }; + const getLogColor = (line: string) => { + if (/\bERROR\b/.test(line)) return '#ff4d4d'; + if (/\bWARN\b/.test(line) || /\bWARNING\b/.test(line)) return '#ffd966'; + if (/\bINFO\b/.test(line)) return '#87CEEB'; + return '#ffffff'; + }; // Connect WebSocket logs when running and logsWsUrl changes useEffect(() => { @@ -142,18 +148,26 @@ const ContainerCard: React.FC = ({ ref={logBoxRef} style={{ backgroundColor: '#111', - color: '#0f0', padding: 10, borderRadius: 4, height: 150, overflowY: 'auto', marginTop: 4, fontSize: 12, - whiteSpace: 'pre-wrap', - wordWrap: 'break-word', }} > - {logs.join('\n')} + {logs.map((line, idx) => ( +
+ {line} +
+ ))} )}