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

<td>
Lukas Burgey's avatar
Lukas Burgey committed
8
	<h4>{{ service.name }}</h4>
Lukas Burgey's avatar
Lukas Burgey committed
9
	<br>
Lukas Burgey's avatar
Lukas Burgey committed
10
	<small>{{ service.description }}</small>
Lukas Burgey's avatar
Lukas Burgey committed
11
12
</td>

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

Lukas Burgey's avatar
Lukas Burgey committed
30
31
32
33
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
	<!-- 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
63
64
65
</ng-container>

<ng-template #noStateItem>
Lukas Burgey's avatar
Lukas Burgey committed
66
67
	<td>
		<span>
Lukas Burgey's avatar
Lukas Burgey committed
68
			<mat-icon mat-icon-button>call_received</mat-icon>
Lukas Burgey's avatar
Lukas Burgey committed
69
		</span>
Lukas Burgey's avatar
Lukas Burgey committed
70
		<h4>{{ lang.printState('not_deployed') }}</h4>
Lukas Burgey's avatar
Lukas Burgey committed
71
		<br>
Lukas Burgey's avatar
Lukas Burgey committed
72
		<small>Access to this service was never requested.</small>
Lukas Burgey's avatar
Lukas Burgey committed
73
	</td>
Lukas Burgey's avatar
Lukas Burgey committed
74
</ng-template>