Oscar Alfredo Leiva Salomón 6 éve
szülő
commit
ac34fa0b0d

+ 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>

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

@@ -184,11 +184,11 @@ 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) {

+ 1 - 1
src/app/components/plugins/weather-card/weather-card.component.html

@@ -13,7 +13,7 @@
     </div>
     <div class="col-lg-5 col-md-6 col-xs-12">
       <div class="temp">
-         <img src="assets/img/{{icon}}.png" alt="" width="60">
+         <img src="assets/img/{{icon}}.png" alt="" width="60" *ngIf="icon_exists">
          <span>{{temp}}°</span>
       </div>
     </div>

+ 2 - 0
src/app/components/plugins/weather-card/weather-card.component.ts

@@ -25,6 +25,7 @@ export class WeatherCardComponent implements OnInit {
   cityName: string;
   cityAdded = false;
   icon: string;
+  icon_exists: boolean;
   pipe = new DatePipe('es-ES')
   newDate = Date.now();
   currentDate = this.pipe.transform(this.newDate, 'fullDate')
@@ -40,6 +41,7 @@ export class WeatherCardComponent implements OnInit {
         this.cityName = payload.name
         this.state = payload.weather[0].description;
         this.temp = Math.ceil(payload.main.temp);
+        this.icon_exists = true;
         this.icon = payload.weather[0].icon;
       }, (err) => {
         this.errorMessage = err.error.message;

+ 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>