1
|
<app-nav-bar (emitNewUnit)="addUnit($event)" [sensorTypes]="sensorTypes"></app-nav-bar>
|
2
|
|
3
|
<div class="container dashboard">
|
4
|
<p-accordion>
|
5
|
<p-accordionTab *ngFor="let unit of units">
|
6
|
<p-header [className]="'dashboard-unit-wrapper'">
|
7
|
<div [className]="'row dashboard-unit'">
|
8
|
<div class="col-md-6"><h3>{{ unit.unit.description}}</h3></div>
|
9
|
<div class="col-md-6 text-right">
|
10
|
<p-button label="Sensors graph" icon="pi pi-chart-line" [routerLink]="['/dashboard/unit', unit.unit.unitId]"></p-button>
|
11
|
<div class="dashboard-button-separator"></div>
|
12
|
<p-button label="Add sensor" icon="pi pi-plus-circle" styleClass="p-button-success" (onClick)="insertSensorPopup($event, unit.unit)"></p-button>
|
13
|
<p-splitButton *ngIf="loggedUser?.userInfo?.rightsId == 0 || loggedUser?.userInfo?.rightsId == 1" (onClick)="showItems($event, unit.unit)"
|
14
|
icon="pi pi-cog" (onDropdownClick)="showItems($event, unit.unit)" [model]="items" styleClass="p-button-warning"></p-splitButton>
|
15
|
</div>
|
16
|
</div>
|
17
|
</p-header>
|
18
|
<div>
|
19
|
<ng-container *ngFor="let sensor of unit.sensors">
|
20
|
<app-sensors *ngIf="sensor" [sensor]="sensor" [unitId]="unit.unit.unitId" [phenomenons]="phenomenons" [loggedUser]="loggedUser" (emitSensorDeletion)="deleteSensor(unit.unit.unitId, $event)" [sensorTypes]="sensorTypes"></app-sensors>
|
21
|
</ng-container>
|
22
|
</div>
|
23
|
</p-accordionTab>
|
24
|
</p-accordion>
|
25
|
</div>
|
26
|
|
27
|
<app-unit-popup *ngIf="showEditUnitPopup" [(isVisible)]="showEditUnitPopup" [unit]="editedUnit"></app-unit-popup>
|
28
|
<app-sensor-insert-popup *ngIf="showInsertSensorPopup" [unit]="editedUnit" [(isVisible)]="showInsertSensorPopup" [phenomenons]="phenomenons" [sensorTypes]="sensorTypes" (emitNewSensor)="addSensors($event)"></app-sensor-insert-popup>
|
29
|
<app-position-insert-popup *ngIf="showInsertPositionPopup" [unitId]="editedUnit.unitId" [(isVisible)]="showInsertPositionPopup"></app-position-insert-popup>
|
30
|
|
31
|
|
32
|
<p-confirmDialog [style]="{width: '50vw'}" key="positionDialog" [position]="position" [baseZIndex]="10000" rejectButtonStyleClass="p-button-outlined"></p-confirmDialog>
|