This repository has been archived by the owner on Mar 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* docs: LogView Plugin description corrected * fix(config): remove outdated config properties (#1365) * feat(vm-logs): scroll * fix merge conflict * fix tests * fix autoscroll refresh * move selector
- Loading branch information
Vladimir Shakhov
committed
Nov 2, 2018
1 parent
d9096e5
commit 7157434
Showing
22 changed files
with
365 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export interface VmLog { | ||
id: string; | ||
timestamp: string; | ||
file: string; | ||
log: string; | ||
|
8 changes: 4 additions & 4 deletions
8
src/app/vm-logs/redux/selectors/load-auto-update-vm-logs-request-params.selector.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/app/vm-logs/redux/selectors/select-is-autoupdate-with-scroll.selector.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { createSelector } from '@ngrx/store'; | ||
import { filterNewestFirst } from '../vm-logs.reducers'; | ||
import { selectIsAutoUpdateEnabled } from '../vm-logs-auto-update.reducers'; | ||
|
||
export const selectIsAutoUpdateWithScroll = createSelector( | ||
selectIsAutoUpdateEnabled, | ||
filterNewestFirst, | ||
(isAutoUpdateEnabled, newestFirst) => isAutoUpdateEnabled && !newestFirst, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Directive, Input, AfterViewInit, QueryList, ElementRef, OnDestroy } from '@angular/core'; | ||
import { VmLogsTableComponent } from './vm-logs-table.component'; | ||
import { Subscription } from 'rxjs'; | ||
|
||
@Directive({ | ||
selector: '[csScrollToLast]', | ||
}) | ||
export class ScrollToLastDirective implements AfterViewInit, OnDestroy { | ||
private shouldScrollToLast: boolean; | ||
|
||
@Input() | ||
set csScrollToLast(value: boolean) { | ||
this.shouldScrollToLast = value; | ||
} | ||
|
||
private focusLastRowSubscription: Subscription; | ||
|
||
constructor(private host: VmLogsTableComponent) {} | ||
|
||
public ngAfterViewInit() { | ||
this.focusLastRowSubscription = this.host.rows.changes.subscribe( | ||
(rows: QueryList<ElementRef>) => { | ||
if (rows.last && this.shouldScrollToLast) { | ||
rows.last.nativeElement.scrollIntoView(); | ||
} | ||
}, | ||
); | ||
} | ||
|
||
public ngOnDestroy() { | ||
if (this.focusLastRowSubscription) { | ||
this.focusLastRowSubscription.unsubscribe(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,8 @@ | |
.mat-header-cell { | ||
padding-right: 24px; | ||
} | ||
|
||
.show-more { | ||
width: 100%; | ||
margin: 10px auto; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.