Oscar José Nuñez Chávez 6 年 前
コミット
4a628e2852

+ 10 - 10
src/app/components/dashboard/dashboard.component.html

@@ -11,7 +11,7 @@
             <h4 class="font-weight-normal mb-3">Total de plantas instaladas
               <i class="mdi mdi-chart-line mdi-24px float-right"></i>
             </h4>
-            <h2 class="mb-3">{{listData.length}}</h2>
+            <h2 class="mb-3" *ngIf="listData">{{listData.length}}</h2>
           </div>
         </div>
       </div>
@@ -26,10 +26,10 @@
           </div>
         </div>
       </div>
-  
-  
+
+
     </div>
-    
+
     <div class="row ">
       <div *ngIf="error; then showAlert"></div>
       <ng-template #showAlert>
@@ -52,7 +52,7 @@
               (leafletMapReady)='onMapReady($event)'>
             </div>
           </div>
-        </div> 
+        </div>
       </div>
       <div class="col-md-4">
 
@@ -60,22 +60,22 @@
             <div class= 'card border-success' style="height: 390px;">
               <div class="card-body">
                 <h3><i class="fa fa-bolt"></i> {{selectedPlant.name}} </h3>
-                
+
                 <p class='h4'>País: {{selectedPlant.country}}</p>
                 <p class='h4'>Ciudad: {{selectedPlant.city}}</p>
                 <p class='h4'>Dirección: {{selectedPlant.address}}</p>
                 <p class='h4'>Capacidad Instalada: {{selectedPlant.installedCapacity_kW}} kW</p>
-                
+
                 <button class="btn bg-yellow btn-flat" (click)="goToAsset(selectedPlant.id)">Ir a Planta</button>
               </div>
-                  
+
             </div>
           </div>
-            
+
       </div>
     </div>
     <br>
-      
+
 
   </div>
   <br>

+ 17 - 17
src/app/components/dashboard/dashboard.component.ts

@@ -53,7 +53,7 @@ export class DashboardComponent implements OnInit {
     'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
     { maxZoom: 18,
       attribution: '&copy; OpenStreetMap contributors'
-    } 
+    }
   );
 
   // Values to bind to Leaflet Directive
@@ -62,11 +62,11 @@ export class DashboardComponent implements OnInit {
     zoom: 10,
     center: latLng([13.661714, -89.251530])
   };
-  
+
   constructor(
-    private plantsService: PlantsService, 
-    private route: ActivatedRoute, 
-    private orgService: OrganizationsService, 
+    private plantsService: PlantsService,
+    private route: ActivatedRoute,
+    private orgService: OrganizationsService,
     private router: Router,
     private zone: NgZone) {
 
@@ -97,12 +97,12 @@ export class DashboardComponent implements OnInit {
     else {
       this.totalMetersInstalled = localStorage.getItem("installedCapacityTotal_kW");
     }
-    
+
   }
 
 
   ngOnInit(): void {
-    
+
     var responsiveOptions: any[] = [
       ['screen and (max-width: 640px)', {
         seriesBarDistance: 5,
@@ -113,13 +113,13 @@ export class DashboardComponent implements OnInit {
         }
       }]
     ];
-    
+
     setTimeout(()=>{
 
       if (this.listData != undefined){
         this.addMarkers();
       }
-  
+
       Swal.close();
     }, 2500);
 
@@ -129,7 +129,7 @@ export class DashboardComponent implements OnInit {
     return observableOf(this.listData.find(e => e.id === id));
   }
 
-  
+
   addMarkers() {
     let lat, long, address, name2;
 
@@ -146,7 +146,7 @@ export class DashboardComponent implements OnInit {
         address = plant.address;
         name2 = plant.name;
       }
-      
+
       const newMarker = marker(
         [lat, long],
         {icon: this.icon})
@@ -183,15 +183,15 @@ export class DashboardComponent implements OnInit {
     }, 0);
 
     const bounds = latLngBounds(this.points);
-    map.fitBounds(bounds, {
-      padding: point(24, 24),
-      maxZoom: 9.5,
-      animate: true
-    });
+    //map.fitBounds(bounds, {
+    //  padding: point(24, 24),
+    //  maxZoom: 9.5,
+    //  animate: true
+    //});
   }
 
   goToAsset(id: string){
-    this.router.navigate(['/assets'], { queryParams: { id: id } }); 
+    this.router.navigate(['/assets'], { queryParams: { id: id } });
   }
 
 

+ 2 - 1
src/app/layouts/admin/admin.component.html

@@ -7,6 +7,7 @@
         <app-navbar></app-navbar>
         <router-outlet></router-outlet>
     </div>
+    <!--
     <div class="fixed-plugin">
         <div class="dropdown show-dropdown">
             <a href="#" data-toggle="dropdown" aria-expanded="true">
@@ -49,5 +50,5 @@
                 </li>
             </ul>
         </div>
-    </div>
+    </div> -->
 </div>

+ 1 - 1
src/environments/environment.ts

@@ -4,7 +4,7 @@
 
 export const environment = {
     production: false,
-    apiUrl: 'http://192.168.98.140:8000',
+    apiUrl: 'https://192.168.98.140:8000',
     appID: '55899b9ea53834f2736b65a3582b734b',
     gKey: '',
     config: {