1
|
<p-dialog [visible]="isVisible" [modal]="true" [closable]="false" [draggable]="false" header="Add unit!" [style]="{width: '70vw'}"
|
2
|
[baseZIndex]="10000" (onShow)="clearFormArray()">
|
3
|
|
4
|
<form [formGroup]="insertForm">
|
5
|
<div class="input-group form-group">
|
6
|
<div class="input-group-prepend">
|
7
|
<span class="input-group-text">Unit ID</span>
|
8
|
</div>
|
9
|
<input type="text" formControlName="unitId" class="form-control" id="unitId" placeholder="unitId"/>
|
10
|
</div>
|
11
|
<div class="input-group form-group">
|
12
|
<div class="input-group-prepend">
|
13
|
<span class="input-group-text">Description</span>
|
14
|
</div>
|
15
|
<input type="text" formControlName="unitDescription" class="form-control" id="unitDescription"
|
16
|
placeholder="unitDescription"/>
|
17
|
</div>
|
18
|
<hr>
|
19
|
<div class="input-group form-group">
|
20
|
<div formArrayName="sensors" *ngFor="let item of insertForm.get('sensors')['controls']; let i = index;">
|
21
|
<div [formGroupName]="i">
|
22
|
<div class="input-group form-group">
|
23
|
<div class="input-group-prepend">
|
24
|
<span class="input-group-text">Sensor ID</span>
|
25
|
</div>
|
26
|
<input type="text" formControlName="sensorId" class="form-control" id="sensorId" placeholder="sensorId"/>
|
27
|
</div>
|
28
|
<div class="input-group form-group">
|
29
|
<div class="input-group-prepend">
|
30
|
<span class="input-group-text">Sensor name</span>
|
31
|
</div>
|
32
|
<input type="text" formControlName="sensorName" class="form-control" id="sensorName"
|
33
|
placeholder="sensorName"/>
|
34
|
</div>
|
35
|
<div class="input-group form-group">
|
36
|
<div class="input-group-prepend">
|
37
|
<span class="input-group-text">Sensor type</span>
|
38
|
</div>
|
39
|
<input type="text" formControlName="sensorType" class="form-control" id="sensorType"
|
40
|
placeholder="sensorType"/>
|
41
|
</div>
|
42
|
<div class="input-group form-group">
|
43
|
<div class="input-group-prepend">
|
44
|
<span class="input-group-text">Sensor name</span>
|
45
|
</div>
|
46
|
<select formControlName="phenomenons" id="phenomenons">
|
47
|
<option *ngFor="let phenomenon of phenomenons; let i = index" [value]="phenomenons[i].phenomenonId">
|
48
|
{{phenomenons[i].phenomenonName}} ( {{ phenomenons[i].unit}})
|
49
|
</option>
|
50
|
</select>
|
51
|
</div>
|
52
|
</div>
|
53
|
<br>
|
54
|
</div>
|
55
|
</div>
|
56
|
</form>
|
57
|
|
58
|
|
59
|
<p-button type="button" (click)="addSensor()" class="pr-2">Add Sensor</p-button>
|
60
|
|
61
|
|
62
|
<p-footer>
|
63
|
<div class="row justify-content-end align-items-center">
|
64
|
<div>
|
65
|
<p-button icon="pi pi-check" (click)="processInsertion()" type="submit" label="Uložit" class="pr-2"></p-button>
|
66
|
<p-button icon="pi pi-times" (click)="close()" label="Zavřít" class="pr-2"></p-button>
|
67
|
</div>
|
68
|
</div>
|
69
|
</p-footer>
|
70
|
</p-dialog>
|