fix(models): 「Go 额度」列全空 —— goMeta 挂错数组(主表格绑的是 modelRows)
现象:列出来了、但每一格都是「—」。
根因:模型页有**两个**行数组——
· `modelRows`(`{...m, key_set}`)—— 第 88 行 `<el-table :data="modelRows">` 真正绑的是它;
· `textModelRows` —— 只用来数「全部文本模型」的条数、以及测速按钮的 id 列表。
我把 `goMeta: m.go || null` 只加在了后者,主表格的 row 上根本没有这个字段,
模板 `v-if="row.goMeta"` 永远为假 → 全部走「—」分支。
修复:把 goMeta 挂到 modelRows(并注释说明两个数组的分工,避免再踩)。
后端无需改动 —— 用临时实例(8899,隔离 users 文件)实测真实 HTTP:
GET /v1/models → 200 / 28950B / 83 个模型 / 28 个带 go
glm-5.3 → {'monthly_usage': {'go': 60, 'go-plus': 180, 'go-teams': 65},
'training': False, 'zdr': True}
另外给 app/gomodels.py 补了日志(成功 INFO「已载入 N 个模型」/ 失败 WARNING 带异常),
以后这一列再空,看日志就能立刻区分「没拉到」还是「没渲染」。
This commit is contained in:
1 parent
42ecd79e19
commit
3a9dd9ffab
2 files changed
+12
-2
No files matched your search
@@ -532,7 +532,12 @@ const keySet = computed(() => {
|
||||
for (const p of Object.values(health.value.providers || {}) as any) ks[p.name] = !!p.api_key_set
|
||||
return ks
|
||||
})
|
||||
const modelRows = computed(() => models.value.map((m) => ({ ...m, key_set: keySet.value[m.provider_name] })))
|
||||
// 主表格的行数据(表格绑的就是 modelRows:`{...m}` 展开原始模型,保留全部接口字段)。
|
||||
// 2026-11-19:OpenCode Go 的套餐额度/训练列读 row.goMeta —— 必须在这里挂上,
|
||||
// 只挂在 textModelRows(另一个只用来数数量/测速的数组)上表格是看不到的。
|
||||
const modelRows = computed(() =>
|
||||
models.value.map((m) => ({ ...m, key_set: keySet.value[m.provider_name], goMeta: m.go || null })),
|
||||
)
|
||||
|
||||
const providerRows = computed(() => {
|
||||
const p = health.value.providers || {}
|
||||
|
||||
Reference in new issue
Block a user