mirror of
https://github.com/gethomepage/homepage.git
synced 2026-04-06 02:01:22 -07:00
Enhancement: support netalertx v26.1.17 breaking changes (#6196)
This commit is contained in:
@@ -9,7 +9,9 @@ export default function Component({ service }) {
|
||||
|
||||
const { widget } = service;
|
||||
|
||||
const { data: netalertxData, error: netalertxError } = useWidgetAPI(widget, "data");
|
||||
const dataEndpoint = widget?.version > 1 ? "datav2" : "data";
|
||||
|
||||
const { data: netalertxData, error: netalertxError } = useWidgetAPI(widget, dataEndpoint);
|
||||
|
||||
if (netalertxError) {
|
||||
return <Container service={service} error={netalertxError} />;
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
import credentialedProxyHandler from "utils/proxy/handlers/credentialed";
|
||||
|
||||
const widget = {
|
||||
api: "{url}/php/server/devices.php?action=getDevicesTotals",
|
||||
api: "{url}/{endpoint}",
|
||||
proxyHandler: credentialedProxyHandler,
|
||||
|
||||
mappings: {
|
||||
data: {
|
||||
endpoint: "data",
|
||||
endpoint: "php/server/devices.php?action=getDevicesTotals",
|
||||
},
|
||||
datav2: {
|
||||
endpoint: "devices/totals",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user