增加模型别名

This commit is contained in:
2026-07-04 14:49:52 +08:00
parent 641a021f7a
commit 03f9744dcb
16 changed files with 298 additions and 145 deletions
@@ -18,6 +18,7 @@ const REF_MODE_LABEL = { none: '无', frame: '首帧/首尾帧', asset: '参考
const catalog = ref([])
const loading = ref(true)
const selectedId = ref(props.model?.id || '')
const alias = ref(props.model?.alias || '')
const imagePrices = ref({}) // 普通价 { '1K': '', '2K': '', ... } keyed by resolutions
const videoPrices = ref({}) // 普通价 { '5s': '', '10s': '', ... } keyed by durations
const imagePricesAgent = ref({}) // 代理价(留空 = 跟随普通价)
@@ -138,6 +139,7 @@ async function save() {
duration_prices,
prices_agent,
duration_prices_agent,
alias: alias.value.trim(),
max_reference_images: e.max_reference_images || 0,
reference_mode: e.reference_mode || 'none',
weight: Number(weight.value) || 0,
@@ -153,6 +155,7 @@ async function save() {
prices,
prices_agent,
image_to_image: !!e.image_to_image,
alias: alias.value.trim(),
// 多参考图:把目录定义的张数(gpt=3/seedream=6/flux=4 …)写进模型,
// 否则后端仍按旧值(默认 1)限制。
max_reference_images: e.max_reference_images || 0,
@@ -197,6 +200,12 @@ async function save() {
</p>
</div>
<div>
<label class="lbl">别名</label>
<input v-model="alias" class="field font-mono" placeholder="可选,对外名" />
<p class="text-[11px] text-white/40 mt-1.5">设置后原模型名将不可调用,画图台 / API / 文档都改用别名</p>
</div>
<!-- read-only param summary, straight from the loaded catalog -->
<div v-if="entry" class="rounded-xl bg-white/[0.03] ring-1 ring-white/[0.06] p-3.5 space-y-2.5">
<div class="flex items-center gap-2">