mirror of
https://github.com/gethomepage/homepage.git
synced 2025-07-31 14:33:48 -04:00
Enhancement: Add port_forwarded field to Gluetun widget (#2262)
This commit is contained in:
parent
6c82883fa9
commit
d5f66e12fc
@ -9,7 +9,7 @@ Learn more about [Gluetun](https://github.com/qdm12/gluetun).
|
|||||||
|
|
||||||
Requires [HTTP control server options](https://github.com/qdm12/gluetun-wiki/blob/main/setup/advanced/control-server.md) to be enabled. By default this runs on port `8000`.
|
Requires [HTTP control server options](https://github.com/qdm12/gluetun-wiki/blob/main/setup/advanced/control-server.md) to be enabled. By default this runs on port `8000`.
|
||||||
|
|
||||||
Allowed fields: `["public_ip", "region", "country"]`.
|
Allowed fields: `["public_ip", "region", "country", "port_forwarded"]`.
|
||||||
|
|
||||||
To setup authentication, follow [the official Gluetun documentation](https://github.com/qdm12/gluetun-wiki/blob/main/setup/advanced/control-server.md#authentication). Note that to use the api key method, you must add the route `GET /v1/publicip/ip` to the `routes` array in your Gluetun config.toml.
|
To setup authentication, follow [the official Gluetun documentation](https://github.com/qdm12/gluetun-wiki/blob/main/setup/advanced/control-server.md#authentication). Note that to use the api key method, you must add the route `GET /v1/publicip/ip` to the `routes` array in your Gluetun config.toml.
|
||||||
|
|
||||||
|
@ -568,7 +568,8 @@
|
|||||||
"gluetun": {
|
"gluetun": {
|
||||||
"public_ip": "Public IP",
|
"public_ip": "Public IP",
|
||||||
"region": "Region",
|
"region": "Region",
|
||||||
"country": "Country"
|
"country": "Country",
|
||||||
|
"port_forwarded": "Port Forwarded"
|
||||||
},
|
},
|
||||||
"hdhomerun": {
|
"hdhomerun": {
|
||||||
"channels": "Channels",
|
"channels": "Channels",
|
||||||
|
@ -7,17 +7,19 @@ export default function Component({ service }) {
|
|||||||
const { widget } = service;
|
const { widget } = service;
|
||||||
|
|
||||||
const { data: gluetunData, error: gluetunError } = useWidgetAPI(widget, "ip");
|
const { data: gluetunData, error: gluetunError } = useWidgetAPI(widget, "ip");
|
||||||
|
const { data: portForwardedData, error: portForwardedError } = useWidgetAPI(widget, "port_forwarded");
|
||||||
|
|
||||||
if (gluetunError) {
|
if (gluetunError || portForwardedError) {
|
||||||
return <Container service={service} error={gluetunError} />;
|
return <Container service={service} error={gluetunError || portForwardedError} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gluetunData) {
|
if (!gluetunData || !portForwardedData) {
|
||||||
return (
|
return (
|
||||||
<Container service={service}>
|
<Container service={service}>
|
||||||
<Block label="gluetun.public_ip" />
|
<Block label="gluetun.public_ip" />
|
||||||
<Block label="gluetun.region" />
|
<Block label="gluetun.region" />
|
||||||
<Block label="gluetun.country" />
|
<Block label="gluetun.country" />
|
||||||
|
<Block label="gluetun.port_forwarded" />
|
||||||
</Container>
|
</Container>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -27,6 +29,7 @@ export default function Component({ service }) {
|
|||||||
<Block label="gluetun.public_ip" value={gluetunData.public_ip} />
|
<Block label="gluetun.public_ip" value={gluetunData.public_ip} />
|
||||||
<Block label="gluetun.region" value={gluetunData.region} />
|
<Block label="gluetun.region" value={gluetunData.region} />
|
||||||
<Block label="gluetun.country" value={gluetunData.country} />
|
<Block label="gluetun.country" value={gluetunData.country} />
|
||||||
|
<Block label="gluetun.port_forwarded" value={portForwardedData.port} />
|
||||||
</Container>
|
</Container>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,10 @@ const widget = {
|
|||||||
endpoint: "publicip/ip",
|
endpoint: "publicip/ip",
|
||||||
validate: ["public_ip", "country"],
|
validate: ["public_ip", "country"],
|
||||||
},
|
},
|
||||||
|
port_forwarded: {
|
||||||
|
endpoint: "openvpn/portforwarded",
|
||||||
|
validate: ["port"],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user