From ccc27142ef0c5fa197638e26e6e4685d78ddbf4e Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Tue, 4 Jun 2024 00:05:06 -0700 Subject: [PATCH] Fix: caddy widget broken in 0.9.1 (#3579) --- src/widgets/caddy/component.jsx | 2 +- src/widgets/caddy/widget.js | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/widgets/caddy/component.jsx b/src/widgets/caddy/component.jsx index adeca2371..36e5f959a 100644 --- a/src/widgets/caddy/component.jsx +++ b/src/widgets/caddy/component.jsx @@ -8,7 +8,7 @@ export default function Component({ service }) { const { t } = useTranslation(); const { widget } = service; - const { data: resultData, error: resultError } = useWidgetAPI(widget, "result"); + const { data: resultData, error: resultError } = useWidgetAPI(widget, "upstreams"); if (resultError) { return ; diff --git a/src/widgets/caddy/widget.js b/src/widgets/caddy/widget.js index 2fb1978bc..7e1dc6ba4 100644 --- a/src/widgets/caddy/widget.js +++ b/src/widgets/caddy/widget.js @@ -1,8 +1,14 @@ import genericProxyHandler from "utils/proxy/handlers/generic"; const widget = { - api: "{url}/reverse_proxy/upstreams", + api: "{url}/{endpoint}", proxyHandler: genericProxyHandler, + + mappings: { + upstreams: { + endpoint: "reverse_proxy/upstreams", + }, + }, }; export default widget;