perbaikan style monitoring building

This commit is contained in:
2024-04-25 13:27:22 +07:00
parent fcc9a97d99
commit 3cd43f3cc5
3 changed files with 74 additions and 16 deletions

View File

@@ -90,15 +90,17 @@
class="col-xl-6 col-md-6 col-12"
*ngFor="let top of dataTop; let i = index"
>
<span class="mb-1 text-muted cardtext d-block"
>{{ top.value[i] }}% - {{ top.label[i] }}</span
>
<div>
<ngb-progressbar
height="7px"
type="danger"
[value]="top.value[i]"
></ngb-progressbar>
<span class="mb-1 text-muted cardtext d-block"
>{{ top.value[i] }}% - {{ top.label[i] }}</span
>
<div>
<ngb-progressbar
height="7px"
type="danger"
[value]="top.value[i]"
></ngb-progressbar>
</div>
</div>
</div>
</div>

View File

@@ -46,13 +46,18 @@ export class BuildingComponent {
fetchData() {
this.monitoringService.getMonitoringBuildingData().subscribe((res) => {
this.data = res
this.filteredRows = res
this.dataTop = res.map(item => ({
label: item.topUse.label,
value: item.topUse.value
}));
this.data = res;
this.filteredRows = res;
this.dataTop = [];
for (let i = 0; i < res.length; i++) {
if (res[i].topUse.label[i]) {
this.dataTop.push({
label: res[i].topUse.label,
value: res[i].topUse.value,
});
}
}
});
}
@@ -73,5 +78,4 @@ export class BuildingComponent {
value !== null && value.toString().toLowerCase().includes(searchTermLC)
);
}
}