fix: rename tunnelUrl to tunnelPublicUrl for clarity in CLIToolsPageClient

This commit is contained in:
decolua
2026-03-27 11:03:49 +07:00
parent f05d64e073
commit 3f47038933
@@ -24,7 +24,7 @@ export default function CLIToolsPageClient({ machineId }) {
const [modelMappings, setModelMappings] = useState({}); const [modelMappings, setModelMappings] = useState({});
const [cloudEnabled, setCloudEnabled] = useState(false); const [cloudEnabled, setCloudEnabled] = useState(false);
const [tunnelEnabled, setTunnelEnabled] = useState(false); const [tunnelEnabled, setTunnelEnabled] = useState(false);
const [tunnelUrl, setTunnelUrl] = useState(""); const [tunnelPublicUrl, setTunnelPublicUrl] = useState("");
const [apiKeys, setApiKeys] = useState([]); const [apiKeys, setApiKeys] = useState([]);
const [toolStatuses, setToolStatuses] = useState({}); const [toolStatuses, setToolStatuses] = useState({});
@@ -67,7 +67,7 @@ export default function CLIToolsPageClient({ machineId }) {
if (tunnelRes.ok) { if (tunnelRes.ok) {
const data = await tunnelRes.json(); const data = await tunnelRes.json();
setTunnelEnabled(data.enabled || false); setTunnelEnabled(data.enabled || false);
setTunnelUrl(data.tunnelUrl || ""); setTunnelPublicUrl(data.publicUrl || "");
} }
} catch (error) { } catch (error) {
console.log("Error loading settings:", error); console.log("Error loading settings:", error);
@@ -128,7 +128,7 @@ export default function CLIToolsPageClient({ machineId }) {
}, []); }, []);
const getBaseUrl = () => { const getBaseUrl = () => {
if (tunnelEnabled && tunnelUrl) return tunnelUrl; if (tunnelEnabled && tunnelPublicUrl) return tunnelPublicUrl;
if (cloudEnabled && CLOUD_URL) return CLOUD_URL; if (cloudEnabled && CLOUD_URL) return CLOUD_URL;
if (typeof window !== "undefined") return window.location.origin; if (typeof window !== "undefined") return window.location.origin;
return "http://localhost:20128"; return "http://localhost:20128";