service.component.html 3.55 KB
Newer Older
Lukas Burgey's avatar
Lukas Burgey committed
1
<mat-expansion-panel *ngIf="serviceData">
Lukas Burgey's avatar
Lukas Burgey committed
2
	<mat-expansion-panel-header>
Lukas Burgey's avatar
Lukas Burgey committed
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>
Lukas Burgey's avatar
Lukas Burgey committed
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;">
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
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
				<div *ngIf="userService.user.ssh_keys.length > 0">
					<span *ngFor="let key of userService.user.ssh_keys"
						[ngSwitch]="userService.taskState(site, serviceData, key)" class="childs-inline">
						<!-- states with actions -->
						<button *ngSwitchCase="'deployed'" mat-button mat-icon-button
							matTooltip="The credentials are deployed to the site.">
							<mat-icon style="vertical-align: middle">call_made</mat-icon>
						</button>
						<button *ngSwitchCase="'questionnaire'" mat-button mat-icon-button
							(click)="dialog.openQuestionnaire(userService.taskItem(site, serviceData))"
							matTooltip="This site needs more data to deploy the credentials. Please click to
							submit the data.">
							<mat-icon>warning</mat-icon>
						</button>
						<!-- states without actions -->
						<span *ngSwitchCase="'deployment_pending'"
													matTooltip="Waiting for the deployment of the credentials from the site">
							<mat-progress-spinner diameter="24" mode="indeterminate"></mat-progress-spinner>
						</span>
						<span *ngSwitchCase="'removal_pending'"
												 matTooltip="Waiting for the removal of the credentials from the site">
							<mat-progress-spinner diameter="24" mode="indeterminate"></mat-progress-spinner>
						</span>
						<span *ngSwitchCase="'not_deployed'"
											  matTooltip="The credential is not deployed to this site.">
							<mat-icon style="vertical-align: middle">call_received</mat-icon>
						</span>
						<span *ngSwitchCase="'failed'"
										matTooltip="This site failed to deploy the credentials. The deployment will be retried.">
							<mat-icon style="vertical-align: middle">error</mat-icon>
						</span>
						<span *ngSwitchCase="'rejected'"
										  matTooltip="This site rejected the deployment. You can not use this service.">
							<mat-icon style="vertical-align: middle">error</mat-icon>
						</span>
						<span *ngSwitchDefault
								matTooltip="Unrecognized state">
							<mat-icon style="vertical-align: middle">details</mat-icon>
						</span>
Lukas Burgey's avatar
Lukas Burgey committed
52
					</span>
Lukas Burgey's avatar
Lukas Burgey committed
53
				</div>
Lukas Burgey's avatar
Lukas Burgey committed
54
55
56
57
58
59
60
61
62
63
64
			</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
65
	<mat-action-row>
Lukas Burgey's avatar
Lukas Burgey committed
66
67
		<div *ngIf="userService.user.ssh_keys.length > 0; then boxes else upload"></div>
		<ng-template #boxes>
68
			<span style="margin-right: 15px;">
Lukas Burgey's avatar
Lukas Burgey committed
69
70
				SSH Keys:
			</span>
71
72
73
74
75
76
			<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
77
78
79
80
81
		</ng-template>
		<ng-template #upload>
			<span style="margin-right: 15px;">
				Please upload an SSH Key to use this service:
			</span>
82
			<button mat-icon-button (click)="dialog.openSshKeys()"><mat-icon>vpn_key</mat-icon></button>
Lukas Burgey's avatar
Lukas Burgey committed
83
		</ng-template>
Lukas Burgey's avatar
Lukas Burgey committed
84
85
	</mat-action-row>
</mat-expansion-panel>