]> git.immae.eu Git - github/bastienwirtz/homer.git/blobdiff - src/components/services/PiHole.vue
Implement PiHole API token (#580)
[github/bastienwirtz/homer.git] / src / components / services / PiHole.vue
index 9aac01670009e5c704ecfe743fe7fe32045c5fbb..237cb12973c6bcd4143356a524033a4a0995fc45 100644 (file)
@@ -49,7 +49,11 @@ export default {
   },
   methods: {
     fetchStatus: async function () {
-      const result = await this.fetch("/api.php").catch((e) => console.log(e));
+      const authQueryParams = this.item.apikey
+        ? `?summaryRaw&auth=${this.item.apikey}`
+        : "";
+      const result = await this.fetch(`/api.php${authQueryParams}`)
+        .catch((e) => console.log(e));
 
       this.status = result.status;
       this.ads_percentage_today = result.ads_percentage_today;