Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ <h5 class="card-title mb-0 text-uppercase label-header">
icon="icon-table"
tooltipClass="utm-tooltip-top"></app-utm-dtable-columns>
</th>
<th>Echoes</th>
<th (sort)="onSortBy($event)"
*ngFor="let item of fields; let i=index"
[hidden]="!item.visible"
Expand Down Expand Up @@ -169,15 +170,18 @@ <h5 class="card-title mb-0 text-uppercase label-header">
<div *ngIf="viewAlertDetail" class="utm-right-container">
<div (click)="viewAlertDetail= false" class="overlay overlay-lg col-md-6"></div>
<div class="card utm-right-action utm-right-action-lg">
<div class="title d-flex justify-content-between align-items-center border-bottom-1
border-bottom-grey-100 pl-3 pt-3 pr-3 pb-0">
<h6 class="card-title text-blue-800 font-weight-light">
<div class="title d-flex justify-content-between align-items-center border-bottom-1
border-bottom-grey-100 p-3 ">
<h6 class="card-title pb-0 mb-0 text-blue-800 font-weight-light">
{{getRuleName()}}
</h6>
<div class="d-flex flex-row align-items-center gap-2">
<app-alert-logs-related-action [logs]="alertDetail.events"></app-alert-logs-related-action>
<button (click)="viewAlertDetail= false;onRefreshData(true)" aria-label="Close"
class="close button-close" type="button">
class="" type="button">
<div class="close-icon"></div>
</button>
</div>
</div>
<app-alert-view-detail (refreshData)="onRefreshData($event)"
[alert]="alertDetail"
Expand Down Expand Up @@ -212,6 +216,12 @@ <h6 class="card-title text-blue-800 font-weight-light">
<td class="text-center">
<ng-container *ngTemplateOutlet="actionContent; context: { $implicit: alert }"></ng-container>
</td>
<td>
<app-alert-child-column [loadingChildren]="loadingChildren"
(toggleExpand)="loadChildrenAlerts(alert)"
[alert]="alert">
</app-alert-child-column>
</td>
<ng-container *ngFor="let td of fields">
<td *ngIf="td.visible"
[ngClass]="{'min-width': td.field === ALERT_ADVERSARY_FIELD || td.field === ALERT_TARGET_FIELD}"
Expand Down Expand Up @@ -271,7 +281,6 @@ <h6 class="card-title text-blue-800 font-weight-light">
[loadingChildren]="loadingChildren"
[tags]="tags"
[dataType]="dataType"
(toggleExpand)="loadChildrenAlerts(alert)"
(select)="addToSelected($event)"
(filterRow)="getRowToFiltersData($event)"
(incident)="onSuccessMarkAsIncident($event)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ import {FilterAppliedComponent} from './components/filters/filter-applied/filter
import {RowToFiltersComponent} from './components/filters/row-to-filter/row-to-filters.component';
import {StatusFilterComponent} from './components/filters/status-filter/status-filter.component';
import { AlertActionSelectComponent } from './components/alert-action-select/alert-action-select.component';
import { AlertChildColumnComponent } from './components/alert-child-column/alert-child-column.component';

