@@ -28,6 +28,7 @@ import { Sparkline } from 'lib/components/Sparkline'
2828import { TZLabel , TZLabelProps } from 'lib/components/TZLabel'
2929import { ListHog } from 'lib/components/hedgehogs'
3030import { LemonField } from 'lib/lemon-ui/LemonField'
31+ import { humanFriendlyNumber } from 'lib/utils'
3132import { cn } from 'lib/utils/css-classes'
3233import { Scene , SceneExport } from 'scenes/sceneTypes'
3334import { sceneConfigurations } from 'scenes/scenes'
@@ -67,6 +68,8 @@ export function LogsScene(): JSX.Element {
6768 isPinned,
6869 hasMoreLogsToLoad,
6970 logsPageSize,
71+ totalLogsMatchingFilters,
72+ logsRemainingToLoad,
7073 } = useValues ( logsLogic )
7174 const { runQuery, setDateRangeFromSparkline, loadMoreLogs } = useActions ( logsLogic )
7275
@@ -172,10 +175,10 @@ export function LogsScene(): JSX.Element {
172175 disabled = { ! hasMoreLogsToLoad || logsLoading }
173176 >
174177 { logsLoading
175- ? ` Loading up to ${ logsPageSize } more logs...`
178+ ? ' Loading more logs...'
176179 : hasMoreLogsToLoad
177- ? `Showing first ${ parsedLogs . length } ${ parsedLogs . length === 1 ? 'entry' : 'entries' } – load up to ${ logsPageSize } more`
178- : `Showing all ${ parsedLogs . length } ${ parsedLogs . length === 1 ? 'entry' : 'entries' } ` }
180+ ? `Showing ${ humanFriendlyNumber ( parsedLogs . length ) } of ${ humanFriendlyNumber ( totalLogsMatchingFilters ) } logs – load ${ humanFriendlyNumber ( Math . min ( logsPageSize , logsRemainingToLoad ) ) } more`
181+ : `Showing all ${ humanFriendlyNumber ( parsedLogs . length ) } logs ` }
179182 </ LemonButton >
180183 </ div >
181184 ) }
@@ -451,7 +454,15 @@ const Filters = (): JSX.Element => {
451454}
452455
453456const DisplayOptions = ( ) : JSX . Element => {
454- const { orderBy, wrapBody, prettifyJson, timestampFormat, logsPageSize } = useValues ( logsLogic )
457+ const {
458+ orderBy,
459+ wrapBody,
460+ prettifyJson,
461+ timestampFormat,
462+ logsPageSize,
463+ totalLogsMatchingFilters,
464+ sparklineLoading,
465+ } = useValues ( logsLogic )
455466 const { setOrderBy, setWrapBody, setPrettifyJson, setTimestampFormat, setLogsPageSize } = useActions ( logsLogic )
456467
457468 return (
@@ -492,20 +503,25 @@ const DisplayOptions = (): JSX.Element => {
492503 ] }
493504 />
494505 </ div >
495- < LemonField . Pure label = "Page Size" inline className = "items-center gap-2" >
496- < LemonSelect
497- value = { logsPageSize }
498- onChange = { ( value : number ) => setLogsPageSize ( value ) }
499- size = "small"
500- type = "secondary"
501- options = { [
502- { value : 100 , label : '100' } ,
503- { value : 200 , label : '200' } ,
504- { value : 500 , label : '500' } ,
505- { value : 1000 , label : '1000' } ,
506- ] }
507- />
508- </ LemonField . Pure >
506+ < div className = "flex items-center gap-4" >
507+ { ! sparklineLoading && totalLogsMatchingFilters > 0 && (
508+ < span className = "text-muted text-xs" > { humanFriendlyNumber ( totalLogsMatchingFilters ) } logs</ span >
509+ ) }
510+ < LemonField . Pure label = "Page size" inline className = "items-center gap-2" >
511+ < LemonSelect
512+ value = { logsPageSize }
513+ onChange = { ( value : number ) => setLogsPageSize ( value ) }
514+ size = "small"
515+ type = "secondary"
516+ options = { [
517+ { value : 100 , label : '100' } ,
518+ { value : 200 , label : '200' } ,
519+ { value : 500 , label : '500' } ,
520+ { value : 1000 , label : '1000' } ,
521+ ] }
522+ />
523+ </ LemonField . Pure >
524+ </ div >
509525 </ div >
510526 )
511527}
0 commit comments