fix log viewer for empty logs

This commit is contained in:
jonaswinkler 2021-02-06 18:51:31 +01:00
parent d2c34fb9c7
commit 0e76441684
2 changed files with 3 additions and 3 deletions

View File

@ -11,7 +11,7 @@
<div [ngbNavOutlet]="nav" class="mt-2"></div> <div [ngbNavOutlet]="nav" class="mt-2"></div>
<div #logContainer class="bg-dark p-3 mb-3 text-light text-monospace log-container"> <div class="bg-dark p-3 mb-3 text-light text-monospace log-container">
<p <p
class="m-0 p-0 log-entry-{{getLogLevel(log)}}" class="m-0 p-0 log-entry-{{getLogLevel(log)}}"
*ngFor="let log of logs" style="white-space: pre;">{{log}}</p> *ngFor="let log of logs" style="white-space: pre;">{{log}}</p>

View File

@ -10,8 +10,6 @@ export class LogsComponent implements OnInit {
constructor(private logService: LogService) { } constructor(private logService: LogService) { }
@ViewChild('logContainer') private logContainer: ElementRef
logs: string[] = [] logs: string[] = []
logFiles: string[] = [] logFiles: string[] = []
@ -31,6 +29,8 @@ export class LogsComponent implements OnInit {
reloadLogs() { reloadLogs() {
this.logService.get(this.activeLog).subscribe(result => { this.logService.get(this.activeLog).subscribe(result => {
this.logs = result this.logs = result
}, error => {
this.logs = []
}) })
} }