i18n-title
info="Review the log files for the application and for email checking."
i18n-info>
- <div class="form-check form-switch" (click)="toggleAutoRefresh()">
- <input class="form-check-input" type="checkbox" role="switch" id="autoRefreshSwitch" [attr.checked]="autoRefreshInterval">
+ <div class="form-check form-switch">
+ <input class="form-check-input" type="checkbox" role="switch" id="autoRefreshSwitch" (click)="toggleAutoRefresh()" [attr.checked]="autoRefreshInterval">
<label class="form-check-label" for="autoRefreshSwitch" i18n>Auto refresh</label>
</div>
</pngx-page-header>
Component,
ElementRef,
OnInit,
- AfterViewChecked,
ViewChild,
OnDestroy,
+ ChangeDetectorRef,
} from '@angular/core'
import { Subject, takeUntil } from 'rxjs'
import { LogService } from 'src/app/services/rest/log.service'
templateUrl: './logs.component.html',
styleUrls: ['./logs.component.scss'],
})
-export class LogsComponent implements OnInit, AfterViewChecked, OnDestroy {
- constructor(private logService: LogService) {}
+export class LogsComponent implements OnInit, OnDestroy {
+ constructor(
+ private logService: LogService,
+ private changedetectorRef: ChangeDetectorRef
+ ) {}
public logs: string[] = []
})
}
- ngAfterViewChecked() {
- this.scrollToBottom()
- }
-
ngOnDestroy(): void {
this.unsubscribeNotifier.next(true)
this.unsubscribeNotifier.complete()
next: (result) => {
this.logs = result
this.isLoading = false
+ this.scrollToBottom()
},
error: () => {
this.logs = []
}
scrollToBottom(): void {
+ this.changedetectorRef.detectChanges()
this.logContainer?.nativeElement.scroll({
top: this.logContainer.nativeElement.scrollHeight,
left: 0,