This commit is contained in:
Michele Artini 2023-12-21 12:36:40 +01:00
parent d4d542b2af
commit a6500a04bd
3 changed files with 81 additions and 14 deletions

View File

@ -5,10 +5,6 @@
<mat-icon fontIcon="search"></mat-icon>
search page
</a>
<button mat-stroked-button color="primary" (click)="newAddWorkflowDialog()">
<mat-icon fontIcon="add"></mat-icon>
add workflow
</button>
<button mat-stroked-button (click)="openJournalDialog(undefined, undefined)">
<mat-icon fontIcon="history"></mat-icon>
history
@ -144,16 +140,64 @@
</div>
<mat-card style="margin-top: 10px;">
<mat-card-header>
<mat-card-title>Aggregation Workflows</mat-card-title>
</mat-card-header>
<mat-card-content *ngIf="wfs.length == 0" style="padding-top: 2em;">
<button mat-stroked-button color="warn" (click)="newAddWorkflowDialog()">
<mat-card-content ng-if="wfs.length > 0">
<table>
<thead>
<th align="left" width="50%">Workflow</th>
<th align="center" width="8%">Enabled</th>
<th align="center" width="8%">Configured</th>
<th align="center" width="8%">Scheduled</th>
<th></th>
</thead>
<tbody>
<tr *ngFor="let wf of wfs">
<td align="left">
{{wf.name}}<br />
<small><b>ID:</b> {{wf.id}}</small>
</td>
<td align="center">
<mat-icon fontIcon="check" *ngIf="wf.enabled" style="color:darkgreen;"></mat-icon>
<mat-icon fontIcon="error" *ngIf="!wf.enabled" style="color:darkred;"></mat-icon>
</td>
<td align="center">
<mat-icon fontIcon="check" *ngIf="wf.configured" style="color:darkgreen;"></mat-icon>
<mat-icon fontIcon="error" *ngIf="!wf.configured" style="color:darkred;"></mat-icon>
</td>
<td align="center">
<mat-icon fontIcon="timer" *ngIf="wf.schedulingEnabled" style="color: #336699;"></mat-icon>
<mat-icon fontIcon="timer_off" *ngIf="!wf.schedulingEnabled" style="color: lightgray;"></mat-icon>
</td>
<td align="right">
<button mat-stroked-button>
<mat-icon fontIcon="edit"></mat-icon>
config
</button>
<button mat-stroked-button color="primary" (click)="startWfConf(wf.id)"
[disabled]="!wf.enabled || !wf.configured">
<mat-icon fontIcon="play_arrow"></mat-icon>
start
</button>
</td>
</tr>
</tbody>
</table>
</mat-card-content>
<mat-card-actions>
<button mat-stroked-button color="primary" (click)="newAddWorkflowDialog()">
<mat-icon fontIcon="add"></mat-icon>
add first workflow
add workflow
</button>
</mat-card-content>
<mat-card-content *ngIf="wfs.length > 0">
{{wfs | json}}
</mat-card-content>
<button mat-stroked-button (click)="reloadWfs()">
<mat-icon fontIcon="refresh"></mat-icon>
refresh
</button>
</mat-card-actions>
</mat-card>

View File

@ -50,6 +50,10 @@ export class DsmClient extends ISClient {
this.httpPost('/proxy/byType/wf_manager/api/repo-hi/' + encodeURIComponent(wfId) + '/start', params, onSuccess);
}
dsmStartWfConf(wfConfId: string, onSuccess: Function) {
alert('TODO');
}
dsmRepoByeWf(wfId: string, onSuccess: Function) {
alert('TODO');
}

View File

@ -146,13 +146,32 @@ export class DsmApiComponent implements OnInit {
this.client.dsmGetDs(api.datasource, (ds: any) => {
this.ds = ds;
});
this.client.dsmLoadWfs(this.apiId, (wfs: any[]) => {
this.wfs = wfs;
});
this.reloadWfs()
});
}
}
reloadWfs() {
if (this.apiId) {
this.client.dsmLoadWfs(this.apiId, (wfs: any[]) => {
this.wfs = wfs;
});
}
}
startWfConf(wfConfId: string): void {
this.client.dsmStartWfConf(wfConfId, (data: WfHistoryEntry) => {
const wfDialogRef = this.dialog.open(WfHistoryDialog, {
data: {
'dsId': this.ds.id,
'apiId': this.api.id,
'processId': data.processId,
'confId': undefined
}
});
});
}
openJournalDialog(confId: string | undefined, processId: string | undefined) {
const wfDialogRef = this.dialog.open(WfHistoryDialog, {
data: {