This commit is contained in:
parent
d4fce0efeb
commit
6bd1e029d5
|
@ -166,6 +166,17 @@ export class DsmApiComponent implements OnInit {
|
|||
const wfDialogRef = this.dialog.open(WfConfLauncherDialog, {
|
||||
data: conf
|
||||
});
|
||||
|
||||
wfDialogRef.componentInstance.newHistory.subscribe((data: WfHistoryEntry[]) => {
|
||||
const wHistoryfDialogRef = this.dialog.open(WfHistoryDialog, {
|
||||
data: {
|
||||
'confId': conf.id,
|
||||
'dsId': conf.dsId,
|
||||
'apiId': conf.apiId,
|
||||
'processId': (data.length > 0) ? data[0].processId : undefined
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
destroyWfConf(wfConfId: string): void {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Component, Inject, OnInit, ViewChild, ElementRef, AfterViewInit } from '@angular/core';
|
||||
import { Component, Inject, OnInit, ViewChild, ElementRef, AfterViewInit, Input, Output, EventEmitter } from '@angular/core';
|
||||
import { FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms';
|
||||
import { MatDialogRef, MAT_DIALOG_DATA, MatDialog } from '@angular/material/dialog';
|
||||
import { MatSelectChange } from '@angular/material/select';
|
||||
|
@ -224,6 +224,8 @@ export class WfConfLauncherDialog {
|
|||
|
||||
form = new FormGroup({});
|
||||
|
||||
@Output() newHistory = new EventEmitter<WfHistoryEntry[]>();
|
||||
|
||||
constructor(public dialogRef: MatDialogRef<WfConfLauncherDialog>, @Inject(MAT_DIALOG_DATA) public data: WfConf, public client: WfConfsClient, public dialog: MatDialog) {
|
||||
this.conf = data;
|
||||
this.form.controls = {}
|
||||
|
@ -239,16 +241,7 @@ export class WfConfLauncherDialog {
|
|||
});
|
||||
}
|
||||
|
||||
this.client.startWfConfiguration(this.conf.id, wfs, (data: WfHistoryEntry[]) => {
|
||||
const wfDialogRef = this.dialog.open(WfHistoryDialog, {
|
||||
data: {
|
||||
'confId': this.conf.id,
|
||||
'dsId': this.conf.dsId,
|
||||
'apiId': this.conf.apiId,
|
||||
'processId': (data.length > 0) ? data[0].processId : undefined
|
||||
}
|
||||
});
|
||||
});
|
||||
this.client.startWfConfiguration(this.conf.id, wfs, (data: WfHistoryEntry[]) => this.newHistory.emit(data));
|
||||
}
|
||||
|
||||
isStartable(): boolean {
|
||||
|
|
|
@ -14,56 +14,20 @@
|
|||
<mat-icon fontIcon="edit"></mat-icon>
|
||||
configure
|
||||
</button>
|
||||
|
||||
<button mat-stroked-button color="warn" (click)="deleteConf()">
|
||||
<mat-icon fontIcon="delete"></mat-icon>
|
||||
delete
|
||||
</button>
|
||||
<button mat-stroked-button color="primary" (click)="refresh()">
|
||||
<mat-icon fontIcon="refresh"></mat-icon>
|
||||
Refresh
|
||||
</button>
|
||||
|
||||
<mat-divider style="margin-top: 1em; margin-bottom: 1em;"></mat-divider>
|
||||
|
||||
<table mat-table [dataSource]="historyDatasource" matSort>
|
||||
<wf-history-table [entries]="historyEntries" [allfields]="false"></wf-history-table>
|
||||
|
||||
<ng-container matColumnDef="processId">
|
||||
<th mat-header-cell *matHeaderCellDef style="width: 15%;" mat-sort-header
|
||||
sortActionDescription="Sort by Process ID"> Process Id </th>
|
||||
<td mat-cell *matCellDef="let element">
|
||||
<a (click)="openWfHistoryDialog(element)">{{element.processId}}</a>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="status">
|
||||
<th mat-header-cell *matHeaderCellDef style="width: 10%;" mat-sort-header
|
||||
sortActionDescription="Sort by Status">
|
||||
Status </th>
|
||||
<td mat-cell *matCellDef="let element"><span class="badge-label"
|
||||
[ngClass]="{'badge-success' : element.status === 'success', 'badge-failure' : element.status === 'failure'}">{{element.status}}</span>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="startDate">
|
||||
<th mat-header-cell *matHeaderCellDef style="width: 15%;" mat-sort-header
|
||||
sortActionDescription="Sort by Start Date"> Start Date </th>
|
||||
<td mat-cell *matCellDef="let element"> {{element.startDate}} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="endDate">
|
||||
<th mat-header-cell *matHeaderCellDef style="width: 15%;" mat-sort-header
|
||||
sortActionDescription="Sort by End Date">
|
||||
End Date </th>
|
||||
<td mat-cell *matCellDef="let element"> {{element.endDate}} </td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="colums"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: colums;"></tr>
|
||||
|
||||
<!-- Row shown when there is no matching data. -->
|
||||
<tr class="mat-row" *matNoDataRow>
|
||||
<td class="mat-cell" colspan="4" style="padding: 0 16px;">No execution in history"</td>
|
||||
</tr>
|
||||
</table>
|
||||
</mat-card-content>
|
||||
<!-- <pre>{{conf | json}}</pre> -->
|
||||
|
||||
</mat-card>
|
||||
|
||||
|
|
|
@ -88,21 +88,24 @@ export class WfConfSingle implements OnInit, OnChanges {
|
|||
@Input() conf?: WfConf;
|
||||
prevConfId = '';
|
||||
|
||||
historyDatasource: MatTableDataSource<WfHistoryEntry> = new MatTableDataSource<WfHistoryEntry>([]);
|
||||
colums: string[] = ['processId', 'status', 'startDate', 'endDate'];
|
||||
historyEntries: WfHistoryEntry[] = [];
|
||||
|
||||
constructor(public client: WfConfsClient, public dialog: MatDialog, public snackBar: MatSnackBar) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
if (this.conf) {
|
||||
this.client.loadWfHistoryForConf(this.conf?.id, (data: WfHistoryEntry[]) => this.historyDatasource.data = data);
|
||||
}
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
if (this.conf && this.conf.id != this.prevConfId) {
|
||||
this.prevConfId = this.conf.id;
|
||||
this.client.loadWfHistoryForConf(this.conf?.id, (data: WfHistoryEntry[]) => this.historyDatasource.data = data);
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
refresh() {
|
||||
if (this.conf) {
|
||||
this.client.loadWfHistoryForConf(this.conf?.id, (data: WfHistoryEntry[]) => this.historyEntries = data);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -110,6 +113,9 @@ export class WfConfSingle implements OnInit, OnChanges {
|
|||
const wfDialogRef = this.dialog.open(WfConfLauncherDialog, {
|
||||
data: this.conf
|
||||
});
|
||||
wfDialogRef.componentInstance.newHistory.subscribe((data: WfHistoryEntry[]) => {
|
||||
this.historyEntries = data;
|
||||
});
|
||||
}
|
||||
|
||||
editConf() {
|
||||
|
|
|
@ -8,4 +8,4 @@
|
|||
<span *ngIf="!from && to"><b>Workflows from </b><i>undefined</i> <b>to</b> {{to}}</span>
|
||||
</p>
|
||||
|
||||
<wf-history-table [entries]="entries"></wf-history-table>
|
||||
<wf-history-table [entries]="entries" [allfields]="false"></wf-history-table>
|
||||
|
|
|
@ -105,11 +105,12 @@ export class WfHistoryDialog implements OnInit {
|
|||
})
|
||||
export class WfHistoryTableComponent implements AfterViewInit, OnInit, OnChanges {
|
||||
|
||||
@Input() entries: WfHistoryEntry[] = [];
|
||||
@Input() entries?: WfHistoryEntry[];
|
||||
@Input() allfields?: boolean;
|
||||
|
||||
historyDatasource: MatTableDataSource<WfHistoryEntry> = new MatTableDataSource<WfHistoryEntry>([]);
|
||||
|
||||
colums: string[] = ['graph', 'processId', 'name', 'family', 'dsName', 'status', 'startDate', 'endDate'];
|
||||
colums: string[] = [];
|
||||
|
||||
total: number = 100
|
||||
from?: Date;
|
||||
|
@ -118,11 +119,16 @@ export class WfHistoryTableComponent implements AfterViewInit, OnInit, OnChanges
|
|||
constructor(public dialog: MatDialog) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.historyDatasource.data = this.entries;
|
||||
if (this.allfields) {
|
||||
this.colums = ['graph', 'processId', 'name', 'family', 'dsName', 'status', 'startDate', 'endDate'];
|
||||
} else {
|
||||
this.colums = ['graph', 'processId', 'status', 'startDate', 'endDate'];
|
||||
}
|
||||
this.historyDatasource.data = this.entries ? this.entries : [];
|
||||
};
|
||||
|
||||
ngOnChanges() {
|
||||
this.historyDatasource.data = this.entries;
|
||||
this.historyDatasource.data = this.entries ? this.entries : [];
|
||||
}
|
||||
|
||||
@ViewChild(MatSort) sort: MatSort | undefined
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<h1 mat-dialog-title>Recent Workflows</h1>
|
||||
|
||||
<div mat-dialog-content>
|
||||
<wf-history-table [entries]="entries"></wf-history-table>
|
||||
<wf-history-table [entries]="entries" [allfields]="true"></wf-history-table>
|
||||
</div>
|
||||
|
||||
<div mat-dialog-actions>
|
||||
|
|
Loading…
Reference in New Issue