state.component.html 2.49 KB
Newer Older
Lukas Burgey's avatar
Lukas Burgey committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<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>

Lukas Burgey's avatar
Lukas Burgey committed
15
16
17
<ng-container *ngIf="(state$ | async) as state; else noStateItem">
  <td [matTooltip]="tooltip(state)">
	<span [ngSwitch]="state.state" class="spaced">
Lukas Burgey's avatar
Lukas Burgey committed
18
19
20
21
22
23
24
25
26
	  <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>
Lukas Burgey's avatar
Lukas Burgey committed
27
	{{ lang.printState(state.state) }}
Lukas Burgey's avatar
Lukas Burgey committed
28
29
  </td>

Lukas Burgey's avatar
Lukas Burgey committed
30
31
32
33
34
35
36
37
  <!-- state dependent buttons -->
  <td *ngIf="state.state == 'deployed'">
	<button (click)="dialog.openCredentials(state$)" mat-raised-button class="mat-elevation-z6">
	  Credentials
	</button>
  </td>
  <td *ngIf="state.state == 'questionnaire'">
	  <button (click)="dialog.openQuestionnaire(state$)" mat-raised-button class="mat-elevation-z6">
Lukas Burgey's avatar
Lukas Burgey committed
38
39
40
		Questionnaire
	  </button>
  </td>
Lukas Burgey's avatar
Lukas Burgey committed
41
42
43
44
  <td *ngIf="state.state == 'failed'">
	<button (click)="dialog.openMessage(state)" mat-raised-button class="mat-elevation-z6">
	  Failure
	</button>
Lukas Burgey's avatar
Lukas Burgey committed
45
  </td>
Lukas Burgey's avatar
Lukas Burgey committed
46
47
48
49
50
  <td *ngIf="state.state == 'rejected'">
	<button (click)="dialog.openMessage(state)" mat-raised-button class="mat-elevation-z6">
	  Rejected
	</button>
  </td>
51
  <td *ngIf="!state.is_pending && state.is_credential_pending">
Lukas Burgey's avatar
Lukas Burgey committed
52
	<span>
Lukas Burgey's avatar
Lukas Burgey committed
53
54
55
56
	  <mat-progress-spinner diameter="24" mode="indeterminate"></mat-progress-spinner>
	  SSH Keys pending
	</span>
  </td>
57
58
59
60
61
62
  <td *ngIf="(state.questionnaire | ObjKeys).length > 0 && state.state == 'deployed'"
	matTooltip="Change previously submitted answers">
	<button (click)="dialog.openQuestionnaire(state$)" mat-icon-button>
	  <mat-icon>edit</mat-icon>
	</button>
  </td>
Lukas Burgey's avatar
Lukas Burgey committed
63
64
65
66
67
68
69
70
71
72
</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>