Explorar el Código

Merge pull request #2036 from phyzical/feature/fix-invalid-pihole-error-handling

Fix pihole widget
causefx hace 2 meses
padre
commit
fef3eeddd3
Se han modificado 2 ficheros con 9 adiciones y 8 borrados
  1. 1 0
      api/homepage/pihole.php
  2. 8 8
      js/functions.js

+ 1 - 0
api/homepage/pihole.php

@@ -204,6 +204,7 @@ trait PiHoleHomepageItem
 		} catch (Requests_Exception $e) {
 				$this->setResponse(500, $e->getMessage());
 				$this->setLoggerChannel('PiHole')->error($e);
+				throw $e;
 			};
 		return $processedResponse ?? [];
 	}

+ 8 - 8
js/functions.js

@@ -8026,18 +8026,18 @@ function buildPiholeItem(array){
                 value = e['domains_being_blocked'].map(function (x) {
                     return `<li>${x.toString()}</li>`;
                 }).join("");
+                card += `<ul class="multi-column" data-toggle="tooltip" title="` + key + `">` + value + `</ul>`;
             }
-            card += `<ul class="multi-column" data-toggle="tooltip" title="` + key + `">` + value + `</ul>`;
-	        }
-            card += `
-                        </div>
-                        <i class="fa fa-list inline-block" aria-hidden="true"></i>
+        }
+        card += `
                     </div>
+                    <i class="fa fa-list inline-block" aria-hidden="true"></i>
                 </div>
             </div>
-            `
-            return card;
-        }
+        </div>
+        `
+        return card;
+    }
 
     if(combine) {
         stats += '<div class="row">'