Skip to content

Commit 535b54c

Browse files
local proxy warning (#2315)
Co-authored-by: pablomendezroyo <41727368+pablomendezroyo@users.noreply.github.com>
1 parent ba6ae2c commit 535b54c

File tree

1 file changed

+39
-27
lines changed

1 file changed

+39
-27
lines changed

packages/admin-ui/src/pages/wifi/components/localProxying/LocalProxying.tsx

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import Alert from "react-bootstrap/esm/Alert";
2121
import { LocalProxyingStatus } from "@dappnode/types";
2222
import { useNavigate } from "react-router-dom";
2323
import LinkDocs from "components/LinkDocs";
24+
import { AlertDismissible } from "components/AlertDismissible";
2425

2526
export function LocalProxying() {
2627
const navigate = useNavigate();
@@ -38,7 +39,7 @@ export function LocalProxying() {
3839
await new Promise<void>((resolve) => {
3940
confirm({
4041
title: `Stopping Local Network Proxy`,
41-
text: `Warning, if you are connected to your DAppNode through Local Network Proxy you may lose access to your DAppNode. Make sure to have an alternative way to connect to it, like WiFi or a VPN connection.`,
42+
text: `Warning, if you are connected to your Dappnode through Local Network Proxy you may lose access to your Dappnode. Make sure to have an alternative way to connect to it, like WiFi or a VPN connection.`,
4243
label: "Pause",
4344
onClick: resolve
4445
});
@@ -73,37 +74,48 @@ export function LocalProxying() {
7374
return (
7475
<>
7576
{localProxyingStatus.data ? (
76-
<Card spacing>
77-
<p>
78-
If you are connected to the same router as your DAppNode you can use this page at{" "}
79-
<a href={adminUiLocalDomain}>{adminUiLocalDomain}</a>. Learn more about the Local Network Proxy at:{" "}
80-
<LinkDocs href={docsUrl.connectLocalProxy}>How to connect to DAppNode Local Network Proxy</LinkDocs>
81-
</p>
82-
{dappnodeIdentity.internalIp === dappnodeIdentity.ip && (
77+
<>
78+
{window.location.origin !== adminUiLocalDomain && (
79+
<AlertDismissible variant="warning">
80+
<p>
81+
Note that connecting via local proxy is less reliable than using a VPN or Wi-fi hotspot. The local proxy
82+
only provides access to the Dappmanager UI and does not grant access to other domains served through
83+
your Dappnode, such as client interfaces or other package UIs.
84+
</p>
85+
</AlertDismissible>
86+
)}
87+
<Card spacing>
8388
<p>
84-
Local and public IPs are equal. This may be due to dappnode is running on a remote machine and does not
85-
require Local Network Proxy.
89+
If you are connected to the same router as your Dappnode you can use this page at{" "}
90+
<a href={adminUiLocalDomain}>{adminUiLocalDomain}</a>. Learn more about the Local Network Proxy at:{" "}
91+
<LinkDocs href={docsUrl.connectLocalProxy}>How to connect to Dappnode Local Network Proxy</LinkDocs>
8692
</p>
87-
)}
88-
<hr />
93+
{dappnodeIdentity.internalIp === dappnodeIdentity.ip && (
94+
<p>
95+
Local and public IPs are equal. This may be due to dappnode is running on a remote machine and does not
96+
require Local Network Proxy.
97+
</p>
98+
)}
99+
<hr />
89100

90-
<div className="wifi-local-status-actions-row">
91-
<div className="wifi-local-status-container">
92-
<StateBadge {...parseAvahiPublishCmdState(localProxyingStatus.data)} />
93-
<MdWifi className="wifi-local-status-icon" />
94-
<span className="wifi-local-status-name">Local Network Proxy</span>
95-
</div>
101+
<div className="wifi-local-status-actions-row">
102+
<div className="wifi-local-status-container">
103+
<StateBadge {...parseAvahiPublishCmdState(localProxyingStatus.data)} />
104+
<MdWifi className="wifi-local-status-icon" />
105+
<span className="wifi-local-status-name">Local Network Proxy</span>
106+
</div>
96107

97-
<div className="wifi-local-actions">
98-
<Switch
99-
checked={localProxyingStatus.data === "running"}
100-
onToggle={localProxyingEnableDisable}
101-
disabled={reqStatus.loading}
102-
label={localProxyingStatus.data === "running" ? "On" : "Off"}
103-
></Switch>
108+
<div className="wifi-local-actions">
109+
<Switch
110+
checked={localProxyingStatus.data === "running"}
111+
onToggle={localProxyingEnableDisable}
112+
disabled={reqStatus.loading}
113+
label={localProxyingStatus.data === "running" ? "On" : "Off"}
114+
></Switch>
115+
</div>
104116
</div>
105-
</div>
106-
</Card>
117+
</Card>
118+
</>
107119
) : localProxyingStatus.isValidating ? (
108120
<Loading steps={["Loading Local Network Proxy..."]} />
109121
) : localProxyingStatus.error ? (

0 commit comments

Comments
 (0)