(
value: string,
username: string,
password: string,
setStatus: (value: boolean | undefined) => void,
)
| 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 | } |
no test coverage detected