Commit 07a54cb6 authored by Chris Hines's avatar Chris Hines
Browse files

Merge branch 'dev' into 'test'

Dev

See merge request !88
parents 8f2137f9 5aff07a2
Pipeline #15682 passed with stages
in 7 minutes and 18 seconds
......@@ -33,6 +33,7 @@ export class JobsService {
public refreshJobs() {
if (this.id !== undefined && this.id !== null) {
var query$: Observable<Job[]>;
console.log('refreshJobs');
query$ = this.tes.runCommand(this.id, this.id.site.statcmd)
query$.subscribe((qjobs) => this.jobs$.next(<Job[]>qjobs),
(error) => this.getJobsError(error,this.id))
......@@ -41,6 +42,10 @@ export class JobsService {
}
public getJobsError(error,identity: Identity) {
if (error.hasOwnProperty('status') && error.status == 401) {
this.notifications.notify("Your login appears to have expired. Please log in again", () => { this.authService.updateAgentContents().subscribe((_) => {return}) } );
return;
}
this.tsub.unsubscribe();
if (identity.expiry < Date.now()) {
this.notifications.notify("Your login has expired. Please log in again", () => { this.authService.updateAgentContents().subscribe((_) => {return}) } );
......@@ -53,6 +58,7 @@ export class JobsService {
return;
}
this.notifications.notify("Unable to retrieve a list of running jobs.\nThe error messge was " + error.error.message);
console.log(error);
return;
}
console.error(error);
......
......@@ -89,7 +89,11 @@ export class LaunchDialogComponent implements OnInit {
theme = 'strudel-light-theme';
}
if (this.identity !== null && this.app !== null) {
this.batchcmdurl = this.identity.site.url+"/"+encodeURIComponent(this.app.name)+"?theme="+theme;
if (this.app.batchcmdurl !== null && this.app.batchcmdurl !== undefined) {
this.batchcmdurl = this.app.batchcmdurl+"?theme="+theme;
} else {
this.batchcmdurl = this.identity.site.url+"/"+encodeURIComponent(this.app.name)+"?theme="+theme;
}
}
this.batchcmdsafeurl = this.domSanitizer.bypassSecurityTrustResourceUrl(this.batchcmdurl);
if (this.app.url !== null) {
......
......@@ -171,6 +171,7 @@ export class LauncherComponent implements OnInit {
this.subscriptions.push(this.authService.sshAuthzServers.subscribe(o => {this.updateSshAuthZServers(o)}));
this.subscriptions.push(this.computeSitesService.identities.subscribe(o => this.navLogin(o)));
this.subscriptions.push(this.computeSitesService.appidentities.subscribe(o => this.getHealth(o)));
this.subscriptions.push(timer(60000).pipe(repeat()).subscribe(() => { this.getHealth(this.computeSitesService.appidentities.value) } ));
this.subscriptions.push(this.identity$.subscribe(o => this.jobsService.setId(o)));
}
......
......@@ -8,6 +8,7 @@ export class AppAction {
}
export class Strudelapp {
url: string; // A url used to retrieve extra config options. May be null
batchcmdurl: string = null; // if an app provides a batchcommandurl it overrides the url provieded for the site.
name: string;
startscript: string; // batch script ... should NOT include resource directives
// resource directives like #SBATCH belong in the batchinterface
......
......@@ -10,19 +10,5 @@
"cancelcmd": "/usr/local/strudel2_cluster/latest/bin/s2cancel {jobid}",
"statcmd": "/usr/local/strudel2_cluster/latest/bin/s2stat",
"userhealth": "/usr/local/bin/uijson"
},
{
"url": "https://beta-api.cloud.cvl.org.au/cvluwa/",
"name": "CVL@UWA",
"host": "146.118.65.246",
"dtn": "146.118.65.242",
"cafingerprint": "ECDSA SHA256:6wVXdokvvlTNcXPMc9KyvIXA8a8XNfLuhBfNOYeeMdg",
"appCatalog": [],
"appCatalogCmd": "/home/strudel2/bin/getapps",
"cancelcmd": "/home/strudel2/bin/s2cancel {jobid}",
"statcmd": "/home/strudel2/bin/s2stat",
"userhealth": "/home/strudel2/bin/uijson",
"cacheturis": [],
"contact": "<CVL@UWA Support> help@massive.org.au"
}
]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment