diff --git a/apps/dnet-is-application/pom.xml b/apps/dnet-is-application/pom.xml index 92bde558..d5938b1b 100644 --- a/apps/dnet-is-application/pom.xml +++ b/apps/dnet-is-application/pom.xml @@ -4,7 +4,7 @@ eu.dnetlib.dhp apps - 3.3.3-SNAPSHOT + 3.4.1-SNAPSHOT ../ diff --git a/apps/dnet-is-application/src/main/java/eu/dnetlib/manager/wf/WfHistoryAjaxController.java b/apps/dnet-is-application/src/main/java/eu/dnetlib/manager/wf/WfHistoryAjaxController.java index 45fd6596..f1c99124 100644 --- a/apps/dnet-is-application/src/main/java/eu/dnetlib/manager/wf/WfHistoryAjaxController.java +++ b/apps/dnet-is-application/src/main/java/eu/dnetlib/manager/wf/WfHistoryAjaxController.java @@ -28,7 +28,12 @@ public class WfHistoryAjaxController extends AbstractDnetController { return logger.history(total, from, to); } - @GetMapping("/{processId}") + @GetMapping("/byConf/{wfConfId}") + public List history(@PathVariable final String wfConfId) { + return logger.history(wfConfId); + } + + @GetMapping("/proc/{processId}") public WfHistoryEntry getProcessExecution(@PathVariable final String processId) { return logger.getLog(processId); } diff --git a/frontends/dnet-is-application/src/app/app.module.ts b/frontends/dnet-is-application/src/app/app.module.ts index ed486e98..8ad66152 100644 --- a/frontends/dnet-is-application/src/app/app.module.ts +++ b/frontends/dnet-is-application/src/app/app.module.ts @@ -37,7 +37,7 @@ import { SpinnerHttpInterceptor } from './common/spinner.service'; import { MdstoresComponent, MdstoreInspectorComponent, MDStoreVersionsDialog, AddMDStoreDialog } from './mdstores/mdstores.component'; import { CleanerTesterComponent } from './cleaner-tester/cleaner-tester.component'; import { EmailDialog, EmailsComponent } from './emails/emails.component'; -import { WfConfsComponent, WfConfDialog } from './wf-confs/wf-confs.component'; +import { WfConfsComponent, WfConfDialog, WfConfSingle } from './wf-confs/wf-confs.component'; import { MatTabsModule } from '@angular/material/tabs'; import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatStepperModule } from '@angular/material/stepper'; @@ -75,7 +75,8 @@ import { MatStepperModule } from '@angular/material/stepper'; EmailsComponent, EmailDialog, WfConfsComponent, - WfConfDialog + WfConfDialog, + WfConfSingle ], imports: [ BrowserModule, diff --git a/frontends/dnet-is-application/src/app/common/is.service.ts b/frontends/dnet-is-application/src/app/common/is.service.ts index 7ba6174e..a50d05c4 100644 --- a/frontends/dnet-is-application/src/app/common/is.service.ts +++ b/frontends/dnet-is-application/src/app/common/is.service.ts @@ -74,6 +74,10 @@ export class ISService { this.httpGetWithOptions('/ajax/wf_history/', { params: params }, onSuccess); } + loadWfHistoryForConf(wfConfId: string, onSuccess: Function): void { + this.httpGet('/ajax/wf_history/byConf/' + encodeURIComponent(wfConfId), onSuccess); + } + loadContexts(onSuccess: Function): void { this.httpGet('./ajax/contexts/', onSuccess); } diff --git a/frontends/dnet-is-application/src/app/main-menu-panels/main-menu-panels.component.css b/frontends/dnet-is-application/src/app/main-menu-panels/main-menu-panels.component.css index 9e7ea34b..d79d8fa4 100644 --- a/frontends/dnet-is-application/src/app/main-menu-panels/main-menu-panels.component.css +++ b/frontends/dnet-is-application/src/app/main-menu-panels/main-menu-panels.component.css @@ -39,14 +39,12 @@ } .menu-count { - padding-top: 0.3em; - padding-bottom: 0.3em; padding-left: 0.5em; padding-right: 0.5em; - border-radius: 0.2em; - font-size: 0.6em; + border-radius: 1em; + font-size: 0.7em; color: #fff; text-align: center; float: right; - width: 3em; + width: 2em; } diff --git a/frontends/dnet-is-application/src/app/wf-confs/wf-conf-dialog.html b/frontends/dnet-is-application/src/app/wf-confs/wf-conf-dialog.html index c74b0286..32769b1c 100644 --- a/frontends/dnet-is-application/src/app/wf-confs/wf-conf-dialog.html +++ b/frontends/dnet-is-application/src/app/wf-confs/wf-conf-dialog.html @@ -93,7 +93,7 @@

You are now done.

- + {{ wfConfFormFinal.errors?.['serverError'] }} @@ -102,7 +102,3 @@
- -
- -
diff --git a/frontends/dnet-is-application/src/app/wf-confs/wf-conf-single.html b/frontends/dnet-is-application/src/app/wf-confs/wf-conf-single.html new file mode 100644 index 00000000..1877954c --- /dev/null +++ b/frontends/dnet-is-application/src/app/wf-confs/wf-conf-single.html @@ -0,0 +1,73 @@ +
+ +

{{conf.name}}

+ Datasource Name: {{conf.dsName}}
+ Datasource ID: {{conf.dsId}}
+ Datasource API: {{conf.apiId}}
+ + + + + + raw workflow + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Process Id + {{element.processId}} + + Status {{element.status}} + Start Date {{element.startDate}} + End Date {{element.endDate}}
No execution in history"
+ + + +
+ +
+ Workflow Configuration does not exist +
diff --git a/frontends/dnet-is-application/src/app/wf-confs/wf-confs.component.html b/frontends/dnet-is-application/src/app/wf-confs/wf-confs.component.html index 7b3a62c8..5dd6b1ec 100644 --- a/frontends/dnet-is-application/src/app/wf-confs/wf-confs.component.html +++ b/frontends/dnet-is-application/src/app/wf-confs/wf-confs.component.html @@ -12,27 +12,4 @@ -
- - - - - raw workflow - - -
{{conf | json}}
- -
- -
- Workflow Configuration does not exist -
+ diff --git a/frontends/dnet-is-application/src/app/wf-confs/wf-confs.component.ts b/frontends/dnet-is-application/src/app/wf-confs/wf-confs.component.ts index 3d2dd827..be9c71e8 100644 --- a/frontends/dnet-is-application/src/app/wf-confs/wf-confs.component.ts +++ b/frontends/dnet-is-application/src/app/wf-confs/wf-confs.component.ts @@ -1,13 +1,15 @@ import { JsonPipe } from '@angular/common'; -import { Component, Inject, OnInit, SecurityContext } from '@angular/core'; +import { Component, Inject, Input, OnChanges, OnInit, SecurityContext, SimpleChanges } from '@angular/core'; import { FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms'; import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatSelectChange } from '@angular/material/select'; import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; -import { KeyValue, SimpleResource, WfConf, WfParam, WfProcessStatus, WfSection } from '../common/is.model'; +import { KeyValue, SimpleResource, WfConf, WfHistoryEntry, WfParam, WfProcessStatus, WfSection } from '../common/is.model'; import { ISService } from '../common/is.service'; import { ResMetadataDialog } from '../resources/resources.component'; +import { MatTableDataSource } from '@angular/material/table'; +import { WfHistoryDialog } from '../wf-history/wf-history.component'; @Component({ selector: 'app-wf-confs', @@ -73,34 +75,6 @@ export class WfConfsComponent implements OnInit { if (result) this.router.navigate(['/wfs/conf', result.id]);; }); } - - launchWfConf() { - if (this.conf?.id && this.conf?.workflow) { - this.service.startWfConfiguration(this.conf?.id, (data: WfProcessStatus) => this.snackBar.open('Workflow launched !!!', 'INFO', { duration: 5000 })); - } - } - - editConf() { - const dialogRef = this.dialog.open(WfConfDialog, { - data: this.conf, - width: '80%' - }); - } - - deleteConf() { - if (this.conf?.destroyWf) { - if (this.conf?.id && this.conf?.workflow) { - this.service.startDestroyWfConfiguration(this.conf?.id, (data: WfProcessStatus) => this.snackBar.open('Destroy Workflow launched, PLEASE WAIT !!!', 'INFO', { duration: 5000 })); - } - } else if (this.conf?.id) { - this.service.deleteWfConfiguration(this.conf?.id, (data: void) => { - this.snackBar.open('Configuration deleted !!!', 'INFO', { duration: 5000 }); - this.conf = undefined; - }); - } - } - - } @Component({ @@ -108,7 +82,6 @@ export class WfConfsComponent implements OnInit { templateUrl: 'wf-conf-dialog.html', styleUrls: ['./wf-confs.component.css'] }) - export class WfConfDialog implements OnInit { wfTemplates: SimpleResource[] = []; @@ -195,3 +168,67 @@ export class WfConfDialog implements OnInit { this.dialogRef.close(); } } + +@Component({ + selector: 'wf-conf-single', + templateUrl: 'wf-conf-single.html', + styleUrls: ['./wf-confs.component.css'] +}) +export class WfConfSingle implements OnInit, OnChanges { + + @Input() conf?: WfConf; + prevConfId = ''; + + historyDatasource: MatTableDataSource = new MatTableDataSource([]); + colums: string[] = ['processId', 'status', 'startDate', 'endDate']; + + constructor(public service: ISService, public dialog: MatDialog, public snackBar: MatSnackBar) { } + + ngOnInit(): void { + if (this.conf) { + this.service.loadWfHistoryForConf(this.conf?.id, (data: WfHistoryEntry[]) => this.historyDatasource.data = data); + } + } + + ngOnChanges(changes: SimpleChanges): void { + if (this.conf && this.conf.id != this.prevConfId) { + this.prevConfId = this.conf.id; + this.service.loadWfHistoryForConf(this.conf?.id, (data: WfHistoryEntry[]) => this.historyDatasource.data = data); + } + } + + + + launchWfConf() { + if (this.conf?.id && this.conf?.workflow) { + this.service.startWfConfiguration(this.conf?.id, (data: WfProcessStatus) => this.snackBar.open('Workflow launched !!!', 'INFO', { duration: 5000 })); + } + } + + editConf() { + const dialogRef = this.dialog.open(WfConfDialog, { + data: this.conf, + width: '80%' + }); + } + + deleteConf() { + if (this.conf?.destroyWf) { + if (this.conf?.id && this.conf?.workflow) { + this.service.startDestroyWfConfiguration(this.conf?.id, (data: WfProcessStatus) => this.snackBar.open('Destroy Workflow launched, PLEASE WAIT !!!', 'INFO', { duration: 5000 })); + } + } else if (this.conf?.id) { + this.service.deleteWfConfiguration(this.conf?.id, (data: void) => { + this.snackBar.open('Configuration deleted !!!', 'INFO', { duration: 5000 }); + this.conf = undefined; + }); + } + } + + openWfHistoryDialog(wf: WfHistoryEntry): void { + const wfDialogRef = this.dialog.open(WfHistoryDialog, { + data: wf + }); + } + +} diff --git a/frontends/dnet-is-application/src/app/wf-history/wf-history.component.html b/frontends/dnet-is-application/src/app/wf-history/wf-history.component.html index 1542189e..786cf1ea 100644 --- a/frontends/dnet-is-application/src/app/wf-history/wf-history.component.html +++ b/frontends/dnet-is-application/src/app/wf-history/wf-history.component.html @@ -17,7 +17,7 @@ Count : {{historyDatasource.filteredData.length}}

- +
- +
No data matching the filter "{{input.value}}"No data matching the filter "{{input.value}}"
diff --git a/libs/dnet-data-services/pom.xml b/libs/dnet-data-services/pom.xml index c81bd485..4b5978fc 100644 --- a/libs/dnet-data-services/pom.xml +++ b/libs/dnet-data-services/pom.xml @@ -3,7 +3,7 @@ eu.dnetlib.dhp libs - 3.3.3-SNAPSHOT + 3.4.1-SNAPSHOT ../ diff --git a/libs/dnet-is-common/pom.xml b/libs/dnet-is-common/pom.xml index 898159c5..8eeb7ffb 100644 --- a/libs/dnet-is-common/pom.xml +++ b/libs/dnet-is-common/pom.xml @@ -3,7 +3,7 @@ eu.dnetlib.dhp libs - 3.3.3-SNAPSHOT + 3.4.1-SNAPSHOT ../ diff --git a/libs/dnet-is-services/pom.xml b/libs/dnet-is-services/pom.xml index 709c81b9..fe0fd6b1 100644 --- a/libs/dnet-is-services/pom.xml +++ b/libs/dnet-is-services/pom.xml @@ -4,7 +4,7 @@ eu.dnetlib.dhp apps - 3.3.3-SNAPSHOT + 3.4.1-SNAPSHOT ../ diff --git a/libs/dnet-is-services/src/main/java/eu/dnetlib/manager/history/WorkflowLogger.java b/libs/dnet-is-services/src/main/java/eu/dnetlib/manager/history/WorkflowLogger.java index 118ad3ee..88e916b9 100644 --- a/libs/dnet-is-services/src/main/java/eu/dnetlib/manager/history/WorkflowLogger.java +++ b/libs/dnet-is-services/src/main/java/eu/dnetlib/manager/history/WorkflowLogger.java @@ -36,6 +36,10 @@ public class WorkflowLogger { } } + public List history(final String wfConfId) { + return wfHistoryEntryRepository.findByWfConfigurationIdOrderByEndDateDesc(wfConfId); + } + public WfHistoryEntry getLog(final String processId) { return wfHistoryEntryRepository.findById(processId).get(); } diff --git a/libs/dnet-is-services/src/main/java/eu/dnetlib/manager/history/repository/WfHistoryEntryRepository.java b/libs/dnet-is-services/src/main/java/eu/dnetlib/manager/history/repository/WfHistoryEntryRepository.java index a42e4647..95ef81dd 100644 --- a/libs/dnet-is-services/src/main/java/eu/dnetlib/manager/history/repository/WfHistoryEntryRepository.java +++ b/libs/dnet-is-services/src/main/java/eu/dnetlib/manager/history/repository/WfHistoryEntryRepository.java @@ -12,5 +12,7 @@ public interface WfHistoryEntryRepository extends JpaRepository findByEndDateBetweenOrderByEndDateDesc(LocalDateTime start, LocalDateTime end); + List findByWfConfigurationIdOrderByEndDateDesc(String id); + Optional findFirstByWfConfigurationIdOrderByEndDateDesc(String id); } diff --git a/libs/dnet-wf-service/pom.xml b/libs/dnet-wf-service/pom.xml index 6a398249..c0bb3e3b 100644 --- a/libs/dnet-wf-service/pom.xml +++ b/libs/dnet-wf-service/pom.xml @@ -3,7 +3,7 @@ eu.dnetlib.dhp libs - 3.3.3-SNAPSHOT + 3.4.1-SNAPSHOT ../