mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
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:
@@ -58,8 +58,8 @@ export class InitService extends Observable<MappedProgress> {
|
||||
}
|
||||
}),
|
||||
catchError(e => {
|
||||
// @TODO this toast is presenting when we navigate away from init page. It seems other websockets exhibit the same behavior, but we never noticed because the error were not being caught and presented in this manner
|
||||
this.errorService.handleError(e)
|
||||
// @TODO Alex this toast is presenting when we navigate away from init page. It seems other websockets exhibit the same behavior, but we never noticed because the error were not being caught and presented in this manner. It seems odd that unsubscribing from a websocket subject would be treated as an error.
|
||||
// this.errorService.handleError(e)
|
||||
|
||||
return EMPTY
|
||||
}),
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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], []),
|
||||
|
||||
Reference in New Issue
Block a user