validasi add new master
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user