service.component.html 3.97 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
	<table style="margin-bottom: 30px; margin: auto;">
7 8
		<thead>
			<tr>
9 10 11
				<td style="min-width: 150px;">Site</td>
				<td>State</td>
				<td style="min-width: 150px;"></td>
12 13 14 15
			</tr>
		</thead>
		<tbody>
		<tr *ngFor="let site of service.site" style="height: 42px;">
Lukas Burgey's avatar
Lukas Burgey committed
16
			<td>
17 18 19 20 21
				<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>
22 23 24 25 26 27 28 29 30 31 32
			<td>
			  <span [ngSwitch]="stateItem(site)?.state" class="childs-inline">
				<mat-icon *ngSwitchCase="'deployed'" matTooltip="The credentials are deployed for the service {{ service.name }}. Click to see details.">call_made</mat-icon>
				<mat-icon *ngSwitchCase="'questionnaire'" matTooltip="The site {{ site.name }} needs more data to deploy your credentials. Please click to submit the data.">warning</mat-icon>
				<mat-progress-spinner *ngSwitchCase="'deployment_pending'" diameter="24" mode="indeterminate" matTooltip="Waiting for the deployment of the credentials to the site {{ site.name }}"></mat-progress-spinner>
				<mat-progress-spinner *ngSwitchCase="'removal_pending'" diameter="24" mode="indeterminate" matTooltip="Waiting for the removal of the credentials from the site {{ site.name }}"></mat-progress-spinner>
				<mat-icon *ngSwitchCase="'not_deployed'" mat-icon-button matTooltip="The credentials are not deployed for the service {{ service.name }}.">call_received</mat-icon>
				<mat-icon *ngSwitchCase="'failed'" mat-icon-button matTooltip="Site {{ site.name }} failed to deploy the credentials. The deployment will be retried. Click for details.">error</mat-icon>
				<mat-icon *ngSwitchCase="'rejected'" mat-icon-button matTooltip="Site {{ site.name }} rejected the deployment of the credentials. Click for details.">error</mat-icon>
				<mat-icon *ngSwitchDefault mat-icon-button matTooltip="Access to this service was never requested.">call_received</mat-icon>
			  </span>
33
			</td>
34 35 36 37 38 39 40
			<td>
			  <span [ngSwitch]="stateItem(site)?.state">
				<button *ngSwitchCase="'questionnaire'" (click)="dialog.openQuestionnaire(stateItem(site))" mat-raised-button class="mat-elevation-z6"> Questionnaire </button>
				<button *ngSwitchCase="'deployed'" (click)="dialog.openCredentials(stateItem(site))" mat-raised-button class="mat-elevation-z6"> Credentials </button>
				<button *ngSwitchCase="'failed'" (click)="dialog.openMessage(stateItem(site))" mat-raised-button class="mat-elevation-z6"> Failure </button>
				<button *ngSwitchCase="'rejected'" (click)="dialog.openMessage(stateItem(site))" mat-raised-button class="mat-elevation-z6"> Rejected </button>
			  </span>
41 42
			</td>
		</tr>
43
		</tbody>
44
	</table>
Lukas Burgey's avatar
Lukas Burgey committed
45
	<mat-action-row>
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
	  <div [ngSwitch]="deployment?.state_target">
		<span *ngSwitchCase="'not_deployed'" style="margin-right: 15px;">
		  You did not request access to this service.
		</span>
		<span *ngSwitchCase="'deployed'" style="margin-right: 15px;">
		  You requested access to this service.
		</span>
		<span *ngSwitchDefault style="margin-right: 15px;">
		  You never requested access to this service.
		</span>
	  </div>
		<div [ngSwitch]="deployment?.state_target">
		  <button *ngSwitchCase="'not_deployed'" (click)="changeDeployment('add')" mat-raised-button color="primary" matTooltip="Deploy credentials to the service">
			Deploy credentials
		  </button>
		  <button *ngSwitchCase="'deployed'" (click)="changeDeployment('remove')" mat-raised-button color="primary" matTooltip="Remove credentials from the service">
			Remove credentials
		  </button>
		  <button *ngSwitchDefault (click)="changeDeployment('add')" mat-raised-button color="primary" matTooltip="Deploy credentials to the service for the first time">
			Deploy credentials
		  </button>
		</div>
Lukas Burgey's avatar
Lukas Burgey committed
68 69
	</mat-action-row>
</mat-expansion-panel>