desktop: handle sidecar key in projectsKey
This commit is contained in:
@@ -21,11 +21,12 @@ export function serverDisplayName(conn?: ServerConnection.Any) {
|
|||||||
return conn.http.url.replace(/^https?:\/\//, "").replace(/\/+$/, "")
|
return conn.http.url.replace(/^https?:\/\//, "").replace(/\/+$/, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
function projectsKey(url: string) {
|
function projectsKey(key: ServerConnection.Key) {
|
||||||
if (!url) return ""
|
if (!key) return ""
|
||||||
const host = url.replace(/^https?:\/\//, "").split(":")[0]
|
if (key === "sidecar") return "local"
|
||||||
|
const host = key.replace(/^https?:\/\//, "").split(":")[0]
|
||||||
if (host === "localhost" || host === "127.0.0.1") return "local"
|
if (host === "localhost" || host === "127.0.0.1") return "local"
|
||||||
return url
|
return key
|
||||||
}
|
}
|
||||||
|
|
||||||
export namespace ServerConnection {
|
export namespace ServerConnection {
|
||||||
|
|||||||
Reference in New Issue
Block a user