MCPcopy Create free account
hub / github.com/anomalyco/opencode / serverName

Function serverName

packages/app/src/context/server.tsx:19–23  ·  view source on GitHub ↗
(conn?: ServerConnection.Any, ignoreDisplayName = false)

Source from the content-addressed store, hash-verified

17}
18
19export function serverName(conn?: ServerConnection.Any, ignoreDisplayName = false) {
20 if (!conn) return ""
21 if (conn.displayName && !ignoreDisplayName) return conn.displayName
22 return conn.http.url.replace(/^https?:\/\//, "").replace(/\/+$/, "")
23}
24
25function isLocalHost(url: string) {
26 const host = url.replace(/^https?:\/\//, "").split(":")[0]

Callers 9

ConnectionErrorFunction · 0.90
TabNavItemFunction · 0.90
ServerRowFunction · 0.90
tooltipValueFunction · 0.90
SettingsServersV2Function · 0.90
NewHomeFunction · 0.90
SessionErrorFallbackFunction · 0.90
nameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected