service.component.html 3.01 KB
Newer Older
1
<mat-expansion-panel *ngIf="serviceData">
Lukas Burgey's avatar
Lukas Burgey committed
2
	<mat-expansion-panel-header>
3
		 <mat-panel-title>{{ serviceData.name }}</mat-panel-title>
Lukas Burgey's avatar
Lukas Burgey committed
4 5
		<mat-panel-description>{{ serviceData.description }}</mat-panel-description>
	</mat-expansion-panel-header>
6 7 8
	<table width="60%">
		<tr style="margin-bottom: 15px;">
			<td *ngFor="let site of serviceData.site">
9
				<span matTooltip="Provided at site {{ site.name }}" style="margin-right: 10px;">
10 11 12
					<mat-icon style="vertical-align: middle; padding-right: 5px;">storage</mat-icon>
					{{ site.name }}
				</span>
13 14
				<span [ngSwitch]="userService.taskState(site, serviceData)">
					<span *ngSwitchCase="'pending'"
Lukas Burgey's avatar
Lukas Burgey committed
15
						mat-button mat-icon-button style="display: inline-block; vertical-align: middle"
Lukas Burgey's avatar
Lukas Burgey committed
16 17 18 19 20 21
						matTooltip="Waiting for site">
						<mat-progress-spinner diameter="24" mode="indeterminate"></mat-progress-spinner>
					</span>
					<span *ngSwitchCase="'answered'"
						mat-button mat-icon-button style="display: inline-block; vertical-align: middle"
						matTooltip="Waiting for site">
22 23
						<mat-progress-spinner diameter="24" mode="indeterminate"></mat-progress-spinner>
					</span>
Lukas Burgey's avatar
Lukas Burgey committed
24 25
					<button *ngSwitchCase="'done'"
						mat-button mat-icon-button style="display: inline-block; vertical-align: middle"
Lukas Burgey's avatar
Lukas Burgey committed
26
						matTooltip="The credentials have the supposed state.">
27
						<mat-icon style="vertical-align: middle">done</mat-icon>
Lukas Burgey's avatar
Lukas Burgey committed
28 29 30
					</button>
					<button *ngSwitchCase="'failed'"
						mat-button mat-icon-button style="display: inline-block; vertical-align: middle"
Lukas Burgey's avatar
Lukas Burgey committed
31
						matTooltip="This site failed to deploy the credentials. It will retry the deployment.">
32
						<mat-icon style="vertical-align: middle">error</mat-icon>
Lukas Burgey's avatar
Lukas Burgey committed
33 34 35 36
					</button>
					<button *ngSwitchCase="'rejected'"
						(click)="dialog.openQuestionnaire(userService.taskItem(site, serviceData))"
						mat-button mat-icon-button style="display: inline-block; vertical-align: middle"
Lukas Burgey's avatar
Lukas Burgey committed
37 38
						matTooltip="This site needs more data to deploy the credentials. Please click to
						submit the data.">
Lukas Burgey's avatar
Lukas Burgey committed
39 40
						<mat-icon>warning</mat-icon>
					</button>
41
				</span>
42 43 44 45 46 47 48 49 50 51 52
			</td>
		</tr>
		<tr>
			<td style="padding-right: 35px;"
					*ngFor="let group of serviceData.groups"
					 matTooltip="Can be used with membership of group {{ group.name }}">
				<mat-icon style="vertical-align: middle; padding-right: 5px;">lock outline</mat-icon>
				{{ group.name }}
			</td>
		</tr>
	</table>
Lukas Burgey's avatar
Lukas Burgey committed
53
	<mat-action-row>
54 55
		<div *ngIf="userService.user.ssh_keys.length > 0; then boxes else upload"></div>
		<ng-template #boxes>
56
			<span style="margin-right: 15px;">
57 58
				SSH Keys:
			</span>
59 60 61 62 63 64
			<mat-checkbox *ngFor="let key of userService.user.ssh_keys"
				 style="margin-right: 8px"
				 [checked]="isDeployed(key)"
				 (change)="deploymentChange(key)">
				{{ key.name }}
			</mat-checkbox>
65 66 67 68 69
		</ng-template>
		<ng-template #upload>
			<span style="margin-right: 15px;">
				Please upload an SSH Key to use this service:
			</span>
70
			<button mat-icon-button (click)="dialog.openSshKeys()"><mat-icon>vpn_key</mat-icon></button>
71
		</ng-template>
Lukas Burgey's avatar
Lukas Burgey committed
72 73
	</mat-action-row>
</mat-expansion-panel>