state.component.html 2.55 KB
Newer Older
Lukas Burgey's avatar
Lukas Burgey committed
1
2
3
4
5
6
7
8
9
10
11
12
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
<td>
  <span matTooltip="Site {{ site.name }} provides the service {{ service.name }} for you">
	<mat-icon>account_balance</mat-icon>
	{{ site.name }}
  </span>
</td>

<td>
  <span matTooltip="{{ service.description }}">
	<mat-icon>web</mat-icon>
	{{ service.name }}
  </span>
</td>

<ng-container *ngIf="(state$ | async) as stateItem; else noStateItem">
  <td class="spaced" [matTooltip]="tooltip(stateItem)">
	<span [ngSwitch]="stateItem.state" class="spaced">
	  <mat-icon *ngSwitchCase="'deployed'">call_made</mat-icon>
	  <mat-icon *ngSwitchCase="'questionnaire'">warning</mat-icon>
	  <mat-progress-spinner *ngSwitchCase="'deployment_pending'" diameter="24" mode="indeterminate"></mat-progress-spinner>
	  <mat-progress-spinner *ngSwitchCase="'removal_pending'" diameter="24" mode="indeterminate"></mat-progress-spinner>
	  <mat-icon *ngSwitchCase="'not_deployed'" mat-icon-button>call_received</mat-icon>
	  <mat-icon *ngSwitchCase="'failed'" mat-icon-button>error</mat-icon>
	  <mat-icon *ngSwitchCase="'rejected'" mat-icon-button>error</mat-icon>
	  <mat-icon *ngSwitchDefault mat-icon-button>call_received</mat-icon>
	</span>
	{{ lang.printState(stateItem.state) }}
  </td>

  <td class="spaced">
	<span [ngSwitch]="stateItem.state">
	  <button *ngSwitchCase="'deployed'" (click)="dialog.openCredentials(userService.subscribeStateFor(service))" mat-raised-button class="mat-elevation-z6">
		Credentials
	  </button>
	  <button *ngSwitchCase="'questionnaire'" (click)="dialog.openQuestionnaire(stateItem)" mat-raised-button class="mat-elevation-z6">
		Questionnaire
	  </button>
	  <button *ngSwitchCase="'failed'" (click)="dialog.openMessage(stateItem)" mat-raised-button class="mat-elevation-z6">
		Failure
	  </button>
	  <button *ngSwitchCase="'rejected'" (click)="dialog.openMessage(stateItem)" mat-raised-button class="mat-elevation-z6">
		Rejected
	  </button>
	</span>
  </td>

Lukas Burgey's avatar
Lukas Burgey committed
47
48
49
50
51
52
53
54
  <td *ngIf="stateItem.answers != undefined" matTooltip="Change previously submitted answers" class="spaced">
	<span>
	  <button (click)="dialog.openQuestionnaire(state$)" mat-icon-button>
		<mat-icon>edit</mat-icon>
	  </button>
	</span>
  </td>

Lukas Burgey's avatar
Lukas Burgey committed
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
  <td class="spaced">
	<span *ngIf="!stateItem.is_pending && stateItem.is_credential_pending" class="spaced">
	  <mat-progress-spinner diameter="24" mode="indeterminate"></mat-progress-spinner>
	  SSH Keys pending
	</span>
  </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>
	{{ lang.printState('not_deployed') }}
  </td>
</ng-template>