Enhancement: support breaking changes in wg-easy v15 (#5343)
Some checks failed
Docker CI / Linting Checks (push) Has been cancelled
Docker CI / Docker Build & Push (push) Has been cancelled
Crowdin Action / Crowdin Sync (push) Has been cancelled

This commit is contained in:
shamoon
2025-05-31 22:08:49 -07:00
committed by GitHub
parent 35be5559b3
commit 524cb7695c
5 changed files with 21 additions and 3 deletions

View File

@@ -6,7 +6,9 @@ import useWidgetAPI from "utils/proxy/use-widget-api";
export default function Component({ service }) {
const { widget } = service;
const { data: infoData, error: infoError } = useWidgetAPI(widget, "client");
const endpoint = widget.version === 2 ? "clientv2" : "client";
const { data: infoData, error: infoError } = useWidgetAPI(widget, endpoint);
if (!widget.fields) {
widget.fields = ["connected", "enabled", "total"];