From 424bdcbd5255bc4013b5c7af0e0b52621116d355 Mon Sep 17 00:00:00 2001 From: kicer Date: Tue, 17 Nov 2026 20:34:27 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=AE=BE=E7=BD=AE=E9=A1=B5):=20=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E5=8D=A1=E7=89=87=E5=8A=A0=E3=80=8C=E5=A2=9E=E9=87=8F?= =?UTF-8?q?=E4=B8=8A=E4=B8=8B=E6=96=87=E3=80=8D=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 模型编辑弹窗里新增勾选框,对应配置里的 store: true。 放在「启用」旁边而不是高级区,因为它是决定请求形态的常用开关。 - 勾选/取消只增删 store 键,缺省不写(与 max_context 同一口径) - 新增平台时缺省不勾 --- app/server/public/js/settings.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/server/public/js/settings.js b/app/server/public/js/settings.js index c83fe9c..093fdd2 100644 --- a/app/server/public/js/settings.js +++ b/app/server/public/js/settings.js @@ -1260,7 +1260,7 @@ } function pfNewModel() { const r = { ref: null, id: '', vision: true, enable: true, display_name: '', profile: '', - extra_params: '', thinking_params: '', reasoning_ack_field: '', max_context: 0, adv: false }; + extra_params: '', thinking_params: '', reasoning_ack_field: '', max_context: 0, store: false, adv: false }; if (pfEdit) applyModelDefaults(r, pfEdit.preset); return r; } @@ -1284,6 +1284,7 @@ thinking_params: pfJsonText(m.thinking_params), reasoning_ack_field: m.reasoning_ack_field || '', max_context: Number(m.max_context) || 0, + store: m.store === true, adv: false, })), }; @@ -1374,6 +1375,7 @@ '
' + '' + '' + + '' + '' + '
' + adv + ''; @@ -1430,6 +1432,7 @@ if (ra) nv.reasoning_ack_field = ra; const mc = Math.max(0, parseInt(r.max_context, 10) || 0); if (mc) nv.max_context = mc; + if (r.store === true) nv.store = true; // 缺省 false,只在勾选时写 return nv; } // 根据工作态算批量编辑:原地改(值变更项) → 删行(降序) → 新增行(append)。 @@ -1512,6 +1515,12 @@ if (mc !== curMc) { edits.push(mc ? { path: mp.concat('max_context'), value: mc } : { path: mp.concat('max_context'), op: 'delete' }); } + // 增量上下文:缺省不写,只在勾选时落键,取消勾选则删键 + const curSt = om.store === true; + const st = r.store === true; + if (st !== curSt) { + edits.push(st ? { path: mp.concat('store'), value: true } : { path: mp.concat('store'), op: 'delete' }); + } } else { edits.push({ op: 'append', path: ['platforms', pfEdit.idx, 'models'], value: pfModelValue(r) }); }