feat: 纯生产脚本更新
This commit is contained in:
@@ -72,7 +72,8 @@ function renderModels(me) {
|
||||
list.forEach((m) => {
|
||||
const opt = document.createElement("option");
|
||||
opt.value = String(m.id);
|
||||
opt.textContent = `${m.model_name} (${m.model})`;
|
||||
const imageModel = (m.image_model || "").trim();
|
||||
opt.textContent = imageModel ? `${m.model_name} (${m.model} / 图:${imageModel})` : `${m.model_name} (${m.model})`;
|
||||
if ((active && m.id === active) || m.active) opt.selected = true;
|
||||
sel.appendChild(opt);
|
||||
});
|
||||
@@ -194,6 +195,7 @@ if (saveModelBtn) {
|
||||
api_key: ($("apiKey") && $("apiKey").value.trim()) || "",
|
||||
base_url: ($("baseUrl") && $("baseUrl").value.trim()) || "",
|
||||
model: ($("modelValue") && $("modelValue").value.trim()) || "",
|
||||
image_model: ($("imageModelValue") && $("imageModelValue").value.trim()) || "",
|
||||
timeout_sec: Number((($("timeoutSec") && $("timeoutSec").value) || "120").trim()),
|
||||
max_output_tokens: Number((($("maxOutputTokens") && $("maxOutputTokens").value) || "8192").trim()),
|
||||
max_retries: Number((($("maxRetries") && $("maxRetries").value) || "0").trim()),
|
||||
@@ -205,6 +207,7 @@ if (saveModelBtn) {
|
||||
setStatus("模型配置已保存并设为当前。");
|
||||
if ($("apiKey")) $("apiKey").value = "";
|
||||
if ($("modelName")) $("modelName").value = "";
|
||||
if ($("imageModelValue")) $("imageModelValue").value = "";
|
||||
await refresh();
|
||||
} catch (e) {
|
||||
setStatus(e.message || "模型保存失败", true);
|
||||
|
||||
Reference in New Issue
Block a user