Skip to content

Commit fb77505

Browse files
feat(alert-management): added alert children alert column
1 parent e9bf75a commit fb77505

File tree

7 files changed

+95
-11
lines changed

7 files changed

+95
-11
lines changed

frontend/src/app/data-management/alert-management/alert-view/alert-view.component.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ <h5 class="card-title mb-0 text-uppercase label-header">
105105
icon="icon-table"
106106
tooltipClass="utm-tooltip-top"></app-utm-dtable-columns>
107107
</th>
108+
<th>Echoes</th>
108109
<th (sort)="onSortBy($event)"
109110
*ngFor="let item of fields; let i=index"
110111
[hidden]="!item.visible"
@@ -212,6 +213,9 @@ <h6 class="card-title text-blue-800 font-weight-light">
212213
<td class="text-center">
213214
<ng-container *ngTemplateOutlet="actionContent; context: { $implicit: alert }"></ng-container>
214215
</td>
216+
<td>
217+
<app-alert-child-column (toggleExpand)="loadChildrenAlerts(alert)" [alert]="alert"> </app-alert-child-column>
218+
</td>
215219
<ng-container *ngFor="let td of fields">
216220
<td *ngIf="td.visible"
217221
[ngClass]="{'min-width': td.field === ALERT_ADVERSARY_FIELD || td.field === ALERT_TARGET_FIELD}"
@@ -271,7 +275,6 @@ <h6 class="card-title text-blue-800 font-weight-light">
271275
[loadingChildren]="loadingChildren"
272276
[tags]="tags"
273277
[dataType]="dataType"
274-
(toggleExpand)="loadChildrenAlerts(alert)"
275278
(select)="addToSelected($event)"
276279
(filterRow)="getRowToFiltersData($event)"
277280
(incident)="onSuccessMarkAsIncident($event)"

frontend/src/app/data-management/alert-management/shared/alert-management-shared.module.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ import {FilterAppliedComponent} from './components/filters/filter-applied/filter
6060
import {RowToFiltersComponent} from './components/filters/row-to-filter/row-to-filters.component';
6161
import {StatusFilterComponent} from './components/filters/status-filter/status-filter.component';
6262
import { AlertActionSelectComponent } from './components/alert-action-select/alert-action-select.component';
63+
import { AlertChildColumnComponent } from './components/alert-child-column/alert-child-column.component';
6364

6465
@NgModule({
6566
declarations: [
@@ -85,6 +86,7 @@ import { AlertActionSelectComponent } from './components/alert-action-select/ale
8586
AlertIpComponent,
8687
AlertHistoryComponent,
8788
AlertMapLocationComponent,
89+
AlertChildColumnComponent,
8890
AlertSeverityDescriptionComponent,
8991
AlertFullLogComponent,
9092
AlertHostDetailComponent,
@@ -132,6 +134,7 @@ import { AlertActionSelectComponent } from './components/alert-action-select/ale
132134
ActiveFiltersComponent,
133135
RowToFiltersComponent,
134136
AlertGenericFilterComponent,
137+
AlertChildColumnComponent,
135138
AlertFilterComponent,
136139
DataFieldRenderComponent,
137140
StatusFilterComponent,

frontend/src/app/data-management/alert-management/shared/components/alert-actions-content/alert-actions-content.component.html

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
<div class="d-flex justify-content-between align-items-center h-100 w-100 small-md-icon">
22
<div class="list-icons">
3-
<i *ngIf="alert.hasChildren; else noChildren"
4-
(click)="onToggleExpand()"
5-
class="cursor-pointer mr-2"
6-
[ngClass]="loadingChildren && alert.expanded ? 'icon-spinner2 spinner' : alert.expanded ? 'icon-arrow-down32' : 'icon-arrow-right32'"
7-
[ngbTooltip]="alert.expanded ? 'Collapse' : 'View children alerts'"
8-
container="body"
9-
placement="top">
10-
</i>
113
<i (click)="onSelect()"
124
[ngClass]="isSelected(alert)?'icon-checkbox-checked':'icon-checkbox-unchecked'"
135
[ngbTooltip]="isSelected(alert)?'Remove from selected':'Add to selected'"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<div class="d-flex justify-content-between align-items-center h-100 w-100 small-md-icon">
2+
<div class="list-icons">
3+
<button
4+
(click)="onToggleExpand()"
5+
class="btn-expand"
6+
[disabled]="loadingChildren || !alert.hasChildren"
7+
[ngbTooltip]="alert.hasChildren?(alert.expanded ? 'Collapse' : 'View echoes'):'No echoes'"
8+
container="body"
9+
placement="top">
10+
<i [ngClass]="loadingChildren && alert.expanded ? 'icon-spinner2 spinner' : alert.expanded ? 'icon-arrow-down32' : 'icon-arrow-right32'"></i>
11+
<span>{{ alert.expanded ? 'Close' : 'Open' }}</span>
12+
</button>
13+
</div>
14+
</div>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
.btn-expand {
2+
display: inline-flex;
3+
align-items: center;
4+
gap: 6px;
5+
padding: 6px 12px;
6+
border: 1px solid #28a745;
7+
border-radius: 4px;
8+
background-color: white;
9+
color: #28a745;
10+
font-size: 14px;
11+
font-weight: 500;
12+
cursor: pointer;
13+
transition: all 0.2s ease-in-out;
14+
white-space: nowrap;
15+
}
16+
17+
.btn-expand:hover:not(:disabled) {
18+
background-color: #28a745;
19+
color: white;
20+
border-color: #28a745;
21+
}
22+
23+
.btn-expand:active:not(:disabled) {
24+
background-color: #218838;
25+
border-color: #1e7e34;
26+
transform: scale(0.98);
27+
}
28+
29+
.btn-expand:disabled {
30+
opacity: 0.6;
31+
cursor: not-allowed;
32+
}
33+
34+
.btn-expand i {
35+
font-size: 12px;
36+
display: inline-flex;
37+
align-items: center;
38+
}
39+
40+
.btn-expand .spinner {
41+
animation: spin 1s linear infinite;
42+
}
43+
44+
@keyframes spin {
45+
0% { transform: rotate(0deg); }
46+
100% { transform: rotate(360deg); }
47+
}
48+
49+
.no-children-spacer {
50+
display: inline-block;
51+
width: 70px;
52+
height: 32px;
53+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-alert-child-column',
5+
templateUrl: './alert-child-column.component.html',
6+
styleUrls: ['./alert-child-column.component.scss']
7+
})
8+
export class AlertChildColumnComponent {
9+
10+
@Input() alert: any;
11+
@Input() loadingChildren = false;
12+
13+
@Output() toggleExpand = new EventEmitter<any>();
14+
15+
onToggleExpand() {
16+
this.toggleExpand.emit(this.alert);
17+
}
18+
19+
}

frontend/src/environments/environment.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
export const environment = {
66
production: false,
7-
//SERVER_API_URL: 'https://192.168.1.18/',
8-
SERVER_API_URL: 'http://localhost:8080/',
7+
SERVER_API_URL: 'https://192.168.1.18/',
8+
// SERVER_API_URL: 'http://localhost:8080/',
99
SERVER_API_CONTEXT: '',
1010
SESSION_AUTH_TOKEN: window.location.host.split(':')[0].toLocaleUpperCase(),
1111
WEBSOCKET_URL: '//localhost:8080',

0 commit comments

Comments
 (0)