X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2Fcomponents%2Fservices%2FPiHole.vue;h=237cb12973c6bcd4143356a524033a4a0995fc45;hb=d362add383b622c4b941e8bdd02b741393c65bd0;hp=9aac01670009e5c704ecfe743fe7fe32045c5fbb;hpb=dfde8ea89d02f59f5408585702c0f2cf3f94eac1;p=github%2Fbastienwirtz%2Fhomer.git diff --git a/src/components/services/PiHole.vue b/src/components/services/PiHole.vue index 9aac016..237cb12 100644 --- a/src/components/services/PiHole.vue +++ b/src/components/services/PiHole.vue @@ -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;