@NgModule({
declarations: [
Expand All @@ -85,6 +86,7 @@ import { AlertActionSelectComponent } from './components/alert-action-select/ale
AlertIpComponent,
AlertHistoryComponent,
AlertMapLocationComponent,
AlertChildColumnComponent,
AlertSeverityDescriptionComponent,
AlertFullLogComponent,
AlertHostDetailComponent,
Expand Down Expand Up @@ -132,6 +134,7 @@ import { AlertActionSelectComponent } from './components/alert-action-select/ale
ActiveFiltersComponent,
RowToFiltersComponent,
AlertGenericFilterComponent,
AlertChildColumnComponent,
AlertFilterComponent,
DataFieldRenderComponent,
StatusFilterComponent,
Expand Down Expand Up @@ -164,7 +167,8 @@ import { AlertActionSelectComponent } from './components/alert-action-select/ale
AlertEntityDisplayComponent,
AlertBadgeFieldComponent,
AlertEventsRelatedComponent,
AlertActionsContentComponent
AlertActionsContentComponent,
AlertLogsRelatedButtonComponent
],
imports: [
CommonModule,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
<div class="d-flex justify-content-between align-items-center h-100 w-100 small-md-icon">
<div class="list-icons">
<i *ngIf="alert.hasChildren; else noChildren"
(click)="onToggleExpand()"
class="cursor-pointer mr-2"
[ngClass]="loadingChildren && alert.expanded ? 'icon-spinner2 spinner' : alert.expanded ? 'icon-arrow-down32' : 'icon-arrow-right32'"
[ngbTooltip]="alert.expanded ? 'Collapse' : 'View children alerts'"
container="body"
placement="top">
</i>
<i (click)="onSelect()"
[ngClass]="isSelected(alert)?'icon-checkbox-checked':'icon-checkbox-unchecked'"
[ngbTooltip]="isSelected(alert)?'Remove from selected':'Add to selected'"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<div class="d-flex justify-content-between align-items-center h-100 w-100 small-md-icon">
<div class="list-icons">
<button
(click)="onToggleExpand()"
class="btn-expand d-flex flex-row justify-items-center"
[disabled]="loadingChildren"
[ngbTooltip]="alert.hasChildren?(alert.expanded ? 'Collapse' : 'View echoes'):'No echoes'"
container="body"
placement="top">
<i class="!top-0" *ngIf="alert.hasChildren" [ngClass]="loadingChildren && alert.expanded ? 'icon-spinner2 spinner' : alert.expanded ? 'icon-arrow-down32' : 'icon-arrow-right32'"></i>
<span>Echoes</span>
<small class="text-xs">{{ alert.echoes }}</small>
</button>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
.btn-expand {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 6px 12px;
height: 33.07px;
border: 1px solid #0277bd;
border-radius: 4px;
background-color: white;
color: #0277bd ;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease-in-out;
white-space: nowrap;
}

.btn-expand:hover:not(:disabled) {
background-color: #0277bd ;
color: white;
border-color: #0277bd ;
}

.btn-expand:active:not(:disabled) {
background-color: #0277bd ;
border-color: #004b8a;
transform: scale(0.98);
}

.btn-expand:disabled {
opacity: 0.6;
cursor: not-allowed;
}

.btn-expand i {
font-size: 12px;
display: inline-flex;
align-items: center;
}

.btn-expand .spinner {
animation: spin 1s linear infinite;
}

@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}

.no-children-spacer {
display: inline-block;
width: 70px;
height: 32px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {Component, EventEmitter, Input, Output} from '@angular/core';
import {UtmAlertType} from 'src/app/shared/types/alert/utm-alert.type';

@Component({
selector: 'app-alert-child-column',
templateUrl: './alert-child-column.component.html',
styleUrls: ['./alert-child-column.component.scss']
})
export class AlertChildColumnComponent {

@Input() alert: UtmAlertType;
@Input() loadingChildren = false;

@Output() toggleExpand = new EventEmitter<any>();

onToggleExpand():void {
if(this.alert.hasChildren){
this.toggleExpand.emit(this.alert);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
<i class="icon-map5 mr-1"></i> View on map </a>
</li>
<li *ngIf="alert.hasChildren" (click)="view=alertDetailTabEnum.ECHOES" class="nav-item cursor-pointer">
<a [ngClass]="{'active':view===alertDetailTabEnum.ECHOES}" class="nav-link">
<i class="icon-database mr-1"></i> Echoes </a>
<a [ngClass]="{'active':view===alertDetailTabEnum.ECHOES}" class="nav-link relative">
<i class="icon-database mr-1"></i> Echoes <small class="badge-pill absolute top-0 end-0 badge badge-primary">{{alert.echoes}}</small> </a>
</li>
<li (click)="view=alertDetailTabEnum.HISTORY" class="nav-item cursor-pointer">
<a [ngClass]="{'active':view===alertDetailTabEnum.HISTORY}" class="nav-link">
Expand All @@ -42,9 +42,10 @@
<!--<button (click)="navigateToEvents()" *ngIf="countRelatedEvents>0" class="btn utm-button utm-button-primary ml-2">
<i class="icon-eye8 mr-1"></i> View logs related
</button>-->
<app-alert-logs-related-action [logs]="logs"></app-alert-logs-related-action>
</li>
</ul>


<div class="w-100" *ngIf="view === alertDetailTabEnum.DETAIL">
<app-alert-description [alert]="alert"></app-alert-description>
<app-alert-severity-description [alert]="alert"></app-alert-severity-description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,10 @@ a {
gap: 0.5rem
}

.badge{
position: absolute;
right: 0%;

}


Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {Injectable} from '@angular/core';
import {Observable} from 'rxjs';
import {SERVER_API_URL} from '../../../../app.constants';
import {QueryType} from '../../../../shared/types/query-type';
import {AlertStatusEnum} from 'src/app/shared/types/alert/utm-alert.type'


@Injectable({
Expand All @@ -16,11 +17,16 @@ export class AlertManagementService {
}

updateAlertStatus(alertId: string[], status: number, statusObservation: string = ''): Observable<HttpResponse<any>> {
const req = {

const req:any = {
alertIds: alertId,
status,
statusObservation
};

if(status == AlertStatusEnum.COMPLETED){
req['addFalsePositiveTag']=true;
}
return this.http.post<HttpResponse<any>>(this.resourceUrl + '/status', req, {observe: 'response'});
}

Expand Down
1 change: 1 addition & 0 deletions frontend/src/app/shared/types/alert/utm-alert.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export class UtmAlertType {
parentId?: string;
hasChildren: boolean;
expanded: boolean;
echoes:number
}

export enum AlertStatusLabelEnum {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

export const environment = {
production: false,
//SERVER_API_URL: 'https://192.168.1.18/',
SERVER_API_URL: 'http://localhost:8080/',
SERVER_API_URL: 'https://192.168.1.18/',
// SERVER_API_URL: 'http://localhost:8080/',
SERVER_API_CONTEXT: '',
SESSION_AUTH_TOKEN: window.location.host.split(':')[0].toLocaleUpperCase(),
WEBSOCKET_URL: '//localhost:8080',
Expand Down