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;