@@ -59,24 +59,23 @@ export function LogTable({ logs = [], onSort, sortColumn, sortOrder, observerRef
5959 ) : (
6060 < >
6161 < div className = "sticky top-0 z-10 bg-white" >
62- < Table className = "border-collapse w-full table-fixed" >
63- < TableHeader className = "table-header" >
64- < TableRow >
65- < TableHead className = "w-[10%] truncate" > ID</ TableHead >
62+ < Table className = "border-collapse w-full table-fixed p-0" >
63+ < TableHeader className = "table-header p-0 m-0" >
64+ < TableRow className = "p-0 m-0" >
6665 < TableHead
67- className = "w-[120px] max-w-[120px] truncate "
66+ className = "w-[15%] whitespace-nowrap px-4 py-3 text-left "
6867 onClick = { ( ) => onSort ( 'timestamp' ) }
6968 onMouseEnter = { ( ) => setHoveredColumn ( 'timestamp' ) }
7069 onMouseLeave = { ( ) => setHoveredColumn ( null ) }
7170 >
7271 Time{ renderSortIndicator ( 'timestamp' ) }
7372 </ TableHead >
74- < TableHead className = "w-[80px] max-w-[80px] truncate " > Level</ TableHead >
75- < TableHead className = "w-[120px] max-w-[120px] truncate " > Service</ TableHead >
76- < TableHead className = "w-[80px] max-w-[80px] truncate " > Method</ TableHead >
77- < TableHead className = "w-[14 %] truncate" > Path </ TableHead >
78- < TableHead className = "w-[80px] max-w-[80px] truncate" > Status </ TableHead >
79- < TableHead className = "w-[30 %] truncate " > Message</ TableHead >
73+ < TableHead className = "w-[8%] whitespace-nowrap px-4 py-3 text-left " > Level</ TableHead >
74+ < TableHead className = "w-[12%] whitespace-nowrap px-4 py-3 text-left " > Service</ TableHead >
75+ < TableHead className = "w-[8%] whitespace-nowrap px-4 py-3 text-left " > Method</ TableHead >
76+ < TableHead className = "w-[8 %] whitespace-nowrap px-4 py-3 text-left" > Status </ TableHead >
77+ < TableHead className = "w-[14%] px-4 py-3 text-left" > Path </ TableHead >
78+ < TableHead className = "w-[35 %] px-4 py-3 text-left " > Message</ TableHead >
8079 </ TableRow >
8180 </ TableHeader >
8281 </ Table >
@@ -92,57 +91,57 @@ export function LogTable({ logs = [], onSort, sortColumn, sortOrder, observerRef
9291 ) : (
9392 < div className = "flex-1 overflow-auto min-h-0" >
9493 < div className = "h-full" >
95- < Table className = "border-collapse w-full table-fixed" >
94+ < Table className = "border-collapse w-full table-fixed p-0 " >
9695 < TableBody >
9796 { logs ?. map ( ( log , index ) => (
98- < React . Fragment key = { log . request_id || index } >
99- { hasMore && index === logs . length - 6 && (
100- < tr ref = { observerRef } />
101- ) }
102- < TableRow
103- className = "table-row cursor-pointer hover:bg-muted/50"
104- onClick = { ( ) => handleRowClick ( log ) }
105- >
106- < TableCell className = "w-[10%] truncate" > { log . request_id } </ TableCell >
107- < TableCell className = "w-[120px] max-w-[120px] truncate" >
108- { new Date ( log . timestamp ) . toLocaleDateString ( 'en-GB' , {
109- day : '2-digit' ,
110- month : '2-digit' ,
111- year : '2-digit' ,
112- hour : '2-digit' ,
113- minute : '2-digit' ,
114- second : '2-digit' ,
115- hour12 : false
116- } ) . replace ( ',' , '' ) }
117- </ TableCell >
118- < TableCell className = "w-[80px] max-w-[80px] truncate" >
119- < span className = { `inline-flex items-center rounded-sm px-2 py-1 text-xs font-medium
120- ${ log . level === 'ERROR' ? 'bg-[var(--bg-pill-error)] text-[var(--text-pill-error)]' :
121- log . level === 'WARN' ? 'bg-[var(--bg-pill-warn)] text-[var(--text-pill-warn)]' :
122- log . level === 'INFO' ? 'bg-[var(--bg-pill-info)] text-[var(--text-pill-info)]' :
123- log . level === 'DEBUG' ? 'bg-[var(--bg-pill-debug)] text-[var(--text-pill-debug)]' :
124- 'bg-[var(--bg-pill-default)] text-[var(--text-pill-default)]' } `
125- } >
126- { log . level }
127- </ span >
128- </ TableCell >
129- < TableCell className = "w-[120px] max-w-[120px] truncate" > { log . service } </ TableCell >
130- < TableCell className = "w-[80px] max-w-[80px] truncate" > { log . request_method } </ TableCell >
131- < TableCell className = "w-[14%] truncate" > { log . request_path } </ TableCell >
132- < TableCell className = "w-[80px] max-w-[80px] truncate" >
133- < span className = { `inline-flex items-center rounded-sm px-2 py-1 text-xs font-medium
134- ${ log . status_code >= 400 ? 'bg-[var(--bg-pill-error)] text-[var(--text-pill-error)]' :
135- log . status_code >= 300 ? 'bg-[var(--bg-pill-warn)] text-[var(--text-pill-warn)]' :
136- log . status_code >= 200 ? 'bg-[var(--bg-pill-success)] text-[var(--text-pill-success)]' :
137- 'bg-[var(--bg-pill-info)] text-[var(--text-pill-info)]' } `
138- } >
139- { log . status_code }
140- </ span >
141- </ TableCell >
142- < TableCell className = "w-[30%] truncate" > { log . message } </ TableCell >
143- </ TableRow >
144- </ React . Fragment >
97+ < TableRow
98+ key = { index }
99+ className = "table-row cursor-pointer hover:bg-muted/50 p-0 m-0"
100+ onClick = { ( ) => handleRowClick ( log ) }
101+ >
102+ < TableCell className = "w-[15%] whitespace-nowrap px-4 py-3 text-left truncate" >
103+ { new Date ( log . timestamp ) . toLocaleDateString ( 'en-GB' , {
104+ day : '2-digit' ,
105+ month : '2-digit' ,
106+ year : '2-digit' ,
107+ hour : '2-digit' ,
108+ minute : '2-digit' ,
109+ second : '2-digit' ,
110+ hour12 : false
111+ } ) . replace ( ',' , '' ) }
112+ </ TableCell >
113+ < TableCell className = "w-[8%] whitespace-nowrap px-4 py-3 text-left" >
114+ < span className = { `inline-flex items-center rounded-sm px-2 py-1 text-xs font-medium
115+ ${ log . level === 'ERROR' ? 'bg-[var(--bg-pill-error)] text-[var(--text-pill-error)]' :
116+ log . level === 'WARN' ? 'bg-[var(--bg-pill-warn)] text-[var(--text-pill-warn)]' :
117+ log . level === 'INFO' ? 'bg-[var(--bg-pill-info)] text-[var(--text-pill-info)]' :
118+ log . level === 'DEBUG' ? 'bg-[var(--bg-pill-debug)] text-[var(--text-pill-debug)]' :
119+ 'bg-[var(--bg-pill-default)] text-[var(--text-pill-default)]' } `
120+ } >
121+ { log . level }
122+ </ span >
123+ </ TableCell >
124+ < TableCell className = "w-[12%] whitespace-nowrap px-4 py-3 text-left" > { log . service } </ TableCell >
125+ < TableCell className = "w-[8%] whitespace-nowrap px-4 py-3 text-left" > { log . request_method } </ TableCell >
126+ < TableCell className = "w-[8%] whitespace-nowrap px-4 py-3 text-left" >
127+ < span className = { `inline-flex items-center rounded-sm px-2 py-1 text-xs font-medium
128+ ${ log . status_code >= 400 ? 'bg-[var(--bg-pill-error)] text-[var(--text-pill-error)]' :
129+ log . status_code >= 300 ? 'bg-[var(--bg-pill-warn)] text-[var(--text-pill-warn)]' :
130+ log . status_code >= 200 ? 'bg-[var(--bg-pill-success)] text-[var(--text-pill-success)]' :
131+ 'bg-[var(--bg-pill-info)] text-[var(--text-pill-info)]' } `
132+ } >
133+ { log . status_code }
134+ </ span >
135+ </ TableCell >
136+ < TableCell className = "w-[14%] truncate px-4 py-3 text-left" > { log . request_path } </ TableCell >
137+ < TableCell className = "w-[35%] truncate px-4 py-3 text-left" > { log . message } </ TableCell >
138+ </ TableRow >
145139 ) ) }
140+ { hasMore && (
141+ < TableRow ref = { observerRef } >
142+ < TableCell colSpan = { 7 } className = "p-0 h-4" />
143+ </ TableRow >
144+ ) }
146145 </ TableBody >
147146 </ Table >
148147 </ div >
0 commit comments