fix(frontend): 设置页诚实态分态+两小修——LLM 卡读取失败显式态(不再永挂「读取中…」)+月度卡三态(logFound 真/日志缺席/端点失败分文案,宁缺毋假)+resetEditing 清 testNote+smoke 测试名去计数 (终审顺手修波) [vps] [no-doc]
CI/CD / test (push) Successful in 45s
CI/CD / nas-deploy (push) Has been cancelled
CI/CD / nas-verify (push) Has been cancelled

This commit is contained in:
2026-10-05 10:25:37 +08:00
parent 1e67db3d0e
commit 5c015920c3
2 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ import { describe, expect, it } from 'vitest'
import * as api from './pipeline'
describe('api/pipeline 契约', () => {
it('导出九个适配函数', () => {
it('导出 pipeline 适配函数', () => {
for (const fn of [
api.getTodos, api.getHypotheses, api.getFactors, api.getMonthlyReview,
api.getCompositeVersions, api.getLadder, api.getAttribution,
+6 -3
View File
@@ -13,12 +13,13 @@ const showKey = ref(false)
const busy = ref<'idle' | 'saving' | 'testing'>('idle')
const testResult = ref<LlmTestResult | null>(null)
const testNote = ref('')
const loadError = ref(false)
const envItems = ref<EnvStatusItem[]>([])
const monthly = ref<MonthlyStatus | null>(null)
onMounted(async () => {
const [v, env, mon] = await Promise.all([
getLlmConfig().catch(() => null),
getLlmConfig().catch(() => { loadError.value = true; return null }),
getEnvStatus().catch(() => []),
getMonthlyStatus().catch(() => null),
])
@@ -39,6 +40,7 @@ function resetEditing(): void {
enabled: view.value.config.enabled ? '1' : '0',
}
testResult.value = null
testNote.value = ''
}
const dirty = computed(() => {
@@ -100,7 +102,7 @@ function rcTone(rc: number): string {
<template>
<div class="pl-page">
<PanelCard title="LLM 连接" sub="卡片向导/分解器的模型来源 · 解析三层 DB>env>默认 · 改动进审计行 · key 绝不明文回显">
<div v-if="!view" class="card-empty">读取中…</div>
<div v-if="!view" class="card-empty">{{ loadError ? 'LLM 配置读取失败(端点不可用)——如实展示' : '读取中…' }}</div>
<template v-else>
<div v-if="!view.resolved" class="banner warn">
⚠ LLM 未生效:{{ view.missing.join(';') }} —— 卡片向导与「AI 分解」将 503;下方保存 DB 配置或走 env 兜底
@@ -178,7 +180,8 @@ function rcTone(rc: number): string {
<span class="m-legend">rc 0=绿 2=有效信号(橙) 其他=红</span>
</div>
</div>
<div v-else class="card-empty">本机未见 factor_monthly_cron.log(首班未跑或日志在他机)——如实展示,不造数</div>
<div v-else-if="monthly" class="card-empty">本机未见 factor_monthly_cron.log(首班未跑或日志在他机)——如实展示,不造数</div>
<div v-else class="card-empty">月度状态探针不可用(端点失败)——如实展示,不造数</div>
</PanelCard>
<PanelCard v-if="view?.audit.length" title="LLM 配置审计" sub="谁/何时/旧→新 · api_key 行只存打码形">