mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-07-02 13:11:29 +08:00
fix(engine-select): release 0.16.4
This commit is contained in:
@@ -26,7 +26,7 @@ const PATTERNS = [
|
||||
// 网络
|
||||
{
|
||||
key: 'network',
|
||||
re: /(failed to fetch|networkerror|networkfailure|enetunreach|econnreset|econnrefused|ehostunreach|err_network|fetch failed|connection refused|connection reset|getaddrinfo|dns error|no route to host|aborted|broken pipe|connect timed out|tcp connect)/i,
|
||||
re: /(failed to fetch|networkerror|networkfailure|enetunreach|econnreset|econnrefused|ehostunreach|err_network|fetch failed|connection refused|connection reset|getaddrinfo|dns error|no route to host|aborted|broken pipe|connect timed out|tcp connect|backend service is not running|web deployment mode|后端服务未运行)/i,
|
||||
},
|
||||
// Gateway 未启动(特殊的 connection refused / port not listen 情况)
|
||||
{
|
||||
|
||||
@@ -231,7 +231,13 @@ export async function checkBackendHealth() {
|
||||
if (isTauriRuntime()) { _setBackendOnline(true); return true }
|
||||
try {
|
||||
const resp = await fetch('/__api/health', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: '{}' })
|
||||
const ok = resp.ok
|
||||
const ct = (resp.headers.get('content-type') || '').toLowerCase()
|
||||
if (!resp.ok || !ct.includes('application/json')) {
|
||||
_setBackendOnline(false)
|
||||
return false
|
||||
}
|
||||
const data = await resp.json().catch(() => null)
|
||||
const ok = !!data?.ok
|
||||
_setBackendOnline(ok)
|
||||
return ok
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user