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

more updates to error handlers

parent 710dff7b
No related branches found
No related tags found
1 merge request!117Revert "Revert "Add MLeRP Monash""
// This is the main login screen. It displays of dropdown list of places where you can get an SSH certificate
import { Component, OnInit } from '@angular/core';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA, MatDialogModule, MatDialogConfig } from '@angular/material/dialog';
import {OverlayContainer} from '@angular/cdk/overlay';
import { Subscription } from 'rxjs';
import { tap, filter, map } from 'rxjs/operators';
import { Router, NavigationStart } from '@angular/router';
import { TesService } from '../tes.service';
import {BackendSelectionService } from '../backend-selection.service';
import { AuthorisationService } from '../authorisation.service';
import { Identity } from '../identity';
import { Computesite } from '../computesite';
import { LogoutdialogComponent } from '../logoutdialog/logoutdialog.component';
import { SshAuthzServer } from '../identity';
import { ComputesitesService } from '../computesites.service';
import { IpcService } from '../ipc.service';
import {DomSanitizer} from '@angular/platform-browser';
import {PipeTransform, Pipe} from "@angular/core";
import { LocationStrategy } from '@angular/common';
// This allows us to include html links in the description of each site you can log into
@Pipe({ name: 'safeHtml'})
export class SafeHtmlPipe implements PipeTransform {
constructor(private sanitized: DomSanitizer) {}
......@@ -39,7 +32,6 @@ export class LoginComponent implements OnInit {
public identities: Identity[];
public selectedApiServer: any;
public selected: any;
private subscriptions: Subscription[];
public loggedInAuthZ: any;
public loggedOutAuthZ: any;
......@@ -50,52 +42,20 @@ export class LoginComponent implements OnInit {
public authService: AuthorisationService,
public computeSitesService: ComputesitesService,
public overlayContainer: OverlayContainer,
private router: Router,
private ipcService: IpcService,
private locationStrategy: LocationStrategy,
) {
}
/* updateSshAuthZServers(o) {
this.sshauthzservers = o;
} */
ngOnInit() {
//this.subscriptions.push(this.computeSitesService.appidentities.subscribe(o => this.navLaunch(o)));
/* let navlaunch = localStorage.getItem('strudel-navlaunch')
//const isdefined = filter(v => v !== null && v !== undefined)
if (navlaunch == 'true') {
localStorage.setItem('strudel-navlaunch',null)
//this.subscriptions.push(this.computeSitesService.appidentities.subscribe(o => this.navLaunch(o)));
}
*/
this.authService.loggedInAuthZ$.subscribe((v) => {console.log('loggedin',v); this.loggedInAuthZ = v})
this.authService.loggedOutAuthZ$.subscribe((v) => { console.log('loggedout',v); this.loggedOutAuthZ = v})
}
ngOnDestroy() {
}
/* navLaunch(o) {
this.computeSitesService.appidentities$.pipe(filter((v) => v.length >= 0)).subscribe((v) => this.router.navigate['/launch'])
if (this.computeSitesService.appidentities.value !== null && this.computeSitesService.appidentities.value.length > 0) {
this.router.navigate(['/launch']);
}
}
*/
// login () {
//localStorage.setItem('strudel-navlaunch','true');
//this.authService.login(this.selected);
// }
public login() {
let authservice = this.selected;
// Initiate Login
......
......@@ -82,7 +82,7 @@ getUserHealthObservable(identity: Identity) {
public accountAlertError(error): Observable<any> {
if (error.hasOwnProperty('stats' && error.status == 500)) {
if (error.hasOwnProperty('stats' && (error.status == 500 || error.status == 503))) {
return of([{'type': 'message', 'msg':'Unable to retrieve account info'}])
}
}
......
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