mirror of
https://github.com/gethomepage/homepage.git
synced 2026-01-10 10:32:09 +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"];
|
||||
|
||||
@@ -8,6 +8,9 @@ const widget = {
|
||||
client: {
|
||||
endpoint: "wireguard/client",
|
||||
},
|
||||
clientv2: {
|
||||
endpoint: "client",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user