mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-06 00:12:11 +00:00
desktop: handle sidecar key in projectsKey
This commit is contained in:
parent
4a5823562c
commit
f8904e3972
1 changed files with 5 additions and 4 deletions
|
|
@ -21,11 +21,12 @@ export function serverDisplayName(conn?: ServerConnection.Any) {
|
|||
return conn.http.url.replace(/^https?:\/\//, "").replace(/\/+$/, "")
|
||||
}
|
||||
|
||||
function projectsKey(url: string) {
|
||||
if (!url) return ""
|
||||
const host = url.replace(/^https?:\/\//, "").split(":")[0]
|
||||
function projectsKey(key: ServerConnection.Key) {
|
||||
if (!key) return ""
|
||||
if (key === "sidecar") return "local"
|
||||
const host = key.replace(/^https?:\/\//, "").split(":")[0]
|
||||
if (host === "localhost" || host === "127.0.0.1") return "local"
|
||||
return url
|
||||
return key
|
||||
}
|
||||
|
||||
export namespace ServerConnection {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue