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