diff --git a/public/locales/en/common.json b/public/locales/en/common.json
index 44230b6e..de399a74 100644
--- a/public/locales/en/common.json
+++ b/public/locales/en/common.json
@@ -114,6 +114,12 @@
"blocked": "Blocked",
"gravity": "Gravity"
},
+ "adguard": {
+ "queries": "Queries",
+ "blocked": "Blocked",
+ "filtered": "Filtered",
+ "latency": "Latency"
+ },
"speedtest": {
"upload": "Upload",
"download": "Download",
diff --git a/src/components/services/widget.jsx b/src/components/services/widget.jsx
index e9c60a67..c0f6113c 100644
--- a/src/components/services/widget.jsx
+++ b/src/components/services/widget.jsx
@@ -25,6 +25,7 @@ import CoinMarketCap from "./widgets/service/coinmarketcap";
import Gotify from "./widgets/service/gotify";
import Prowlarr from "./widgets/service/prowlarr";
import Jackett from "./widgets/service/jackett";
+import AdGuard from "./widgets/service/adguard";
const widgetMappings = {
docker: Docker,
@@ -52,6 +53,7 @@ const widgetMappings = {
gotify: Gotify,
prowlarr: Prowlarr,
jackett: Jackett,
+ adguard: AdGuard,
};
export default function Widget({ service }) {
diff --git a/src/components/services/widgets/service/adguard.jsx b/src/components/services/widgets/service/adguard.jsx
new file mode 100644
index 00000000..c2eea2c4
--- /dev/null
+++ b/src/components/services/widgets/service/adguard.jsx
@@ -0,0 +1,45 @@
+import useSWR from "swr";
+import { useTranslation } from "react-i18next";
+
+import Widget from "../widget";
+import Block from "../block";
+
+import { formatApiUrl } from "utils/api-helpers";
+
+export default function AdGuard({ service }) {
+ const { t } = useTranslation();
+
+ const config = service.widget;
+
+ const { data: adguardData, error: adguardError } = useSWR(formatApiUrl(config, "stats"));
+
+ if (adguardError) {
+ return ;
+ }
+
+ if (!adguardData) {
+ return (
+
+
+
+
+
+
+ );
+ }
+
+ const filtered =
+ adguardData.num_replaced_safebrowsing + adguardData.num_replaced_safesearch + adguardData.num_replaced_parental;
+
+ return (
+
+
+
+
+
+
+ );
+}
diff --git a/src/pages/api/services/proxy.js b/src/pages/api/services/proxy.js
index c92fab4c..5cb1f678 100644
--- a/src/pages/api/services/proxy.js
+++ b/src/pages/api/services/proxy.js
@@ -20,6 +20,7 @@ const serviceProxyHandlers = {
traefik: genericProxyHandler,
sabnzbd: genericProxyHandler,
jackett: genericProxyHandler,
+ adguard: genericProxyHandler,
// uses X-API-Key (or similar) header auth
gotify: credentialedProxyHandler,
portainer: credentialedProxyHandler,
diff --git a/src/utils/api-helpers.js b/src/utils/api-helpers.js
index 0b18e652..cb284c67 100644
--- a/src/utils/api-helpers.js
+++ b/src/utils/api-helpers.js
@@ -21,7 +21,8 @@ const formats = {
coinmarketcap: `https://pro-api.coinmarketcap.com/{endpoint}`,
gotify: `{url}/{endpoint}`,
prowlarr: `{url}/api/v1/{endpoint}`,
- jackett: `{url}/api/v2.0/{endpoint}?apikey={key}&configured=true`
+ jackett: `{url}/api/v2.0/{endpoint}?apikey={key}&configured=true`,
+ adguard: `{url}/control/{endpoint}`,
};
export function formatApiCall(api, args) {