service.component.html 3.52 KB
Newer Older
Lukas Burgey's avatar
Lukas Burgey committed
1
<mat-expansion-panel *ngIf="service">
Lukas Burgey's avatar
Lukas Burgey committed
2
	<mat-expansion-panel-header>
Lukas Burgey's avatar
Lukas Burgey committed
3 4
		 <mat-panel-title>{{ service.name }}</mat-panel-title>
		<mat-panel-description>{{ service.description }}</mat-panel-description>
Lukas Burgey's avatar
Lukas Burgey committed
5
	</mat-expansion-panel-header>
Lukas Burgey's avatar
Lukas Burgey committed
6 7
	<table width="60%">
		<tr style="margin-bottom: 15px;">
Lukas Burgey's avatar
Lukas Burgey committed
8
			<td *ngFor="let site of service.site">
9
				<span matTooltip="Provided at site {{ site.name }}" style="margin-right: 10px;">
Lukas Burgey's avatar
Lukas Burgey committed
10 11 12
					<mat-icon style="vertical-align: middle; padding-right: 5px;">storage</mat-icon>
					{{ site.name }}
				</span>
Lukas Burgey's avatar
Lukas Burgey committed
13
				<span *ngIf="userService.user.ssh_keys.length > 0">
Lukas Burgey's avatar
Lukas Burgey committed
14
					<span *ngFor="let key of userService.user.ssh_keys"
Lukas Burgey's avatar
Lukas Burgey committed
15
						[ngSwitch]="userService.taskState(site, service, key)" class="childs-inline" style="margin-right: 5px;">
Lukas Burgey's avatar
Lukas Burgey committed
16 17
						<!-- states with actions -->
						<button *ngSwitchCase="'deployed'" mat-button mat-icon-button
Lukas Burgey's avatar
Lukas Burgey committed
18
																 matTooltip="The key {{key.name}} is deployed to the site. Click to see details.">
Lukas Burgey's avatar
Lukas Burgey committed
19 20 21
							<mat-icon style="vertical-align: middle">call_made</mat-icon>
						</button>
						<button *ngSwitchCase="'questionnaire'" mat-button mat-icon-button
Lukas Burgey's avatar
Lukas Burgey committed
22 23
							(click)="dialog.openQuestionnaire(userService.taskItem(site, service))"
							matTooltip="This site needs more data to deploy the keys. Please click to submit the data.">
Lukas Burgey's avatar
Lukas Burgey committed
24 25 26
							<mat-icon>warning</mat-icon>
						</button>
						<!-- states without actions -->
Lukas Burgey's avatar
Lukas Burgey committed
27
						<span *ngSwitchCase="'deployment_pending'" matTooltip="Waiting for the deployment of the key {{ key.name }} by the site">
Lukas Burgey's avatar
Lukas Burgey committed
28 29
							<mat-progress-spinner diameter="24" mode="indeterminate"></mat-progress-spinner>
						</span>
Lukas Burgey's avatar
Lukas Burgey committed
30
						<span *ngSwitchCase="'removal_pending'" matTooltip="Waiting for the removal of the key {{ key.name }} from the site">
Lukas Burgey's avatar
Lukas Burgey committed
31 32
							<mat-progress-spinner diameter="24" mode="indeterminate"></mat-progress-spinner>
						</span>
Lukas Burgey's avatar
Lukas Burgey committed
33
						<span *ngSwitchCase="'not_deployed'" matTooltip="The key {{ key.name }} is not deployed to this site.">
Lukas Burgey's avatar
Lukas Burgey committed
34 35
							<mat-icon style="vertical-align: middle">call_received</mat-icon>
						</span>
Lukas Burgey's avatar
Lukas Burgey committed
36
						<span *ngSwitchCase="'failed'" matTooltip="This site failed to deploy the credentials. The deployment will be retried.">
Lukas Burgey's avatar
Lukas Burgey committed
37 38
							<mat-icon style="vertical-align: middle">error</mat-icon>
						</span>
Lukas Burgey's avatar
Lukas Burgey committed
39
						<span *ngSwitchCase="'rejected'" matTooltip="This site rejected the deployment of the key {{ key.name }}.">
Lukas Burgey's avatar
Lukas Burgey committed
40 41
							<mat-icon style="vertical-align: middle">error</mat-icon>
						</span>
Lukas Burgey's avatar
Lukas Burgey committed
42 43
						<span *ngSwitchDefault matTooltip="Unrecognized state">
							<mat-icon style="vertical-align: middle">error</mat-icon>
Lukas Burgey's avatar
Lukas Burgey committed
44
						</span>
Lukas Burgey's avatar
Lukas Burgey committed
45
					</span>
Lukas Burgey's avatar
Lukas Burgey committed
46
				</span>
Lukas Burgey's avatar
Lukas Burgey committed
47 48 49 50
			</td>
		</tr>
		<tr>
			<td style="padding-right: 35px;"
Lukas Burgey's avatar
Lukas Burgey committed
51
					*ngFor="let group of service.groups"
Lukas Burgey's avatar
Lukas Burgey committed
52 53 54 55 56 57
					 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
58
	<mat-action-row>
Lukas Burgey's avatar
Lukas Burgey committed
59 60
		<div *ngIf="userService.user.ssh_keys.length > 0; then boxes else upload"></div>
		<ng-template #boxes>
61
			<span style="margin-right: 15px;">
Lukas Burgey's avatar
Lukas Burgey committed
62 63
				SSH Keys:
			</span>
64 65 66 67 68 69
			<mat-checkbox *ngFor="let key of userService.user.ssh_keys"
				 style="margin-right: 8px"
				 [checked]="isDeployed(key)"
				 (change)="deploymentChange(key)">
				{{ key.name }}
			</mat-checkbox>
Lukas Burgey's avatar
Lukas Burgey committed
70 71 72 73 74
		</ng-template>
		<ng-template #upload>
			<span style="margin-right: 15px;">
				Please upload an SSH Key to use this service:
			</span>
75
			<button mat-icon-button (click)="dialog.openSshKeys()"><mat-icon>vpn_key</mat-icon></button>
Lukas Burgey's avatar
Lukas Burgey committed
76
		</ng-template>
Lukas Burgey's avatar
Lukas Burgey committed
77 78
	</mat-action-row>
</mat-expansion-panel>