Skip to content

Commit c988453

Browse files
committed
feat: enhance detail view for alerts in echoes component and improve data handling
Signed-off-by: Manuel Abascal <mjabascal10@gmail.com>
1 parent 2c1fe57 commit c988453

File tree

4 files changed

+16
-13
lines changed

4 files changed

+16
-13
lines changed

frontend/src/app/data-management/alert-management/shared/components/alert-echoes-timeline/alert-echoes-timeline.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ export class AlertEchoesTimelineComponent implements OnInit {
8585
group.startTimestamp = Math.floor(timestamps.reduce((sum, t) => sum + t, 0) / timestamps.length);
8686

8787
const rep = group.items[0] || ({} as any); // representative item
88-
console.log('group', group, rep);
8988
seriesData.push({
9089
value: [
9190
group.startTimestamp, // 0: timestamp (start of minute)

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,19 @@
6262
<ng-container *ngFor="let td of fields">
6363
<td *ngIf="td.visible"
6464
[ngClass]="{'min-width': td.field === ALERT_ADVERSARY_FIELD || td.field === ALERT_TARGET_FIELD}">
65-
<app-data-field-render [data]="alert" [field]="td" [dataType]="dataType" [isEcho]="true" [showStatusChange]="true"
66-
(refreshData)="onRefreshData($event)">
65+
<app-data-field-render [data]="alert"
66+
[field]="td"
67+
[dataType]="dataType"
68+
[isEcho]="true"
69+
[showStatusChange]="true">
6770
</app-data-field-render>
6871
</td>
6972
</ng-container>
7073
</tr>
7174
<ng-container *ngIf="alert.expanded">
7275
<tr>
73-
<td style="height: 500px" [attr.colspan]="fields.length + 2" >
74-
<app-alert-view-detail (refreshData)="onRefreshData($event)"
75-
[isEcho]=" true"
76+
<td class="expanded-row-detail" [attr.colspan]="fields.length + 2" >
77+
<app-alert-view-detail [isEcho]=" true"
7678
[alert]="alert"
7779
[hideEmptyField]=" true"
7880
[dataType]="dataType">

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@
146146
(emptyValue)="hideLastChange = $event"
147147
class=""></app-alert-view-last-change>
148148
</div>
149-
<div class="alert-details w-100 d-flex justify-content-start mb-2 align-items-start"
150-
*ngIf="alert.dataSource && (!hideEmptyField || (hideEmptyField && !incidentResponse))">
149+
<div *ngIf="alert.dataSource && (!hideEmptyField || (hideEmptyField && !incidentResponse))"
150+
class="alert-details w-100 d-flex justify-content-start mb-2 align-items-start">
151151
<span class="text-blue-800 font-weight-light has-minimum-width mr-2">Incident response:</span>&nbsp;
152152
<app-utm-console-check [hostname]="alert.dataSource"
153153
(emptyValue)="incidentResponse = $event"

frontend/src/app/shared/components/utm/util/utm-console-check/utm-console-check.component.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ export class UtmConsoleCheckComponent implements OnInit {
2222
}
2323

2424
ngOnInit() {
25-
this.getAgent(this.hostname).then(value => {
26-
this.agent = value;
27-
this.canConnect = this.agent.status === AgentStatusEnum.ONLINE;
28-
this.emptyValue.emit(!this.canConnect);
29-
});
25+
this.getAgent(this.hostname)
26+
.then(value => {
27+
this.agent = value;
28+
this.canConnect = this.agent && this.agent.status === AgentStatusEnum.ONLINE;
29+
this.emptyValue.emit(!this.canConnect);
30+
})
31+
.catch(error => this.canConnect = false);
3032
}
3133

3234
getAgent(hostname: string): Promise<AgentType> {

0 commit comments

Comments
 (0)