service.component.html 3.95 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>
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
	<table style="margin-bottom: 30px;">
		<thead>
			<tr>
				<td></td>
				<td>SSH Keys</td>
			</tr>
			<tr>
				<td style="min-width: 120px;">Sites</td>
				<td *ngFor="let key of userService.user.ssh_keys" style="width: 75px;">
					{{key.name}}
				</td>
			</tr>
		</thead>
		<tbody>
		<tr *ngFor="let site of service.site" style="height: 42px;">
Lukas Burgey's avatar
Lukas Burgey committed
21
			<td>
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
				<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>
			</td>
			<td *ngFor="let key of userService.user.ssh_keys">
				<span [ngSwitch]="taskState(site, key)" class="childs-inline">
					<!-- states with actions -->
					<button *ngSwitchCase="'deployed'" mat-button mat-icon-button
										(click)="dialog.openCredentials(taskItem(site, key))"
										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
				(click)="dialog.openQuestionnaire(taskItem(site, y))"
				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>
Lukas Burgey's avatar
Lukas Burgey committed
43
					</span>
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
					<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>
					<button *ngSwitchCase="'not_deployed'" mat-icon-button matTooltip="The key {{ key.name }} is not deployed to this site.">
						<mat-icon style="vertical-align: middle">call_received</mat-icon>
					</button>
					<button *ngSwitchCase="'failed'" mat-icon-button matTooltip="This site failed to deploy the credentials. The deployment will be retried.">
						<mat-icon style="vertical-align: middle">error</mat-icon>
					</button>
					<button *ngSwitchCase="'rejected'" mat-icon-button matTooltip="This site rejected the deployment of the key {{ key.name }}.">
						<mat-icon style="vertical-align: middle">error</mat-icon>
					</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
59
					</span>
Lukas Burgey's avatar
Lukas Burgey committed
60
				</span>
61 62
			</td>
		</tr>
63 64 65
		</tbody>
	</table>
	<table>
66
		<tr>
67 68 69 70 71
			<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>
72 73 74
			</td>
		</tr>
	</table>
Lukas Burgey's avatar
Lukas Burgey committed
75
	<mat-action-row>
76 77
		<div *ngIf="userService.user.ssh_keys.length > 0; then boxes else upload"></div>
		<ng-template #boxes>
78
			<span style="margin-right: 15px;">
79
				Please select SSH Keys to deploy:
80
			</span>
81
			<mat-checkbox *ngFor="let key of userService.user.ssh_keys"
Lukas Burgey's avatar
Lukas Burgey committed
82 83 84
		 style="margin-right: 8px"
   [checked]="isDeployed(key)"
   (change)="deploymentChange(key)">
85 86
				{{ key.name }}
			</mat-checkbox>
87 88 89 90 91
		</ng-template>
		<ng-template #upload>
			<span style="margin-right: 15px;">
				Please upload an SSH Key to use this service:
			</span>
92
			<button mat-icon-button (click)="dialog.openSshKeys()"><mat-icon>vpn_key</mat-icon></button>
93
		</ng-template>
Lukas Burgey's avatar
Lukas Burgey committed
94 95
	</mat-action-row>
</mat-expansion-panel>