state.component.html 2.42 KB
Newer Older
Lukas Burgey's avatar
Lukas Burgey committed
1
<td>
Lukas Burgey's avatar
Lukas Burgey committed
2
3
4
5
6
	{{ service.site.name }}
	<br>
	<p>
	{{ service.site.description }}
	</p>
Lukas Burgey's avatar
Lukas Burgey committed
7
8
9
</td>

<td>
Lukas Burgey's avatar
Lukas Burgey committed
10
11
12
13
14
	{{ service.name }}
	<br>
	<p>
	{{ service.description }}
	</p>
Lukas Burgey's avatar
Lukas Burgey committed
15
16
</td>

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

Lukas Burgey's avatar
Lukas Burgey committed
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
	<!-- 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">
			Questionnaire
		</button>
	</td>
	<td *ngIf="state.state == 'failed'">
		<button (click)="dialog.openMessage(state)" mat-raised-button class="mat-elevation-z6">
			Failure
		</button>
	</td>
	<td *ngIf="state.state == 'rejected'">
		<button (click)="dialog.openMessage(state)" mat-raised-button class="mat-elevation-z6">
			Rejected
		</button>
	</td>
	<td *ngIf="!state.is_pending && state.is_credential_pending">
		<span>
			<mat-progress-spinner diameter="24" mode="indeterminate"></mat-progress-spinner>
			SSH Keys pending
		</span>
	</td>
	<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
67
68
69
</ng-container>

<ng-template #noStateItem>
Lukas Burgey's avatar
Lukas Burgey committed
70
71
	<td>
		<span>
Lukas Burgey's avatar
Lukas Burgey committed
72
			<mat-icon mat-icon-button>call_received</mat-icon>
Lukas Burgey's avatar
Lukas Burgey committed
73
74
		</span>
		{{ lang.printState('not_deployed') }}
Lukas Burgey's avatar
Lukas Burgey committed
75
76
		<br>
		<p>Access to this service was never requested.</p>
Lukas Burgey's avatar
Lukas Burgey committed
77
	</td>
Lukas Burgey's avatar
Lukas Burgey committed
78
</ng-template>