header.component.html 1.36 KB
Newer Older
Lukas Burgey's avatar
Lukas Burgey committed
1 2 3 4 5
<mat-toolbar color="primary" class="mat-typography">
	<mat-toolbar-row>
		<h1>
			Federated User Credential Deployment Portal
		</h1>
Lukas Burgey's avatar
Lukas Burgey committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
		<div class="header-bar">
			<span *ngIf="userService.loggedIn() ? false : true">
				<form *ngIf="idps"
	   (ngSubmit)="userService.login(selectedIdP)" #loginForm="ngForm">
					<mat-form-field>
						<mat-select name="idp" required [(ngModel)]="selectedIdP">
							<mat-option *ngFor="let idp of idps" [value]="idp">
								{{ idp.name }}
							</mat-option>
						</mat-select>
					</mat-form-field>
					<button mat-raised-button [disabled]="!loginForm.form.valid" color="accent" type="submit">Login</button>
				</form>
			</span>
			<span *ngIf="userService.loggedIn()">
				<button mat-button mat-icon-button (click)="dialog.openAccount()">
					<mat-icon>settings</mat-icon>
				</button>
				<button mat-button mat-icon-button (click)="dialog.openSshKeys()">
					<mat-icon>vpn_key</mat-icon>
				</button>
27 28
				<button *ngIf="userService.user.profile_name != undefined" mat-button (click)="dialog.openProfile()">
					{{ userService.user.profile_name }}
Lukas Burgey's avatar
Lukas Burgey committed
29
				</button>
30
				<button *ngIf="userService.user.profile_name == undefined" mat-button (click)="dialog.openProfile()">
Lukas Burgey's avatar
Lukas Burgey committed
31 32 33 34 35
					Profile
				</button>
				<button mat-raised-button color="accent" (click)="userService.logout()">Logout</button>
			</span>
		</div>
Lukas Burgey's avatar
Lukas Burgey committed
36 37
	</mat-toolbar-row>
</mat-toolbar>