diff --git a/src/widgets/pihole/component.jsx b/src/widgets/pihole/component.jsx
index c9b036107..a36071a1b 100644
--- a/src/widgets/pihole/component.jsx
+++ b/src/widgets/pihole/component.jsx
@@ -15,6 +15,10 @@ export default function Component({ service }) {
return ;
}
+ if (!widget.fields) {
+ widget.fields = ["queries", "blocked", "gravity"];
+ }
+
if (!piholeData) {
return (
@@ -26,10 +30,15 @@ export default function Component({ service }) {
);
}
+ let blockedValue = `${t("common.number", { value: parseInt(piholeData.ads_blocked_today, 10) })}`;
+ if (!widget.fields.includes("blocked_percent")) {
+ blockedValue += ` (${t("common.percent", { value: parseFloat(piholeData.ads_percentage_today.toPrecision(3)) })})`;
+ }
+
return (
-
+