history refresh
This commit is contained in:
parent
eb63e6fbc6
commit
c65a39e07e
|
@ -78,8 +78,8 @@ public class ApiController extends DnetRestController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/proc/{processId}")
|
@GetMapping("/proc/{processId}")
|
||||||
public List<WfJournalEntry> getProcessExecution(@PathVariable final String processId) {
|
public WfJournalEntry getProcessExecution(@PathVariable final String processId) {
|
||||||
return Arrays.asList(this.wfManagerService.findProcessLog(processId));
|
return this.wfManagerService.findProcessLog(processId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/sections")
|
@GetMapping("/sections")
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<h1 mat-dialog-title>Workflow Launcher</h1>
|
<h1 mat-dialog-title>Workflow Launcher</h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div mat-dialog-content>
|
<div mat-dialog-content>
|
||||||
<mat-radio-group [(ngModel)]="executionType">
|
<mat-radio-group [(ngModel)]="executionType">
|
||||||
<mat-radio-button value="complete">Complete execution</mat-radio-button>
|
<mat-radio-button value="complete">Complete execution</mat-radio-button>
|
||||||
|
|
|
@ -276,6 +276,10 @@ export class WfHistoryClient extends ISClient {
|
||||||
this.httpGet(url, onSuccess);
|
this.httpGet(url, onSuccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
findProcess(id: string, onSuccess: Function) {
|
||||||
|
this.httpGet<WfHistoryEntry>('/proxy/byType/wf_manager/api/proc/' + encodeURIComponent(id), onSuccess);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -288,13 +292,22 @@ export class WfRuntimeGraphDialog implements AfterViewInit {
|
||||||
|
|
||||||
@ViewChild('mermaidGraph', { static: false }) mermaidGraph!: ElementRef;
|
@ViewChild('mermaidGraph', { static: false }) mermaidGraph!: ElementRef;
|
||||||
|
|
||||||
constructor(public dialogRef: MatDialogRef<WfHistoryDialog>, @Inject(MAT_DIALOG_DATA) public data: any, public dialog: MatDialog, public snackBar: MatSnackBar) {
|
constructor(public dialogRef: MatDialogRef<WfHistoryDialog>, @Inject(MAT_DIALOG_DATA) public data: any, public dialog: MatDialog, public snackBar: MatSnackBar, public client: WfHistoryClient) {
|
||||||
this.wf = data;
|
this.wf = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ngAfterViewInit(): void {
|
public ngAfterViewInit(): void {
|
||||||
|
this.updateGraph();
|
||||||
|
}
|
||||||
|
|
||||||
const element: any = this.mermaidGraph.nativeElement;
|
public refresh(): void {
|
||||||
|
this.client.findProcess(this.wf.processId, (data: WfHistoryEntry) => {
|
||||||
|
this.wf = data;
|
||||||
|
this.updateGraph();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private updateGraph(): void {
|
||||||
|
|
||||||
/* flowchart TD
|
/* flowchart TD
|
||||||
A[Start] --> B{Is it?}
|
A[Start] --> B{Is it?}
|
||||||
|
@ -303,7 +316,6 @@ export class WfRuntimeGraphDialog implements AfterViewInit {
|
||||||
D --> B
|
D --> B
|
||||||
B -- No ----> E[End]
|
B -- No ----> E[End]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
let code = "%%{ init: { 'theme': 'base', 'themeVariables': { 'fontSize' : '11px' } } }%%\n";
|
let code = "%%{ init: { 'theme': 'base', 'themeVariables': { 'fontSize' : '11px' } } }%%\n";
|
||||||
|
|
||||||
let cssMap: any = [];
|
let cssMap: any = [];
|
||||||
|
@ -354,7 +366,9 @@ export class WfRuntimeGraphDialog implements AfterViewInit {
|
||||||
|
|
||||||
code += "classDef default font-size:9pt\n";
|
code += "classDef default font-size:9pt\n";
|
||||||
|
|
||||||
|
const element: Element = this.mermaidGraph.nativeElement;
|
||||||
element.innerHTML = code;
|
element.innerHTML = code;
|
||||||
|
element.removeAttribute('data-processed');
|
||||||
|
|
||||||
mermaid.initialize({ theme: "base", flowchart: { titleTopMargin: 0, useMaxWidth: false, htmlLabels: false } });
|
mermaid.initialize({ theme: "base", flowchart: { titleTopMargin: 0, useMaxWidth: false, htmlLabels: false } });
|
||||||
mermaid.run();
|
mermaid.run();
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
<h1 mat-dialog-title>Process {{wf.processId}}</h1>
|
<h1 mat-dialog-title>Process {{wf.processId}} - {{wf.status}
|
||||||
|
<span class="badge-label" [ngClass]="{
|
||||||
|
'badge-success' : wf.status === 'success',
|
||||||
|
'badge-failure' : wf.status === 'failure',
|
||||||
|
'badge-pending' : wf.status === 'created' || wf.status === 'accepted'
|
||||||
|
}">{{wf.status}}</span>
|
||||||
|
</h1>
|
||||||
|
|
||||||
<div mat-dialog-content>
|
<div mat-dialog-content>
|
||||||
<pre class="mermaid" #mermaidGraph style="min-height: 200px;"></pre>
|
<pre class="mermaid" #mermaidGraph style="min-height: 200px;"></pre>
|
||||||
|
@ -6,4 +12,8 @@
|
||||||
|
|
||||||
<div mat-dialog-actions>
|
<div mat-dialog-actions>
|
||||||
<button mat-stroked-button color="primary" mat-dialog-close>Close</button>
|
<button mat-stroked-button color="primary" mat-dialog-close>Close</button>
|
||||||
|
<button mat-stroked-button color="primary" (click)="refresh()">
|
||||||
|
<mat-icon fontIcon="refresh"></mat-icon>
|
||||||
|
Refresh
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue