Added 'clean' button for rule-node events
This commit is contained in:
parent
144da0367a
commit
c3d86624ed
@ -84,7 +84,7 @@
|
||||
[fxShow]="actionDescriptor.isEnabled()" *ngFor="let actionDescriptor of headerActionDescriptors"
|
||||
matTooltip="{{ actionDescriptor.name }}"
|
||||
matTooltipPosition="above"
|
||||
(click)="actionDescriptor.onAction($event)">
|
||||
(click)="actionDescriptor.onAction($event, entitiesTableConfig)">
|
||||
<mat-icon *ngIf="actionDescriptor.isMdiIcon" [svgIcon]="actionDescriptor.icon"></mat-icon>
|
||||
<mat-icon *ngIf="!actionDescriptor.isMdiIcon">{{actionDescriptor.icon}}</mat-icon>
|
||||
</button>
|
||||
|
||||
@ -48,6 +48,7 @@ import {
|
||||
EventFilterPanelData,
|
||||
FilterEntityColumn
|
||||
} from '@home/components/event/event-filter-panel.component';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
|
||||
export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
|
||||
|
||||
@ -82,7 +83,8 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
|
||||
private debugEventTypes: Array<DebugEventType> = null,
|
||||
private overlay: Overlay,
|
||||
private viewContainerRef: ViewContainerRef,
|
||||
private cd: ChangeDetectorRef) {
|
||||
private cd: ChangeDetectorRef,
|
||||
private http: HttpClient) {
|
||||
super();
|
||||
this.loadDataOnInit = false;
|
||||
this.tableTitle = '';
|
||||
@ -135,6 +137,14 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
|
||||
onAction: ($event) => {
|
||||
this.editEventFilter($event);
|
||||
}
|
||||
},
|
||||
{
|
||||
name: this.translate.instant('event.clean-events'),
|
||||
icon: 'delete',
|
||||
isEnabled: () => true,
|
||||
onAction: ($event, entity) => {
|
||||
this.http.delete(`/events/${entity.entityId.entityType}/${entity.entityId.id}/${entity.eventTypeValue}/clear`).subscribe();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -25,6 +25,7 @@ import { EventService } from '@core/http/event.service';
|
||||
import { DialogService } from '@core/services/dialog.service';
|
||||
import { DebugEventType, EventType } from '@shared/models/event.models';
|
||||
import { Overlay } from '@angular/cdk/overlay';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
|
||||
@Component({
|
||||
selector: 'tb-event-table',
|
||||
@ -84,7 +85,8 @@ export class EventTableComponent implements OnInit {
|
||||
private dialog: MatDialog,
|
||||
private overlay: Overlay,
|
||||
private viewContainerRef: ViewContainerRef,
|
||||
private cd: ChangeDetectorRef) {
|
||||
private cd: ChangeDetectorRef,
|
||||
private http: HttpClient) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@ -102,7 +104,8 @@ export class EventTableComponent implements OnInit {
|
||||
this.debugEventTypes,
|
||||
this.overlay,
|
||||
this.viewContainerRef,
|
||||
this.cd
|
||||
this.cd,
|
||||
this.http
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -75,7 +75,7 @@ export interface HeaderActionDescriptor {
|
||||
icon: string;
|
||||
isMdiIcon?: boolean;
|
||||
isEnabled: () => boolean;
|
||||
onAction: ($event: MouseEvent) => void;
|
||||
onAction: ($event: MouseEvent, entity?) => void;
|
||||
}
|
||||
|
||||
export type EntityTableColumnType = 'content' | 'action';
|
||||
|
||||
@ -1853,6 +1853,7 @@
|
||||
"event": {
|
||||
"event-type": "Event type",
|
||||
"events-filter": "Events Filter",
|
||||
"clean-events": "Clean Events",
|
||||
"type-error": "Error",
|
||||
"type-lc-event": "Lifecycle event",
|
||||
"type-stats": "Statistics",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user