refactor: 删除无用的模型展示名(display_name)字段

该字段仅存取、从不展示:管理列表只渲染 name,/v1/models 与用户侧
均不返回它。与渠道绑定 upstream_model 的名字映射职责重叠且悬空。
- store.Model 结构体、admin CRUD、seed 数据移除 display_name
- 前端编辑弹窗输入框、表单状态、types.ts 同步移除
- 本地库已 ALTER TABLE DROP COLUMN;生产残留列无害
This commit is contained in:
Sakurasan
2026-08-27 09:57:30 +08:00
parent 79545aa48e
commit 305b3ed731
6 changed files with 9 additions and 23 deletions
-1
View File
@@ -59,7 +59,6 @@ export interface ModelBinding {
export interface Model {
id: number
name: string
display_name: string
input_price: number
output_price: number
cache_read_price: number
+2 -5
View File
@@ -46,7 +46,6 @@ function quickAdd() {
const form = reactive({
name: '',
display_name: '',
input_price: 0,
output_price: 0,
cache_read_price: 0,
@@ -65,14 +64,14 @@ async function load() {
function openCreate() {
editing.value = null
Object.assign(form, { name: '', display_name: '', input_price: 0, output_price: 0, cache_read_price: 0, enabled: true })
Object.assign(form, { name: '', input_price: 0, output_price: 0, cache_read_price: 0, enabled: true })
editOpen.value = true
}
function openEdit(m: Model) {
editing.value = m
Object.assign(form, {
name: m.name, display_name: m.display_name,
name: m.name,
input_price: m.input_price, output_price: m.output_price, cache_read_price: m.cache_read_price,
enabled: m.enabled,
})
@@ -82,7 +81,6 @@ function openEdit(m: Model) {
async function save() {
saving.value = true
const payload = {
display_name: form.display_name || form.name,
input_price: Number(form.input_price),
output_price: Number(form.output_price),
cache_read_price: Number(form.cache_read_price),
@@ -207,7 +205,6 @@ onMounted(load)
<Modal :open="editOpen" :title="editing ? '编辑模型' : '添加模型'" @close="editOpen = false">
<div class="space-y-4">
<Input v-model="form.name" label="模型名" placeholder="claude-sonnet-5" :disabled="!!editing" />
<Input v-model="form.display_name" label="展示名" />
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<Input v-model="form.input_price" label="输入价格 /1M" type="number" />
<Input v-model="form.output_price" label="输出价格 /1M" type="number" />