Skip to content

Commit 694b643

Browse files
committed
feat: add terminal template support to UTM code view and enhance playbook card navigation
1 parent 3c73d69 commit 694b643

5 files changed

Lines changed: 21 additions & 9 deletions

File tree

frontend/src/app/incident-response/playbooks/playbooks.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ <h5 class="card-title mb-0 label-header">FLOWS</h5>
5858
<div class="d-flex flex-1 flex-column h-100 m-h-0">
5959
<div class="d-flex px-1 pt-3 h-100 m-h-0 justify-content-center playbooks-container">
6060
<div class="playbook-card" *ngFor="let item of playbookService.playbooks$ | async; trackBy: trackByFn">
61-
<div class="h-100 text-card-foreground shadow-sm transition-all d-flex flex-column rounded-lg border border-border bg-background p-3 cursor-pointer">
61+
<div [routerLink]="['/soar/create-flow']"
62+
[queryParams]="{ id: item.id }" class="h-100 text-card-foreground shadow-sm transition-all d-flex flex-column rounded-lg border border-border bg-background p-3 cursor-pointer">
6263
<div class="card-header p-0 pb-1 d-flex align-items-center gap-3">
6364
<div [ngClass]="{'bg-primary': item.active, 'bg-secondary': !item.active}" class="icon-code d-flex justify-content-center align-items-center">
6465
</div>

frontend/src/app/incident-response/shared/component/action-builder/action-builder.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ <h4 class="panel-title m-0">Flow Actions</h4>
143143
</div>
144144
</div>
145145

146-
<app-utm-code-view style="width: 800px" class="mt-3" *ngIf="command$ | async as command" [code]="command" [allowCopy]="false"></app-utm-code-view>
146+
<app-utm-code-view [template]="'terminal'" style="width: 800px" class="mt-3" *ngIf="command$ | async as command" [code]="command" [allowCopy]="false"></app-utm-code-view>
147147

148148
</div>
149149

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
1-
<div class="card p-2 d-flex flex-row justify-content-between w-100 align-items-center">
2-
<code *ngIf="code; else noCodePlaceholder" [innerHTML]="code" (copy)="preventCopy($event)" class="user-select"></code>
3-
<i (click)="copyCode()" *ngIf="allowCopy" class="icon-copy cursor-pointer"
4-
ngbTooltip="Copy"></i>
1+
<div *ngIf="template === 'default'" class="card p-2 d-flex flex-row justify-content-between w-100 align-items-center">
2+
<code *ngIf="code; else noCodePlaceholder" [innerHTML]="code" (copy)="preventCopy($event)" class="user-select"></code>
3+
<i (click)="copyCode()" *ngIf="allowCopy" class="icon-copy cursor-pointer"
4+
ngbTooltip="Copy"></i>
55
<ng-template #noCodePlaceholder>
66
<code class="user-select text-muted">No code available, you must select the platform first.</code>
77
<i class="icon-warning"></i>
88
</ng-template>
99
</div>
10+
11+
12+
<div *ngIf="template === 'terminal'" class="window mb-3">
13+
<div class="terminal">
14+
<div class="d-flex justify-content-start align-items-start">
15+
<span class="console-info"> $ </span>
16+
<span [innerHTML]="code" (copy)="preventCopy($event)" class="command ml-2"></span>
17+
</div>
18+
</div>
19+
</div>
20+
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
.user-select {
2-
width: 95%;
3-
user-select: none
1+
.window {
2+
min-height: 200px;
43
}

frontend/src/app/shared/components/utm/util/utm-code-view/utm-code-view.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {UtmToastService} from '../../../../alert/utm-toast.service';
99
export class UtmCodeViewComponent implements OnInit, OnChanges {
1010
@Input() code: string;
1111
@Input() allowCopy = true;
12+
@Input() template: 'default' | 'terminal' = 'default';
1213
private copy: any;
1314
str: string;
1415

0 commit comments

Comments
 (0)