WeKnora/frontend/src/components
wizardchen ce8969ab14 fix(initialization): surface upstream and SSRF errors verbatim in test-connection responses
Test-connection's "连接失败" was nearly useless for debugging because
two layers conspired to swallow the actual upstream error:

Backend swallow
---------------
checkChatModelConnection and CheckASRModel pattern-matched on the
upstream error string (401 / 404 / timeout / ...) and replaced it with
a fixed Chinese hint. The original SDK message (request URL, response
body, provider's error code description) was discarded.

Refactor: extract classifyConnectionError(errMsg) — returns just the
short Chinese hint. Callers combine "<hint>:<raw err>" so the hint
indicates "where to start looking" and the raw error shows "what
actually happened". The status-400 special-case (endpoint reachable,
parameter mismatch only) still returns success.

Frontend swallow
----------------
ModelEditorDialog.testConnection ignored result.message on success
paths (fine), but also overwrote it with a generic i18n string on
failure paths and 4xx rejections — even though axios's interceptor
already lifts the backend's error.message to error.message. Failure
branch now uses error?.message || result.message as the toast content;
i18n fallback only when neither is present.

SSRF allowlist hint
-------------------
SSRF validation failures previously returned
"Base URL 未通过安全校验: <reason>" with no mention of how to recover
(the allowlist is server-side, not configurable in the UI). Operators
hit it and were stuck.

New utils.FormatSSRFError(label, rawURL, err) wraps the error with
guidance to add the host to SSRF_WHITELIST_EXTRA (the operator-facing
append-only escape hatch — SSRF_WHITELIST itself is the project's
baseline). The hint echoes the failed host so it can be copy-pasted
straight into the env var:

  Base URL 未通过安全校验:DNS resolution failed for hostname
  test.local.com ... 如该地址确实可信,请联系运维在服务端环境变量
  SSRF_WHITELIST_EXTRA 中加入该主机(支持精确域名 / *.example.com
  通配 / IP / CIDR),示例:SSRF_WHITELIST_EXTRA=test.local.com,
  *.example.com,10.0.0.0/8

All SSRF call sites switch to the helper:
  initialization (CheckRemoteModel / TestEmbedding / CheckRerank /
  CheckASR / TestMultimodal / batch validation), model CRUD,
  mcp_service CRUD, knowledge URL ingest, system ReconnectDocReader.
2026-05-17 15:27:52 +08:00
..
GlobalCommandPalette feat(frontend): replace standalone search page with global command palette 2026-05-06 16:26:22 +08:00
credentials refactor(credentials): introduce /credentials subresource pattern 2026-05-17 15:27:52 +08:00
css feat(frontend): unify font rendering and add font picker in settings 2026-05-05 00:48:40 +08:00
settings refactor(frontend): unify Model/WebSearch/MCP settings pages with shared card + drawer 2026-04-29 22:34:39 +08:00
AgentAvatar.vue feat(frontend): unify font rendering and add font picker in settings 2026-05-05 00:48:40 +08:00
AgentSelector.vue fix: standardize border styles across components 2026-03-05 18:14:14 +08:00
AgentShareSettings.vue feat(frontend): unify font rendering and add font picker in settings 2026-05-05 00:48:40 +08:00
AttachmentUpload.vue fix(frontend): route chat drag-and-drop uploads correctly 2026-04-30 10:43:03 +08:00
FAQTagTooltip.vue feat(frontend): unify font rendering and add font picker in settings 2026-05-05 00:48:40 +08:00
GlobalCommandPalette.vue feat(frontend): replace standalone search page with global command palette 2026-05-06 16:26:22 +08:00
IMChannelPanel.vue feat(frontend): unify external doc-link style and outline add buttons 2026-05-07 21:51:22 +08:00
IMChannelsOverviewPanel.vue feat(im): tenant-wide IM channels overview under the user menu 2026-04-30 15:29:14 +08:00
Input-field.vue fix(agent): relax rerank model requirement for custom agents 2026-05-12 16:57:24 +08:00
KnowledgeBaseSelector.vue fix: standardize border styles across components 2026-03-05 18:14:14 +08:00
ListSpaceSidebar.vue feat(frontend): unify font rendering and add font picker in settings 2026-05-05 00:48:40 +08:00
MentionSelector.vue feat(frontend): unify font rendering and add font picker in settings 2026-05-05 00:48:40 +08:00
ModelEditorDialog.vue fix(initialization): surface upstream and SSRF errors verbatim in test-connection responses 2026-05-17 15:27:52 +08:00
ModelSelector.vue feat(asr): integrate Automatic Speech Recognition (ASR) support 2026-04-02 21:27:27 +08:00
PromptTemplateSelector.vue feat: enhance localization and configuration support 2026-03-17 22:23:24 +08:00
ShareKnowledgeBaseDialog.vue fix(frontend): unify radio button theme and disabled selection 2026-05-07 21:51:22 +08:00
SpaceAvatar.vue feat(frontend): unify font rendering and add font picker in settings 2026-05-05 00:48:40 +08:00
TenantSelector.vue fix: standardize border styles across components 2026-03-05 18:14:14 +08:00
UserMenu.vue feat(im): tenant-wide IM channels overview under the user menu 2026-04-30 15:29:14 +08:00
doc-content.vue fix(markdown): 修复小概率情况下公式加载失败问题 2026-05-07 16:34:20 +08:00
document-preview.vue fix(markdown): 修复小概率情况下公式加载失败问题 2026-05-07 16:34:20 +08:00
empty-knowledge.vue feat(frontend): unify font rendering and add font picker in settings 2026-05-05 00:48:40 +08:00
manual-knowledge-editor.vue feat(frontend): unify font rendering and add font picker in settings 2026-05-05 00:48:40 +08:00
menu.vue fix(frontend): make general-settings font picker actually work 2026-05-07 15:07:24 +08:00
modelEditorSourceState.test.ts fix(model): hide Ollama tip for remote models 2026-05-16 02:20:58 +08:00
modelEditorSourceState.ts fix(model): hide Ollama tip for remote models 2026-05-16 02:20:58 +08:00
picture-preview.vue feat: Enhance image preview functionality in WikiBrowser component 2026-04-22 21:17:28 +08:00
upload-mask.vue feat(frontend): unify font rendering and add font picker in settings 2026-05-05 00:48:40 +08:00