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="consoleHeader">
|
||||||
<div class="consoleFiltering">
|
<div class="consoleFiltering">
|
||||||
<div class="consoleName">Console</div>
|
<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">
|
<button class="filterButton" [matMenuTriggerFor]="filterMenu">
|
||||||
<mat-icon>keyboard_arrow_down</mat-icon>
|
<mat-icon>keyboard_arrow_down</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
@ -29,7 +21,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div #console class="console">
|
<div #console class="console">
|
||||||
<span *ngFor="let event of filteredEvents">
|
<span class="console-item" *ngFor="let event of filteredEvents">
|
||||||
{{event.message}} <br/>
|
{{event.message}} <br/>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -187,7 +187,7 @@ export class LogConsoleComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
clearConsole() {
|
clearConsole() {
|
||||||
this.filteredEvents = [];
|
this.filteredEvents = [];
|
||||||
this.console.nativeElement.scrollTop = this.console.nativeElement.scrollHeight * 2;
|
this.console.nativeElement.scrollTop = this.console.nativeElement.scrollHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
showCommand(message: string) {
|
showCommand(message: string) {
|
||||||
@ -201,6 +201,10 @@ export class LogConsoleComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
this.logEventsDataSource.add(event);
|
this.logEventsDataSource.add(event);
|
||||||
this.filteredEvents = this.getFilteredEvents();
|
this.filteredEvents = this.getFilteredEvents();
|
||||||
this.console.nativeElement.scrollTop = this.console.nativeElement.scrollHeight;
|
this.console.nativeElement.scrollTop = this.console.nativeElement.scrollHeight;
|
||||||
|
|
||||||
|
setTimeout( () => {
|
||||||
|
this.console.nativeElement.scrollTop = this.console.nativeElement.scrollHeight;
|
||||||
|
}, 100 );
|
||||||
}
|
}
|
||||||
|
|
||||||
getFilteredEvents(): LogEvent[] {
|
getFilteredEvents(): LogEvent[] {
|
||||||
|
Loading…
Reference in New Issue
Block a user