Add port_forwarded field to Gluetun widget
This commit is contained in:
parent
5512d05f00
commit
4999c92f8e
@ -5,7 +5,7 @@ description: Gluetun Widget Configuration
|
|||||||
|
|
||||||
Requires [HTTP control server options](https://github.com/qdm12/gluetun-wiki/blob/main/setup/advanced/control-server.md) to be enabled.
|
Requires [HTTP control server options](https://github.com/qdm12/gluetun-wiki/blob/main/setup/advanced/control-server.md) to be enabled.
|
||||||
|
|
||||||
Allowed fields: `["public_ip", "region", "country"]`.
|
Allowed fields: `["public_ip", "region", "country", "port_forwarded"]`.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
widget:
|
widget:
|
||||||
|
|||||||
@ -511,7 +511,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",
|
||||||
|
|||||||
@ -6,17 +6,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>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -26,6 +28,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", "region", "country"],
|
validate: ["public_ip", "region", "country"],
|
||||||
},
|
},
|
||||||
|
port_forwarded: {
|
||||||
|
endpoint: "openvpn/portforwarded",
|
||||||
|
validate: ["port"],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user