Skip to content
Snippets Groups Projects
Commit 586d7369 authored by Daniel Nemergut's avatar Daniel Nemergut
Browse files

Updated weblog URLs to add pipeline-*/html if the manager provides a pipeline directory

parent dc9b9d29
No related branches found
No related tags found
2 merge requests!25Merge 2.4.3 UI to main,!18WS-2142 Weblog links
......@@ -21,9 +21,8 @@
</p>
<p>
<b>Weblog:</b>
<a target="_blank"
href="{{ getConfigWebLogBaseUrl() }}/vlass/weblog/{{ jobDetail.queueName }}/{{ job.job_name }}">
{{ getConfigWebLogBaseUrl() }}/vlass/weblog/{{ jobDetail.queueName }}/{{ job.job_name }}
<a target="_blank" href="{{ weblogUrl }}">
{{ weblogUrl }}
</a>
</p>
......
......@@ -28,6 +28,8 @@ export class ExecutionDetailComponent implements OnInit, OnDestroy {
public faStickyNote = faStickyNote;
public faCopy = faCopy;
public weblogUrl;
constructor(
private configService: ConfigurationService,
private jobService: JobsService,
......@@ -45,6 +47,8 @@ export class ExecutionDetailComponent implements OnInit, OnDestroy {
this.jobDetail = j;
this.noteFormGroup.get('notes').setValue(j.notes);
this.noteFormGroup.get('id').setValue(j.id);
this.loadWeblogUrl();
}
});
......@@ -93,6 +97,24 @@ export class ExecutionDetailComponent implements OnInit, OnDestroy {
return this.configService.config.weblogbaseurl;
}
loadWeblogUrl(): void {
// The base URL opens up to a file navigation URL, that's the default if the service doesn't find a pipeline directory
let weblogUrl = this.getConfigWebLogBaseUrl() + '/vlass/weblog/' + this.jobDetail.queueName + '/' + this.job.job_name;
this.jobService.getPipelineDir(this.job.job_id).subscribe(response => {
// Append the pipeline directory and /html to the base weblog URL
if (response !== null && response.body !== null && response.body !== '') {
weblogUrl = weblogUrl + '/' + response.body + '/html';
}
},
error => {
this.alertService.error('Could not find a pipeline dir, using the base weblog URL.');
},
() => {
this.weblogUrl = weblogUrl;
});
}
updateNotes() {
this.alertService.info('Saving Notes');
let notes = this.noteFormGroup.get('notes').value;
......
......@@ -11,8 +11,7 @@
Lustre
</button>
<a target="_blank" class="btn btn-xs btn-outline-primary"
href="{{ getConfigWebLogBaseUrl() }}/vlass/weblog/{{ queue.name }}/{{ job.job_name }}">
<a role="button" class="btn btn-xs btn-outline-primary" (click)="openWeblogUrl()">
<fa-icon [icon]="faExternalLinkAlt"></fa-icon>
Weblog
</a>
......
......@@ -77,6 +77,24 @@ export class ExecutionComponent implements OnInit, OnChanges {
return this.configService.config.weblogbaseurl;
}
openWeblogUrl(): void {
// The base URL opens up to a file navigation URL, that's the default if the service doesn't find a pipeline directory
let weblogUrl = this.getConfigWebLogBaseUrl() + '/vlass/weblog/' + this.queue.name + '/' + this.job.job_name;
this.jobsService.getPipelineDir(this.job.job_id).subscribe(response => {
// Append the pipeline directory and /html to the base weblog URL
if (response !== null && response.body !== null && response.body !== '') {
weblogUrl = weblogUrl + '/' + response.body + '/html';
}
},
error => {
this.alertService.error('Could not find a pipeline dir, using the base weblog URL.');
},
() => {
window.open(weblogUrl, '_blank');
});
}
getJobStatusClass(): string {
switch (this.job.job_status) {
case 'ERROR':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment