init UI increase logs buffer and don't throw on websocket unsubscribe (#2669)

* init UI increase logs buffer and don't throw on websocket unsubscribe

* fix: remove smooth scroll for logs

---------

Co-authored-by: waterplea <alexander@inkin.ru>
This commit is contained in:
Matt Hill
2024-07-18 21:49:31 -06:00
committed by GitHub
parent 8f0bdcd172
commit 196561fed2
3 changed files with 6 additions and 6 deletions

View File

@@ -24,10 +24,10 @@ export class LogsComponent {
scroll = true
scrollTo(bottom: HTMLElement) {
if (this.scroll) bottom.scrollIntoView({ behavior: 'smooth' })
if (this.scroll) bottom.scrollIntoView()
}
onBottom([{ isIntersecting }]: readonly IntersectionObserverEntry[]) {
this.scroll = isIntersecting
onBottom(entries: readonly IntersectionObserverEntry[]) {
this.scroll = entries[entries.length - 1].isIntersecting
}
}

View File

@@ -39,7 +39,7 @@ export class LogsService extends Observable<readonly string[]> {
this.api.initFollowLogs({ boot: 0 }),
).pipe(
switchMap(({ guid }) => this.api.openWebsocket$<Log>(guid, {})),
bufferTime(250),
bufferTime(500),
filter(logs => !!logs.length),
map(convertAnsi),
scan((logs: readonly string[], log) => [...logs, log], []),