fix(web): 测试 WeKnora 卡片不承诺可接单,技术说明折叠
build / build (push) Successful in 1m49s

This commit is contained in:
dev
2026-11-17 15:30:13 +08:00
parent 0fb78cfe26
commit 8a574903a1
2 changed files with 20 additions and 10 deletions
+2 -2
View File
@@ -147,7 +147,7 @@ describe('SystemSettingsView service configuration', () => {
for (const text of [
'测试地址',
'生产地址',
'生产 ID',
'生产租户 ID',
'知识库 ID',
'保存并启用服务配置',
'https://weknora.test.example',
@@ -423,7 +423,7 @@ describe('SystemSettingsView', () => {
)
const on = view(true, true)
expect(on).toContain('测试 WeKnora')
expect(on).toContain('可达 · 可接单')
expect(on).toContain('接口可达 · 执行器未验证')
expect(on).toContain('延迟 86ms')
expect(on).toContain('已启用 · 可提交生产请求')
expect(on).toContain('生产写入:开启')
+18 -8
View File
@@ -92,6 +92,14 @@ export const healthStateLabel = (health: ServiceHealthView | undefined, service:
if (health.readiness === 'not_applicable') return '未部署'
return health.liveness === 'up' ? '可达 · 不可接单' : '不可达 · 不可接单'
}
// 测试 WeKnora 卡片只证明“接口就绪”:readiness 不覆盖上传/解析执行器,
// 所以不能沿用“可接单”这种承诺式措辞。
export const testWeKnoraLabel = (health: ServiceHealthView | undefined, service: ServiceView | undefined): string => {
const label = healthStateLabel(health, service)
return label === '可达 · 可接单' ? '接口可达 · 执行器未验证' : label
}
export const healthStateDetail = (health: ServiceHealthView | undefined, service: ServiceView | undefined): string => {
if (!health) return service?.detail || '真实 Provider 未接入'
const success = health.last_success_at
@@ -292,7 +300,7 @@ export function SystemSettingsView({
<div className="environment-cards">
<article>
<b>测试 WeKnora</b>
<span>{healthStateLabel(findHealth(monitor, 'WeKnora API'), undefined)}</span>
<span>{testWeKnoraLabel(findHealth(monitor, 'WeKnora API'), undefined)}</span>
<small>{`${healthStateDetail(findHealth(monitor, 'WeKnora API'), undefined) || '端点探测:未配置'};解析队列 对内 ${routingCapabilities.internal_enabled ? '已配置' : '未配置'} · 对外 ${routingCapabilities.external_enabled ? '已配置' : '未配置'};上传/解析执行器能力不在本卡片验证`}</small>
</article>
<article className="production">
@@ -388,13 +396,15 @@ export function SystemSettingsView({
>
{saving ? '正在验证并启用…' : '保存并启用服务配置'}
</button>
<small>
四项留空即表示未配置。地址只接受 http(s) 源地址(不能带用户名密码、查询串或 #
片段,凭据一律走文件引用);生产 ID 是发布契约里的租户 ID,十进制数字;知识库 ID
是生产知识库标识,粘贴 URL 不会通过。保存写入服务器活动版本(版本化 + 审计 +
原子切换);后端同时对测试地址/生产地址做真实探活,并用生产地址真查这两个 ID(WeKnora
列库接口):端点回答"没有这个知识库"或租户不符会拒绝保存,端点抖动、鉴权失败或未配置生产凭据只警告不拦,核验原话与知识库名在保存后显示。
</small>
<details className="settings-details">
<summary>保存规则与核验说明</summary>
<small>
四项留空即表示未配置。地址只接受 http(s) 源地址(不能带用户名密码、查询串或 # 片段,
凭据一律走文件引用);生产租户 ID 为十进制数字;知识库 ID 粘贴 URL 不会通过。
保存会生成修订、真实验证后原子启用;端点回答“没有这个知识库”或租户不符会拒收,
端点抖动、鉴权失败或未配置生产凭据只警告不拦。
</small>
</details>
{serviceSettingsValid ? null : (
<p className="error-message" role="alert">
格式不合法:地址需 http:// 或 https:// 开头的纯地址,不能带用户名密码、? 查询串或 # 片段;生产