mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 20:00:47 +00:00
fix: rename tunnelUrl to tunnelPublicUrl for clarity in CLIToolsPageClient
This commit is contained in:
@@ -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";
|
||||||
|
|||||||
Reference in New Issue
Block a user