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:
parent
1b97b8b0ad
commit
dd525adaef
1 changed files with 12 additions and 10 deletions
|
|
@ -198,16 +198,18 @@ export default function Login() {
|
|||
</div>
|
||||
</div>
|
||||
<div className="text-center text-secondary mt-3">{getVersion()}</div>
|
||||
<div className="text-center mt-3">
|
||||
<a
|
||||
href={`${window.location.origin}/wg-public`}
|
||||
className="btn btn-outline-secondary btn-sm"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
Open xGat3
|
||||
</a>
|
||||
</div>
|
||||
{/^\d+\.\d+\.\d+\.\d+$/.test(window.location.hostname) && (
|
||||
<div className="text-center mt-3">
|
||||
<a
|
||||
href={`${window.location.origin}/wg-public`}
|
||||
className="btn btn-outline-secondary btn-sm"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
Open xGat3
|
||||
</a>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</Page>
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue