@@ -4,6 +4,7 @@ import { createConnectedComponent } from '../components/connected-component.jsx'
44import Box from '../components/box/Box.js'
55import Button from '../components/button/button.jsx'
66import LogWarningModal from '../components/log-warning-modal.tsx'
7+ import { humanSize } from '../lib/files.js'
78
89const LOG_LEVELS = [ 'debug' , 'info' , 'warn' , 'error' , 'dpanic' , 'panic' , 'fatal' ]
910
@@ -226,14 +227,6 @@ const LogsScreen = ({
226227 }
227228 }
228229
229- const formatBytes = ( bytes ) => {
230- if ( bytes === 0 ) return '0 B'
231- const k = 1024
232- const sizes = [ 'B' , 'KB' , 'MB' , 'GB' ]
233- const i = Math . floor ( Math . log ( bytes ) / Math . log ( k ) )
234- return parseFloat ( ( bytes / Math . pow ( k , i ) ) . toFixed ( 2 ) ) + ' ' + sizes [ i ]
235- }
236-
237230 const getLogRangeDisplay = ( ) => {
238231 if ( ! logStorageStats || safeLogEntries . length === 0 ) {
239232 return `Log Entries (${ safeLogEntries . length } )`
@@ -303,18 +296,6 @@ const LogsScreen = ({
303296 </ div >
304297 </ div >
305298
306- { /* Storage Stats */ }
307- { logStorageStats && (
308- < div className = 'bt b--black-20 pt3' >
309- < h4 className = 'montserrat fw6 charcoal ma0 f6 mb2' > { t ( 'logs.storage.title' ) } </ h4 >
310- < div className = 'flex items-center charcoal-muted f6' >
311- < span className = 'mr3' > { t ( 'logs.storage.totalEntries' ) } : { logStorageStats . totalEntries . toLocaleString ( ) } </ span >
312- < span className = 'mr3' > { t ( 'logs.storage.estimatedSize' ) } : { formatBytes ( logStorageStats . estimatedSize ) } </ span >
313- < span > { t ( 'logs.storage.memoryBuffer' ) } : { safeLogEntries . length } /{ logBufferConfig . memory } </ span >
314- </ div >
315- </ div >
316- ) }
317-
318299 { /* Buffer Configuration */ }
319300 { showBufferConfig && (
320301 < div className = 'bt b--black-20 pt3 mt3' >
@@ -466,7 +447,7 @@ const LogsScreen = ({
466447 </ Box >
467448
468449 { /* Log Entries */ }
469- < Box style = { { } } >
450+ < Box className = 'mb3' style = { { } } >
470451 < div className = 'flex items-center justify-between mb3' >
471452 < div className = 'flex items-center' >
472453 < h3 className = 'montserrat fw4 charcoal ma0 f5' >
@@ -534,16 +515,16 @@ const LogsScreen = ({
534515 : < div >
535516 { safeLogEntries . map ( ( entry , index ) => (
536517 < div key = { `${ entry . timestamp } -${ entry . subsystem } -${ index } ` } className = 'flex mb1 lh-copy hover-bg-light-gray pa1 br1' >
537- < span className = 'w3 mr2 gray truncate f7' title = { entry . timestamp } >
518+ < span className = 'flex-none mr2 gray f7' style = { { minWidth : '90px' } } title = { entry . timestamp } >
538519 { formatTimestamp ( entry . timestamp ) }
539520 </ span >
540521 < span
541- className = 'w3 mr2 fw6 truncate f7'
542- style = { { color : getLevelColor ( entry . level ) } }
522+ className = 'flex-none mr2 fw6 f7'
523+ style = { { minWidth : '60px' , color : getLevelColor ( entry . level ) } }
543524 >
544525 { entry . level . toUpperCase ( ) }
545526 </ span >
546- < span className = 'w4 mr2 blue truncate f7' title = { entry . subsystem } >
527+ < span className = 'flex-none mr2 blue f7' style = { { minWidth : '120px' } } title = { entry . subsystem } >
547528 { entry . subsystem }
548529 </ span >
549530 < span className = 'flex-auto f7 pre-wrap' >
@@ -562,6 +543,18 @@ const LogsScreen = ({
562543 </ div >
563544 </ Box >
564545
546+ { /* Storage Stats */ }
547+ { logStorageStats && (
548+ < div className = 'bt b--black-20 pt3' >
549+ < h4 className = 'montserrat fw6 charcoal ma0 f6 mb2' > { t ( 'logs.storage.title' ) } </ h4 >
550+ < div className = 'flex items-center charcoal-muted f6' >
551+ < span className = 'mr3' > { t ( 'logs.storage.totalEntries' ) } : { logStorageStats . totalEntries . toLocaleString ( ) } </ span >
552+ < span className = 'mr3' > { t ( 'logs.storage.estimatedSize' ) } : { humanSize ( logStorageStats . estimatedSize ) } </ span >
553+ < span > { t ( 'logs.storage.memoryBuffer' ) } : { safeLogEntries . length } /{ logBufferConfig . memory } </ span >
554+ </ div >
555+ </ div >
556+ ) }
557+
565558 { /* Warning Modal */ }
566559 < LogWarningModal
567560 isOpen = { warningModal . isOpen }
0 commit comments