mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2024-12-19 13:07:52 +00:00
Console log component modified
This commit is contained in:
parent
aef6d044b3
commit
f257992ffc
@ -2,14 +2,6 @@
|
||||
<div class="consoleHeader">
|
||||
<div class="consoleFiltering">
|
||||
<div class="consoleName">Console</div>
|
||||
<!-- <mat-form-field>
|
||||
<mat-label>Select filter</mat-label>
|
||||
<mat-select [(ngModel)]="selectedFilter" name="filter" (selectionChange)="applyFilter()">
|
||||
<mat-option *ngFor="let filter of filters" [value]="filter">
|
||||
{{filter}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field> -->
|
||||
<button class="filterButton" [matMenuTriggerFor]="filterMenu">
|
||||
<mat-icon>keyboard_arrow_down</mat-icon>
|
||||
</button>
|
||||
@ -29,7 +21,7 @@
|
||||
</div>
|
||||
|
||||
<div #console class="console">
|
||||
<span *ngFor="let event of filteredEvents">
|
||||
<span class="console-item" *ngFor="let event of filteredEvents">
|
||||
{{event.message}} <br/>
|
||||
</span>
|
||||
</div>
|
||||
|
@ -187,7 +187,7 @@ export class LogConsoleComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
clearConsole() {
|
||||
this.filteredEvents = [];
|
||||
this.console.nativeElement.scrollTop = this.console.nativeElement.scrollHeight * 2;
|
||||
this.console.nativeElement.scrollTop = this.console.nativeElement.scrollHeight;
|
||||
}
|
||||
|
||||
showCommand(message: string) {
|
||||
@ -201,6 +201,10 @@ export class LogConsoleComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
this.logEventsDataSource.add(event);
|
||||
this.filteredEvents = this.getFilteredEvents();
|
||||
this.console.nativeElement.scrollTop = this.console.nativeElement.scrollHeight;
|
||||
|
||||
setTimeout( () => {
|
||||
this.console.nativeElement.scrollTop = this.console.nativeElement.scrollHeight;
|
||||
}, 100 );
|
||||
}
|
||||
|
||||
getFilteredEvents(): LogEvent[] {
|
||||
|
Loading…
Reference in New Issue
Block a user