hide menu
This commit is contained in:
parent
024eb6bfc7
commit
169be42e81
File diff suppressed because it is too large
Load Diff
|
@ -10,11 +10,8 @@ import videojs from "video.js";
|
||||||
styleUrls: ["./surveillance.component.css"],
|
styleUrls: ["./surveillance.component.css"],
|
||||||
})
|
})
|
||||||
export class SurveillanceComponent {
|
export class SurveillanceComponent {
|
||||||
@ViewChild('videoPlayer', { static: false }) videoPlayer: ElementRef;
|
|
||||||
@ViewChild('videoIframe', { static: false }) videoIframe: ElementRef;
|
@ViewChild('videoIframe', { static: false }) videoIframe: ElementRef;
|
||||||
data: any;
|
|
||||||
totalOn: any;
|
|
||||||
totalOff: any;
|
|
||||||
filteredRows: any[];
|
filteredRows: any[];
|
||||||
searchTerm: string = "";
|
searchTerm: string = "";
|
||||||
buildingSelected: any;
|
buildingSelected: any;
|
||||||
|
@ -28,12 +25,6 @@ export class SurveillanceComponent {
|
||||||
switchState: boolean;
|
switchState: boolean;
|
||||||
|
|
||||||
public breadcrumb: any;
|
public breadcrumb: any;
|
||||||
spinnerActive: boolean = false;
|
|
||||||
|
|
||||||
singlebasicSelected: any;
|
|
||||||
|
|
||||||
mainPlayer: any;
|
|
||||||
videos = "";
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private router: Router,
|
private router: Router,
|
||||||
|
@ -77,8 +68,7 @@ export class SurveillanceComponent {
|
||||||
this.deviceService
|
this.deviceService
|
||||||
.getDeviceData(buildingSelected, categorySelected, statusSelected)
|
.getDeviceData(buildingSelected, categorySelected, statusSelected)
|
||||||
.subscribe((res) => {
|
.subscribe((res) => {
|
||||||
this.data = res;
|
this.filteredRows = res.results.data;
|
||||||
this.filteredRows = this.data.results.data;
|
|
||||||
console.log(this.filteredRows);
|
console.log(this.filteredRows);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -116,38 +106,6 @@ export class SurveillanceComponent {
|
||||||
}, 3000);
|
}, 3000);
|
||||||
}
|
}
|
||||||
|
|
||||||
filterRows() {
|
|
||||||
if (!this.searchTerm) {
|
|
||||||
this.filteredRows = [...this.data.results.data];
|
|
||||||
} else {
|
|
||||||
this.filteredRows = this.data.results.data.filter((row) =>
|
|
||||||
this.rowContainsSearchTerm(row)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rowContainsSearchTerm(row: any): boolean {
|
|
||||||
const searchTermLC = this.searchTerm.toLowerCase();
|
|
||||||
return Object.values(row).some(
|
|
||||||
(value) =>
|
|
||||||
value !== null && value.toString().toLowerCase().includes(searchTermLC)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
switchChanged(ev, data) {
|
|
||||||
console.log(ev);
|
|
||||||
console.log(data);
|
|
||||||
const requestData = {
|
|
||||||
device_id: data.device_id,
|
|
||||||
switch: data.mapping[0].switch,
|
|
||||||
value: ev,
|
|
||||||
command_type: "on_off",
|
|
||||||
};
|
|
||||||
this.deviceService.deviceSwitch(requestData).subscribe((res) => {
|
|
||||||
console.log(res);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
onClick(videoUrl: string) {
|
onClick(videoUrl: string) {
|
||||||
const iframe = this.videoIframe.nativeElement;
|
const iframe = this.videoIframe.nativeElement;
|
||||||
iframe.src = videoUrl;
|
iframe.src = videoUrl;
|
||||||
|
|
Loading…
Reference in New Issue