MCPcopy
hub / github.com/anomalyco/opencode / previewStatus

Function previewStatus

packages/app/src/components/dialog-select-server.tsx:92–107  ·  view source on GitHub ↗
(
    value: string,
    username: string,
    password: string,
    setStatus: (value: boolean | undefined) => void,
  )

Source from the content-addressed store, hash-verified

90 }
91
92 const previewStatus = async (
93 value: string,
94 username: string,
95 password: string,
96 setStatus: (value: boolean | undefined) => void,
97 ) => {
98 setStatus(undefined)
99 if (!looksComplete(value)) return
100 const normalized = normalizeServerUrl(value)
101 if (!normalized) return
102 const http: ServerConnection.HttpBase = { url: normalized }
103 if (username) http.username = username
104 if (password) http.password = password
105 const result = await checkServerHealth(http)
106 setStatus(result.healthy)
107 }
108
109 return { previewStatus }
110}

Callers 6

handleAddChangeFunction · 0.85
handleAddUsernameChangeFunction · 0.85
handleAddPasswordChangeFunction · 0.85
handleEditChangeFunction · 0.85
handleEditUsernameChangeFunction · 0.85
handleEditPasswordChangeFunction · 0.85

Calls 4

normalizeServerUrlFunction · 0.90
setStatusFunction · 0.85
looksCompleteFunction · 0.85
checkServerHealthFunction · 0.85

Tested by

no test coverage detected