fix: dynamically resolve active hostname in guide and connect views
This commit is contained in:
+13
-13
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
<meta name="theme-color" content="#0d1117" />
|
<meta name="theme-color" content="#0d1117" />
|
||||||
<link rel="manifest" href="/manifest.webmanifest" />
|
<link rel="manifest" href="/manifest.webmanifest" />
|
||||||
<title>Mission Control 2.0</title>
|
<title>Mission Control 2.0</title>
|
||||||
<script type="module" crossorigin src="/assets/index-CgKqjgpB.js"></script>
|
<script type="module" crossorigin src="/assets/index-BtTFipce.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-CAfaSDN8.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-CAfaSDN8.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -4,7 +4,13 @@ import { api, type ConnectResp } from "@/lib/api"
|
|||||||
import { cn } from "@/lib/utils"
|
import { cn } from "@/lib/utils"
|
||||||
|
|
||||||
export function ConnectView() {
|
export function ConnectView() {
|
||||||
const [host, setHost] = useState(localStorage.getItem("mc_host") || "192.168.178.151")
|
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 [mcpPath, setMcpPath] = useState(localStorage.getItem("mc_mcp_path") || "")
|
const [mcpPath, setMcpPath] = useState(localStorage.getItem("mc_mcp_path") || "")
|
||||||
const [data, setData] = useState<ConnectResp | null>(null)
|
const [data, setData] = useState<ConnectResp | null>(null)
|
||||||
const [active, setActive] = useState("cline")
|
const [active, setActive] = useState("cline")
|
||||||
|
|||||||
@@ -6,6 +6,13 @@ import { cn } from "@/lib/utils"
|
|||||||
export function GuideView() {
|
export function GuideView() {
|
||||||
const [activeTab, setActiveTab] = useState<"roocode" | "cursor" | "opencode">("roocode")
|
const [activeTab, setActiveTab] = useState<"roocode" | "cursor" | "opencode">("roocode")
|
||||||
const [health, setHealth] = useState<Health | null>(null)
|
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 [testing, setTesting] = useState(false)
|
const [testing, setTesting] = useState(false)
|
||||||
const [testResult, setTestResult] = useState<string | null>(null)
|
const [testResult, setTestResult] = useState<string | null>(null)
|
||||||
|
|
||||||
@@ -185,7 +192,7 @@ export function GuideView() {
|
|||||||
<div className="pl-6 pt-1">
|
<div className="pl-6 pt-1">
|
||||||
<div className="p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground">
|
<div className="p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground">
|
||||||
<div><span className="text-muted-foreground/60">API Provider:</span> OpenAI Compatible</div>
|
<div><span className="text-muted-foreground/60">API Provider:</span> OpenAI Compatible</div>
|
||||||
<div><span className="text-muted-foreground/60">Base URL:</span> http://192.168.178.151:9001/v1</div>
|
<div><span className="text-muted-foreground/60">Base URL:</span> http://{currentHost}:9001/v1</div>
|
||||||
<div><span className="text-muted-foreground/60">API Key:</span> <span className="italic text-muted-foreground/50">beliebig (z.B. "local")</span></div>
|
<div><span className="text-muted-foreground/60">API Key:</span> <span className="italic text-muted-foreground/50">beliebig (z.B. "local")</span></div>
|
||||||
<div><span className="text-muted-foreground/60">Model ID:</span> auto</div>
|
<div><span className="text-muted-foreground/60">Model ID:</span> auto</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -227,7 +234,7 @@ export function GuideView() {
|
|||||||
<p className="pl-6">Deaktiviere die Standard-Cloudmodelle, klappe den Bereich <strong>OpenAI API</strong> auf und konfiguriere:</p>
|
<p className="pl-6">Deaktiviere die Standard-Cloudmodelle, klappe den Bereich <strong>OpenAI API</strong> auf und konfiguriere:</p>
|
||||||
<div className="pl-6 pt-1">
|
<div className="pl-6 pt-1">
|
||||||
<div className="p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground">
|
<div className="p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground">
|
||||||
<div><span className="text-muted-foreground/60">Override Base URL:</span> http://192.168.178.151:9001/v1</div>
|
<div><span className="text-muted-foreground/60">Override Base URL:</span> http://{currentHost}:9001/v1</div>
|
||||||
<div><span className="text-muted-foreground/60">API Key:</span> <span className="italic text-muted-foreground/50">beliebig (z.B. "local")</span></div>
|
<div><span className="text-muted-foreground/60">API Key:</span> <span className="italic text-muted-foreground/50">beliebig (z.B. "local")</span></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -268,7 +275,7 @@ export function GuideView() {
|
|||||||
<p className="pl-6">Gehe in den Bereich Einstellungen ➔ Provider, deaktiviere die Cloud-Voreinstellungen und trage deinen lokalen Server ein:</p>
|
<p className="pl-6">Gehe in den Bereich Einstellungen ➔ Provider, deaktiviere die Cloud-Voreinstellungen und trage deinen lokalen Server ein:</p>
|
||||||
<div className="pl-6 pt-1">
|
<div className="pl-6 pt-1">
|
||||||
<div className="p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground">
|
<div className="p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground">
|
||||||
<div><span className="text-muted-foreground/60">Base URL:</span> http://192.168.178.151:9001/v1</div>
|
<div><span className="text-muted-foreground/60">Base URL:</span> http://{currentHost}:9001/v1</div>
|
||||||
<div><span className="text-muted-foreground/60">Model:</span> auto</div>
|
<div><span className="text-muted-foreground/60">Model:</span> auto</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user