Skip to content
Snippets Groups Projects
Commit 9efc4f0a authored by Chris Hines's avatar Chris Hines
Browse files

convert to a reduced set of parameters for stat

parent 1b6d4d0d
No related branches found
No related tags found
No related merge requests found
...@@ -268,12 +268,12 @@ public getKeys(id?: Identity) { ...@@ -268,12 +268,12 @@ public getKeys(id?: Identity) {
private httperror(error: any) { private httperror(error: any) {
console.log('authorsation service got an error'); console.log('authorsation service got an error');
this.statusMsg.next(error); this.statusMsg.next('There was an error logging in or generating crypto tokens');
console.log(error); console.error(error);
} }
private httperrorLogout(error: any,sshauthzservice: SshAuthzServer) { private httperrorLogout(error: any,sshauthzservice: SshAuthzServer) {
console.log('authorsation service got an error'); console.log('authorsation service got an error');
this.statusMsg.next(error); this.statusMsg.next('There was an error logging out and clearing all tokens');
console.log(error); console.log(error);
if (!(sshauthzservice.logout === null)) { if (!(sshauthzservice.logout === null)) {
window.open(sshauthzservice.logout); window.open(sshauthzservice.logout);
......
...@@ -102,7 +102,7 @@ public setStatusMsg(statusMsg: BehaviorSubject<any>) { ...@@ -102,7 +102,7 @@ public setStatusMsg(statusMsg: BehaviorSubject<any>) {
this.statusMsg.next("A network error occured. Please try again latter"); this.statusMsg.next("A network error occured. Please try again latter");
return return
} }
console.log(error); console.error(error);
if (error.status == 404 || error.status == 400) { if (error.status == 404 || error.status == 400) {
this.statusMsg.next("Login expired. Please log in again."); this.statusMsg.next("Login expired. Please log in again.");
this.authorisationService.updateAgentContents(); this.authorisationService.updateAgentContents();
...@@ -123,26 +123,16 @@ public setStatusMsg(statusMsg: BehaviorSubject<any>) { ...@@ -123,26 +123,16 @@ public setStatusMsg(statusMsg: BehaviorSubject<any>) {
let bi = new BatchInterface(); let bi = new BatchInterface();
bi.cancelcmd = identity.site.cancelcmd; bi.cancelcmd = identity.site.cancelcmd;
bi.statcmd = identity.site.statcmd; bi.statcmd = identity.site.statcmd;
// if (this.batchinterface[identity.repr()] === undefined) { let params = new URLSearchParams();
// this.getconfig(new Strudelapp(),identity) params.set('statcmd',JSON.stringify(identity.site.statcmd));
// // .pipe(catchError(this.handleError)) params.set('host',JSON.stringify(identity.site.host));
// .subscribe(resp => { this.batchinterface[identity.repr()] = resp; this.getJobs(identity) }, params.set('username',JSON.stringify(identity.username));
// error => this.getBatchInterfaceError(error)); console.log('getjob with params',params.toString());
// // error => this.getJobsError(error,identity));
// this.http.get<Job[]>(this.Base+'/stat'+'?'+params.toString(),options)
// // .pipe(catchError(this.networkError))
// } else { .subscribe(resp => this.updateJoblist(resp, identity),
// let paramstr = this.buildParams(null,identity,this.batchinterface[identity.repr()]); error => this.getJobsError(error));
// this.http.get<Job[]>(this.Base+'/stat'+'?'+paramstr,options)
// // .pipe(catchError(this.networkError))
// .subscribe(resp => this.updateJoblist(resp, identity),
// error => this.getJobsError(error));
// }
let paramstr = this.buildParams(null,identity,bi);
this.http.get<Job[]>(this.Base+'/stat'+'?'+paramstr,options)
// .pipe(catchError(this.networkError))
.subscribe(resp => this.updateJoblist(resp, identity),
error => this.getJobsError(error));
} }
public getconfig(app: Strudelapp, identity: Identity): Observable<any> { public getconfig(app: Strudelapp, identity: Identity): Observable<any> {
...@@ -154,7 +144,9 @@ public setStatusMsg(statusMsg: BehaviorSubject<any>) { ...@@ -154,7 +144,9 @@ public setStatusMsg(statusMsg: BehaviorSubject<any>) {
submissionError(error: any) { submissionError(error: any) {
if (error.status != 0) { if (error.status != 0) {
this.statusMsg.next(error.error.message); this.statusMsg.next('Job submission failed');
//this.statusMsg.next(error.error.message);
console.error(error.error.message);
this.busy.next(false); this.busy.next(false);
} }
} }
...@@ -276,7 +268,6 @@ public setStatusMsg(statusMsg: BehaviorSubject<any>) { ...@@ -276,7 +268,6 @@ public setStatusMsg(statusMsg: BehaviorSubject<any>) {
}); });
this.appwindowWatcher = timer(500).pipe(repeat()).subscribe(() => this.watchAppwindow(this.appwindow,dialogRef)); this.appwindowWatcher = timer(500).pipe(repeat()).subscribe(() => this.watchAppwindow(this.appwindow,dialogRef));
// this.appwindow.location.assign(windowloc); // this.appwindow.location.assign(windowloc);
this.appwindow.focus();
} }
public connect(job: Job, appinst?: any) { public connect(job: Job, appinst?: any) {
...@@ -335,6 +326,7 @@ private httperror(errorstr: string) { ...@@ -335,6 +326,7 @@ private httperror(errorstr: string) {
let searchresult = errorstr.search(re); let searchresult = errorstr.search(re);
if (searchresult != -1) { if (searchresult != -1) {
this.statusMsg.next("Some authentication tokens have expired, you may need to log in again"); this.statusMsg.next("Some authentication tokens have expired, you may need to log in again");
console.error(errorstr);
this.authorisationService.updateAgentContents(); this.authorisationService.updateAgentContents();
} }
console.error(errorstr); console.error(errorstr);
......
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