mirror of
https://github.com/gethomepage/homepage.git
synced 2026-01-09 18:02:08 +08:00
Enhancement: support breaking changes in wg-easy v15 (#5343)
This commit is contained in:
@@ -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"];
|
||||
|
||||
Reference in New Issue
Block a user