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
	<span matTooltip="{{ service.site.description}}" matTooltipClass="my-tooltip">
Lukas Burgey's avatar
Lukas Burgey committed
3
		{{ service.site.name }}
Lukas Burgey's avatar
Lukas Burgey committed
4
		<mat-icon>help</mat-icon>
Lukas Burgey's avatar
Lukas Burgey committed
5
	</span>
Lukas Burgey's avatar
Lukas Burgey committed
6
7
8
</td>

<td>
Lukas Burgey's avatar
Lukas Burgey committed
9
10
	<span matTooltip="{{ service.description }}">
		{{ service.name }}
Lukas Burgey's avatar
Lukas Burgey committed
11
		<mat-icon>help</mat-icon>
Lukas Burgey's avatar
Lukas Burgey committed
12
	</span>
Lukas Burgey's avatar
Lukas Burgey committed
13
14
</td>

Lukas Burgey's avatar
Lukas Burgey committed
15
<ng-container *ngIf="(state$ | async) as state; else noStateItem">
Lukas Burgey's avatar
Lukas Burgey committed
16
17
18
19
20
21
22
23
24
25
26
27
28
	<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) }}
	</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
68
69
70
71
	<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>
Lukas Burgey's avatar
Lukas Burgey committed
72
</ng-template>