Moves the public address from each driver's share panel to Settings -> System & backup, with Save and Detect public IP. The share panel shows the address in use and links to the setting; empty keeps using the local network address. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 lines
482 B
JavaScript
12 lines
482 B
JavaScript
// The address phones and other networks use to reach this server (a domain or DynDNS name,
|
|
// optionally with a port), e.g. "https://club.dyndns.org:8443". Only the origin is kept;
|
|
// "" when empty or invalid - links and QR codes then use the local network address.
|
|
export function normalizePublicBaseUrl(value) {
|
|
try {
|
|
const url = new URL(String(value || "").trim());
|
|
return ["http:", "https:"].includes(url.protocol) ? url.origin : "";
|
|
} catch {
|
|
return "";
|
|
}
|
|
}
|