vo-data.component.html 5.5 KB
Newer Older
Lukas Burgey's avatar
Lukas Burgey committed
1
<mat-expansion-panel>
2
  <mat-expansion-panel-header>
3 4
	<mat-panel-title style="min-width: 100px;">{{ vo.pretty_name }}</mat-panel-title>
	<mat-panel-description>{{ vo.description }}</mat-panel-description>
5
  </mat-expansion-panel-header>
6 7

  <!-- expansion body -->
Lukas Burgey's avatar
Lukas Burgey committed
8 9 10 11 12
  <div *ngIf="(services$$ | async) as services; else noServiceList">
	<div *ngIf="services != undefined && services.length > 0; else noServiceList">
	  <p>
	  These services are provided for members of this VO.
	  </p>
13
	  <table>
Lukas Burgey's avatar
Lukas Burgey committed
14 15 16 17 18 19 20 21 22
		<thead>
		  <tr>
			<td>Site</td>
			<td>Service</td>
			<td>State</td>
		  </tr>
		</thead>
		<tbody>
		  <ng-container *ngFor="let site of sites$$ | async">
23
			<tr *ngFor="let service of servicesAtSite(site) | async">
Lukas Burgey's avatar
Lukas Burgey committed
24 25 26 27
			  <td>
				<span matTooltip="Site {{ site.name }} provides the service {{ service.name }} for members of {{ vo.name }}">
				  <mat-icon>account_balance</mat-icon>
				  {{ site.name }}
Lukas Burgey's avatar
Lukas Burgey committed
28 29
				</span>
			  </td>
30
			  <td>
Lukas Burgey's avatar
Lukas Burgey committed
31 32 33
				<span matTooltip="{{ userService.serviceDescription(service) }}">
				  <mat-icon>web</mat-icon>
				  {{ service.name }}
34 35
				</span>
			  </td>
Lukas Burgey's avatar
Lukas Burgey committed
36
			  <ng-container *ngIf="(subscribeStateItem(site, service) | async) as stateItem; else noStateItem">
37 38
				<td>
				  <span [ngSwitch]="stateItem.state" class="spaced">
Lukas Burgey's avatar
Lukas Burgey committed
39 40 41 42 43 44 45 46 47
					<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="This site needs more data to deploy the keys. 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>
Lukas Burgey's avatar
Lukas Burgey committed
48
				  {{ lang.printState(stateItem.state) }}
Lukas Burgey's avatar
Lukas Burgey committed
49 50 51 52 53
				</td>
				<td *ngIf="stateItem.state === 'questionaire'">
				  <button (click)="dialog.openQuestionnaire(stateItem)" mat-raised-button class="mat-elevation-z6"> Questionnaire </button>
				</td>
				<td *ngIf="stateItem.state === 'deployed'">
54
				  <button (click)="dialog.openCredentials(subscribeStateItem(site, service))" mat-raised-button class="mat-elevation-z6"> Credentials </button>
Lukas Burgey's avatar
Lukas Burgey committed
55 56 57 58 59 60 61
				</td>
				<td *ngIf="stateItem.state === 'failed'">
				  <button (click)="dialog.openMessage(stateItem)" mat-raised-button class="mat-elevation-z6"> Failure </button>
				</td>
				<td *ngIf="stateItem.state === 'rejected'">
				  <button (click)="dialog.openMessage(stateItem)" mat-raised-button class="mat-elevation-z6"> Rejected </button>
				</td>
Lukas Burgey's avatar
Lukas Burgey committed
62
				<td *ngIf="!stateItem.is_pending && stateItem.is_credential_pending">
63
				  <span class="spaced">
Lukas Burgey's avatar
Lukas Burgey committed
64 65 66 67 68 69 70 71 72 73
					<mat-progress-spinner diameter="24" mode="indeterminate"></mat-progress-spinner>
				  </span>
				  SSH Keys pending
				</td>
			  </ng-container>
			  <ng-template #noStateItem>
				<td>
				  <span>
					<mat-icon mat-icon-button matTooltip="Access to this service was never requested.">call_received</mat-icon>
				  </span>
Lukas Burgey's avatar
Lukas Burgey committed
74
				  {{ lang.printState('not_deployed') }}
Lukas Burgey's avatar
Lukas Burgey committed
75 76 77 78 79 80 81 82
				</td>
			  </ng-template>
			</tr>
		  </ng-container>
		</tbody>
	  </table>
	</div>
  </div>
83
  <ng-template #noServiceList>
Lukas Burgey's avatar
Lukas Burgey committed
84 85
	<div *ngIf="(deployment$$ | async) as deployment; else noDeployment">
	  <p *ngIf="deployment.state_target === 'deployed'; else noDeployment">
86 87 88 89 90 91
	  Currently, no services need membership of this VO. We will deploy your credentials to new services.
	  </p>
	</div>
  </ng-template>
  <ng-template #noDeployment>
	<p>
Lukas Burgey's avatar
Lukas Burgey committed
92 93
	Currently, no services need membership of this VO. You can request a deployment anyway. We will deploy them to new services.
	</p>
94 95
  </ng-template>
  <mat-action-row>
96
	<div [ngSwitch]="(deployment$$ | async)?.state_target">
97
	  <span *ngSwitchCase="'not_deployed'" style="margin-right: 15px;">
Lukas Burgey's avatar
Lukas Burgey committed
98
		You did not request access to services of this VO.
99 100 101 102 103
	  </span>
	  <span *ngSwitchCase="'deployed'" style="margin-right: 15px;">
		You requested access to the services of this VO.
	  </span>
	</div>
104
	<div [ngSwitch]="(deployment$$ | async)?.state_target">
105
	  <button *ngSwitchCase="'not_deployed'" (click)="changeDeployment('add')" mat-raised-button color="primary" matTooltip="Deploy credentials to services of VO {{ vo.name }}">
106
		Deploy my credentials
107
	  </button>
108
	  <button *ngSwitchCase="'deployed'" (click)="changeDeployment('remove')" mat-raised-button color="primary" matTooltip="Remove credentials from services of VO {{ vo.name }}">
109
		Remove my credentials
110
	  </button>
111
	  <button *ngSwitchDefault (click)="changeDeployment('add')" mat-raised-button color="primary" matTooltip="Deploy credentials to services of VO {{ vo.name }} the first time">
112
		Deploy my credentials
113 114 115
	  </button>
	</div>
  </mat-action-row>
Lukas Burgey's avatar
Lukas Burgey committed
116
</mat-expansion-panel>