fix: restore static workstation IP for local connection snippets and service urls

This commit is contained in:
Hitonabi
2026-06-25 23:12:27 +02:00
parent b6af1c1b4a
commit e88dfb8f98
5 changed files with 17 additions and 31 deletions
+1 -5
View File
@@ -7,9 +7,5 @@ export function cn(...inputs: ClassValue[]) {
export function resolveExternalUrl(url?: string): string {
if (!url) return ""
const currentHostname = window.location.hostname
if (currentHostname !== "127.0.0.1" && currentHostname !== "localhost" && currentHostname !== "") {
return url.replace(/127\.0\.0\.1|localhost/g, currentHostname)
}
return url
return url.replace(/127\.0\.0\.1|localhost/g, "192.168.178.151")
}
+1 -7
View File
@@ -4,13 +4,7 @@ import { api, type ConnectResp } from "@/lib/api"
import { cn } from "@/lib/utils"
export function ConnectView() {
const [host, setHost] = useState(() => {
const saved = localStorage.getItem("mc_host")
if (saved) return saved
const hn = window.location.hostname
if (hn && hn !== "localhost" && hn !== "127.0.0.1") return hn
return "192.168.178.151"
})
const [host, setHost] = useState(localStorage.getItem("mc_host") || "192.168.178.151")
const [mcpPath, setMcpPath] = useState(localStorage.getItem("mc_mcp_path") || "")
const [data, setData] = useState<ConnectResp | null>(null)
const [active, setActive] = useState("cline")
+1 -5
View File
@@ -7,11 +7,7 @@ export function GuideView() {
const [activeTab, setActiveTab] = useState<"roocode" | "cursor" | "opencode">("roocode")
const [health, setHealth] = useState<Health | null>(null)
const currentHost = (() => {
const hn = window.location.hostname
if (hn && hn !== "localhost" && hn !== "127.0.0.1") return hn
return "192.168.178.151"
})()
const currentHost = "192.168.178.151"
const [testing, setTesting] = useState(false)
const [testResult, setTestResult] = useState<string | null>(null)