Skip to content

Commit

Permalink
Merge pull request #35 from cmu-sei/7.27.2020
Browse files Browse the repository at this point in the history
Update for 7.27.2020
  • Loading branch information
sei-ebram authored Jul 27, 2020
2 parents 62dd2c7 + bea6ed4 commit 85bbc16
Show file tree
Hide file tree
Showing 187 changed files with 23,867 additions and 11,293 deletions.
2 changes: 2 additions & 0 deletions caster.ui/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tabWidth: 2
singleQuote: true
12 changes: 6 additions & 6 deletions caster.ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions caster.ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
"rxjs": "~6.5.5",
"tslib": "^1.10.0",
"webpack": "^4.40.2",
"xterm": "^4.0.1",
"xterm-addon-fit": "^0.3.0",
"xterm": "^4.7.0",
"xterm-addon-fit": "^0.4.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
*ngIf="
file.lockedById !== null && !file.administrativelyLocked
"
class="highlight mat-list-item-disabled"
class="highlight"
fxLayout="row"
fxLayoutAlign="start center"
fxFill
Expand All @@ -218,7 +218,7 @@
</div>
<div
*ngIf="file.administrativelyLocked"
class="highlight mat-list-item-disabled"
class="highlight"
fxLayout="row"
fxLayoutAlign="start center"
fxFill
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
<mat-expansion-panel
*ngFor="let item of displayedRows$ | async; trackBy: trackByFn"
[expanded]="isExpanded(item)"
(expandedChange)="expandedFn($event, item)"
(afterExpand)="afterExpand($event, item)"
(afterCollapse)="afterCollapse($event, item)"
>
<mat-expansion-panel-header
class="mat-row"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,14 @@ export class CwdTableComponent<T> implements OnInit, OnChanges {
return index;
}
}

afterExpand(event, item: T) {
const expand = true;
this.expand.emit({ expand, item });
}

afterCollapse(event, item: T) {
const expand = false;
this.expand.emit({ expand, item });
}
}
19 changes: 13 additions & 6 deletions caster.ui/src/app/workspace/components/run/run.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ DM20-0181

import {
Component,
OnInit,
Input,
ChangeDetectionStrategy,
OnChanges,
Expand All @@ -19,6 +18,7 @@ import {
ElementRef,
Output,
EventEmitter,
AfterViewInit,
} from '@angular/core';
import { Run, RunStatus } from 'src/app/generated/caster-api';
import { ISubscription } from '@microsoft/signalr';
Expand All @@ -32,7 +32,7 @@ import { FitAddon } from 'xterm-addon-fit';
styleUrls: ['./run.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class RunComponent implements OnInit, OnChanges, OnDestroy {
export class RunComponent implements AfterViewInit, OnChanges, OnDestroy {
@Input() run: Run;
@Input() loading: boolean;
@Output() planOutput = new EventEmitter<string>();
Expand All @@ -44,18 +44,25 @@ export class RunComponent implements OnInit, OnChanges, OnDestroy {
isPlan = false;
isApply = false;

@ViewChild('xterm', { static: true, read: ElementRef }) eleXtern: ElementRef;
@ViewChild('xterm') eleXterm: ElementRef;

// there is no infinite scrolling for xterm. Set number of lines to very large number!
xtermOptions: ITerminalOptions = { convertEol: true, scrollback: 9999999 };
xtermOptions: ITerminalOptions = {
convertEol: true,
scrollback: 9999999,
};
xterm: Terminal = new Terminal(this.xtermOptions);
fitAddon: FitAddon = new FitAddon();

constructor(private signalRService: SignalRService) {}

ngOnInit() {
this.xterm.open(this.eleXtern.nativeElement);
ngAfterViewInit() {
this.openTerminal();
}

openTerminal() {
this.xterm.loadAddon(this.fitAddon);
this.xterm.open(this.eleXterm.nativeElement);
this.fitAddon.fit();
}

Expand Down
Loading

0 comments on commit 85bbc16

Please sign in to comment.