Compare commits
	
		
			No commits in common. "6a9451c2b5ffdc477c9ea14f26885a8191a5aedb" and "ded0ca21a1fdfd4ba83f41730c051686917b5d9f" have entirely different histories.
		
	
	
		
			6a9451c2b5
			...
			ded0ca21a1
		
	
		
| @ -111,10 +111,10 @@ | |||||||
|                     type="button" |                     type="button" | ||||||
|                     class="btn btn-float btn-square btn-outline-secondary" |                     class="btn btn-float btn-square btn-outline-secondary" | ||||||
|                     triggers="hover:click:hover" |                     triggers="hover:click:hover" | ||||||
|                     ngbTooltip="CCTV" |                     ngbTooltip="Edit" | ||||||
|                     (click)="editRow(data)" |                     (click)="editRow(data)" | ||||||
|                   > |                   > | ||||||
|                     <i class="feather ft-camera"></i> |                     <i class="feather ft-edit"></i> | ||||||
|                   </button> |                   </button> | ||||||
| 
 | 
 | ||||||
|                   <button |                   <button | ||||||
|  | |||||||
| @ -91,6 +91,7 @@ export class BuildingComponent { | |||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   viewRoom(row) { |   viewRoom(row) { | ||||||
|  |     console.log(row); | ||||||
|     this.router.navigate(["/monitoring/monitoring-room", row.id]); |     this.router.navigate(["/monitoring/monitoring-room", row.id]); | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  | |||||||
| @ -11,11 +11,11 @@ | |||||||
|               <div class="card-body"> |               <div class="card-body"> | ||||||
|                 <div class="media d-flex"> |                 <div class="media d-flex"> | ||||||
|                   <div class="media-body text-left"> |                   <div class="media-body text-left"> | ||||||
|                     <h3 class="danger">278 Kwh</h3> |                     <h3 class="danger">278</h3> | ||||||
|                     <span>Electricity</span> |                     <span>New Projects</span> | ||||||
|                   </div> |                   </div> | ||||||
|                   <div class="align-self-center"> |                   <div class="align-self-center"> | ||||||
|                     <i class="icon-energy danger font-large-2 float-right"></i> |                     <i class="icon-rocket danger font-large-2 float-right"></i> | ||||||
|                   </div> |                   </div> | ||||||
|                 </div> |                 </div> | ||||||
|               </div> |               </div> | ||||||
| @ -29,10 +29,10 @@ | |||||||
|                 <div class="media d-flex"> |                 <div class="media d-flex"> | ||||||
|                   <div class="media-body text-left"> |                   <div class="media-body text-left"> | ||||||
|                     <h3 class="success">156</h3> |                     <h3 class="success">156</h3> | ||||||
|                     <span>Water</span> |                     <span>New Clients</span> | ||||||
|                   </div> |                   </div> | ||||||
|                   <div class="align-self-center"> |                   <div class="align-self-center"> | ||||||
|                     <i class="icon-speedometer success font-large-2 float-right"></i> |                     <i class="icon-user success font-large-2 float-right"></i> | ||||||
|                   </div> |                   </div> | ||||||
|                 </div> |                 </div> | ||||||
|               </div> |               </div> | ||||||
| @ -45,11 +45,11 @@ | |||||||
|               <div class="card-body"> |               <div class="card-body"> | ||||||
|                 <div class="media d-flex"> |                 <div class="media d-flex"> | ||||||
|                   <div class="media-body text-left"> |                   <div class="media-body text-left"> | ||||||
|                     <h3 class="warning">{{device}}</h3> |                     <h3 class="warning">64.89 %</h3> | ||||||
|                     <span>Device</span> |                     <span>Conversion Rate</span> | ||||||
|                   </div> |                   </div> | ||||||
|                   <div class="align-self-center"> |                   <div class="align-self-center"> | ||||||
|                     <i class="icon-bulb warning font-large-2 float-right"></i> |                     <i class="icon-pie-chart warning font-large-2 float-right"></i> | ||||||
|                   </div> |                   </div> | ||||||
|                 </div> |                 </div> | ||||||
|               </div> |               </div> | ||||||
| @ -62,11 +62,11 @@ | |||||||
|               <div class="card-body"> |               <div class="card-body"> | ||||||
|                 <div class="media d-flex"> |                 <div class="media d-flex"> | ||||||
|                   <div class="media-body text-left"> |                   <div class="media-body text-left"> | ||||||
|                     <h3 class="info">{{room}}</h3> |                     <h3 class="info">423</h3> | ||||||
|                     <span>Room</span> |                     <span>Support Tickets</span> | ||||||
|                   </div> |                   </div> | ||||||
|                   <div class="align-self-center"> |                   <div class="align-self-center"> | ||||||
|                     <i class="icon-map info font-large-2 float-right"></i> |                     <i class="icon-support info font-large-2 float-right"></i> | ||||||
|                   </div> |                   </div> | ||||||
|                 </div> |                 </div> | ||||||
|               </div> |               </div> | ||||||
|  | |||||||
| @ -2,7 +2,6 @@ import { Component } from "@angular/core"; | |||||||
| import { ActivatedRoute, Router } from "@angular/router"; | import { ActivatedRoute, Router } from "@angular/router"; | ||||||
| import { BlockUI, NgBlockUI } from "ng-block-ui"; | import { BlockUI, NgBlockUI } from "ng-block-ui"; | ||||||
| import { ChartApiService } from "src/app/_services/chart.api"; | import { ChartApiService } from "src/app/_services/chart.api"; | ||||||
| import { BuildingService } from "../../service/monitoring-api.service"; |  | ||||||
| interface Sales { | interface Sales { | ||||||
|   name: string; |   name: string; | ||||||
|   sales: string; |   sales: string; | ||||||
| @ -25,17 +24,10 @@ export class DetailComponent { | |||||||
|   ExpenseschartOption: any; |   ExpenseschartOption: any; | ||||||
|   donutChart2: any; |   donutChart2: any; | ||||||
|   public breadcrumb: any; |   public breadcrumb: any; | ||||||
|   // integrasi
 |  | ||||||
|   electric: any; |  | ||||||
|   water: any; |  | ||||||
|   device: any; |  | ||||||
|   room: any; |  | ||||||
|   //......
 |  | ||||||
|   constructor( |   constructor( | ||||||
|     private chartApiservice: ChartApiService, |     private chartApiservice: ChartApiService, | ||||||
|     private router: Router, |     private router: Router, | ||||||
|     private route: ActivatedRoute, |     private route: ActivatedRoute | ||||||
|     private monitoringApiService: BuildingService, |  | ||||||
|   ) {} |   ) {} | ||||||
|   hitRateOptions = { |   hitRateOptions = { | ||||||
|     bodyClass: ['bg-hexagons', 'pt-0'], |     bodyClass: ['bg-hexagons', 'pt-0'], | ||||||
| @ -96,14 +88,6 @@ export class DetailComponent { | |||||||
|       }; |       }; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     this.route.params.subscribe(params => { |  | ||||||
|       const buildingId = params['id']; |  | ||||||
|       if (buildingId) { |  | ||||||
|         this.fetchData(buildingId); |  | ||||||
|         this.devicePerBuilding(buildingId); |  | ||||||
|       } |  | ||||||
|     }); |  | ||||||
| 
 |  | ||||||
|     this.chartApiservice.getStatisticsData().subscribe(Response => { |     this.chartApiservice.getStatisticsData().subscribe(Response => { | ||||||
|       this.salesData = Response; |       this.salesData = Response; | ||||||
|       this.getlineArea(); |       this.getlineArea(); | ||||||
| @ -298,17 +282,4 @@ export class DetailComponent { | |||||||
|       this.blockUISalesRecieptsDues.stop(); |       this.blockUISalesRecieptsDues.stop(); | ||||||
|     }, 2500); |     }, 2500); | ||||||
|   } |   } | ||||||
| 
 |  | ||||||
|   //integrasi
 |  | ||||||
|   fetchData(buildingId) { |  | ||||||
|     this.monitoringApiService.getRoomByBuildingId(buildingId).subscribe((res) => { |  | ||||||
|       this.room = res.resp.map(entry => entry.roomEntity).length; |  | ||||||
|     }); |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   devicePerBuilding(buildingId) { |  | ||||||
|     this.monitoringApiService.listDevicePerBuilding(buildingId).subscribe((res) => { |  | ||||||
|       this.device = res.resp.reduce((sum, item) => sum + item.total_device, 0); |  | ||||||
|     }); |  | ||||||
|   } |  | ||||||
| } | } | ||||||
|  | |||||||
| @ -30,6 +30,7 @@ export class RoomComponent implements OnInit { | |||||||
|     }); |     }); | ||||||
|     this.route.params.subscribe(params => { |     this.route.params.subscribe(params => { | ||||||
|       const buildingId = params['id']; |       const buildingId = params['id']; | ||||||
|  |       console.log(buildingId); | ||||||
|       if (buildingId) { |       if (buildingId) { | ||||||
|         this.fetchData(buildingId); |         this.fetchData(buildingId); | ||||||
|       } |       } | ||||||
|  | |||||||
| @ -26,15 +26,6 @@ export class BuildingService { | |||||||
|     return this.http.get<any>(url, { headers }); |     return this.http.get<any>(url, { headers }); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   listDevicePerBuilding(id): Observable<any> { |  | ||||||
|     const url = `https://kapi.absys.ninja/hemat/devices/aggregate/on?building_id=${id}`; |  | ||||||
|     const headers = new HttpHeaders({ |  | ||||||
|       'Content-Type': 'application/json', |  | ||||||
|       'x-api-key': 'j2yaYvPSQcsEEmHh3NEobfiXyyXmmnHT' |  | ||||||
|     }); |  | ||||||
|     return this.http.get<any>(url, { headers }); |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   getBuildingData(page: number = 1, limit: number = 10): Observable<any> { |   getBuildingData(page: number = 1, limit: number = 10): Observable<any> { | ||||||
|     const url = `https://kapi.absys.ninja/hemat/building?page=${page}&limit=${limit}`; |     const url = `https://kapi.absys.ninja/hemat/building?page=${page}&limit=${limit}`; | ||||||
|     // const headers = new HttpHeaders().set('Content-Type', 'application/json');
 |     // const headers = new HttpHeaders().set('Content-Type', 'application/json');
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user