validasi add new master

This commit is contained in:
2024-07-01 11:49:04 +07:00
parent 04e8abc487
commit 5afb289070
7 changed files with 126 additions and 72 deletions

View File

@@ -100,7 +100,7 @@
</section>
<section id="configuration">
<div class="row">
<div class="col-lg-4 col-12" *ngFor="let item of filteredRows">
<div class="col-lg-4 col-12" *ngFor="let item of filteredDeviceRows">
<div
class="card"
style="background-color: #252525; position: relative"

View File

@@ -12,6 +12,7 @@ import { ToastrService } from 'ngx-toastr';
export class ControlDeviceSeemoreComponent {
data: any;
filteredRows: any[];
filteredDeviceRows: any[];
searchTerm: string = "";
buildingSelected: any;
statusSelected: any;
@@ -78,9 +79,18 @@ export class ControlDeviceSeemoreComponent {
.subscribe((res) => {
this.data = res;
this.filteredRows = this.data.results.data;
this.filteredDeviceRows = this.filterDevices(this.filteredRows);
});
}
filterDevices(devices: any[]): any[] {
return devices.filter((device) =>
device.mapping.some(
(map) => map.name.startsWith("switch") && map.type === "Boolean"
)
);
}
dataListMaster() {
this.monitoringApiService.getMasterListData().subscribe((data) => {
const dataCategory = data.data.find(