feat(login): show xGat3 button only when accessed via IP address

Hide the Open xGat3 button when the page is accessed via a domain name.
Only show it when the hostname is a raw IP (e.g. 10.0.0.1 over WireGuard).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
xtcnet 2026-03-17 21:44:02 +07:00
parent 1b97b8b0ad
commit dd525adaef

View file

@ -198,6 +198,7 @@ export default function Login() {
</div>
</div>
<div className="text-center text-secondary mt-3">{getVersion()}</div>
{/^\d+\.\d+\.\d+\.\d+$/.test(window.location.hostname) && (
<div className="text-center mt-3">
<a
href={`${window.location.origin}/wg-public`}
@ -208,6 +209,7 @@ export default function Login() {
Open xGat3
</a>
</div>
)}
</div>
</Page>
);