Update port message

This commit is contained in:
Arnaud 2025-04-09 17:00:32 +02:00
parent d5549b5311
commit 5004e7512b
No known key found for this signature in database
GPG Key ID: 69D6CE281FCAE663
2 changed files with 21 additions and 7 deletions

View File

@ -83,6 +83,8 @@ export function HealthChecks({ online, onStepValid }: Props) {
.then(() => codex.refetch());
};
const hasPort = HealthCheckUtils.hasPort(address);
return (
<div className="health-checks">
<div
@ -116,13 +118,21 @@ export function HealthChecks({ online, onStepValid }: Props) {
<p>
<li>
Ensure that your Codex node is running on{" "}
<span className="address-hint">
{HealthCheckUtils.removePort(address)}
</span>{" "}
on port{" "}
<span className="port-hint">{HealthCheckUtils.getPort(address)}</span>
{}
{hasPort ? (
<>
<span>Port detected is </span>
<span className="port-hint">
{HealthCheckUtils.getPort(address)}
</span>
</>
) : (
<>
<span>Port is not specified, default is </span>
<span className="port-hint">
{HealthCheckUtils.getPort(address)}
</span>
</>
)}
</li>
<li>Ensure that port forwarding is enabled for your settings.</li>
</p>

View File

@ -14,6 +14,10 @@ export const HealthCheckUtils = {
return parseInt(url.split(":")[2] || defaultPort, 10);
},
hasPort(url: string) {
return !!url.split(":")[2];
},
containsPort(url: string) {
return url.split(":").length > 2;
},