From a9429e5335bb450c3ee1ad2f0dd2575d8d28c6b7 Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 22 Dec 2022 09:27:13 -0800 Subject: [PATCH] Pihole allow auth, updated API endpoint --- src/widgets/pihole/component.jsx | 8 ++++---- src/widgets/pihole/widget.js | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/widgets/pihole/component.jsx b/src/widgets/pihole/component.jsx index f213ac6db..c39250d23 100644 --- a/src/widgets/pihole/component.jsx +++ b/src/widgets/pihole/component.jsx @@ -9,7 +9,7 @@ export default function Component({ service }) { const { widget } = service; - const { data: piholeData, error: piholeError } = useWidgetAPI(widget, "api.php"); + const { data: piholeData, error: piholeError } = useWidgetAPI(widget, "summaryRaw"); if (piholeError) { return ; @@ -27,9 +27,9 @@ export default function Component({ service }) { return ( - - - + + + ); } diff --git a/src/widgets/pihole/widget.js b/src/widgets/pihole/widget.js index b392cdede..e75938101 100644 --- a/src/widgets/pihole/widget.js +++ b/src/widgets/pihole/widget.js @@ -1,12 +1,12 @@ import genericProxyHandler from "utils/proxy/handlers/generic"; const widget = { - api: "{url}/admin/{endpoint}", + api: "{url}/admin/api.php?{endpoint}&auth={key}", proxyHandler: genericProxyHandler, mappings: { - "api.php": { - endpoint: "api.php", + "summaryRaw": { + endpoint: "summaryRaw", validate: [ "dns_queries_today", "ads_blocked_today",