style(agents): 模型切换挪到对话框左下角 + 去掉所有 QwenPaw 外链与内部提示(版本 2.6.0 → 2.6.1)

老板三条要求:①模型切换放对话框左下角,不用去配置页;②去掉所有「打开 QwenPaw」
外链;③客户不需要知道的提示(如「提示词归 QwenPaw 管」)全去掉。

- 切换器移入输入区左下角(原静态模型名位置):紧凑 .model-inline 样式、
  可搜索、按供应商分组 + 视觉标;进页面即 loadEngineModels(),展开时兜底刷新
- 配置页模型栏改只读展示 + 一行「在对话框左下角切换」指引
- 删除 qwenpawUrl 计算属性 + 3 处 QwenPaw 外链
- i18n 删 14 个内部/面向 QwenPaw 的键(整键删,不留空串——体检器不允许空文案),
  并改写 sub/subagents/engineBadge/engineDownHint/cfgSlugHint/cfgSuffixHint/
  sharedNote/listFootHint 为客户视角措辞;中英 869/869 对称
- 纯前端改动(后端端点与测试未变,224 passed)

验收:线上实测左下角下拉显示 wjd → 切 deepseek-v4-pro 生效并落盘 → 已恢复 wjd;
配置页截图确认无任何 QwenPaw 字样;重启网关不会回退模型(已实测)。
This commit is contained in:
api-gateway committed 2026-09-30 14:51:04 +08:00
1 parent 0cb369ae80
commit fe9a9fb786
5 files changed
+99 -94

No files matched your search

+10 -24
View File
@@ -23,7 +23,7 @@ export default {
subchat: 'Vision-ready · multi-provider direct routing',
subimages: 'Params on the left, history on the right · downloads proxied by the gateway',
subvideos: '720P · 4–12s · async polling',
subagents: 'All-round assistants for admins · QwenPaw engine',
subagents: 'Assistants that get work done',
submodels: 'Providers / models / protocol lines',
submetrics: 'Usage & cost · isolated per account',
subkeys: 'Up to 3 per account · stored in plaintext, copyable anytime',
@@ -370,7 +370,7 @@ export default {
},
agents: {
title: 'Agents',
sub: 'Route A: UI in the gateway, engine is QwenPaw',
sub: 'Assistants that get work done — each has its own params and sessions',
subHint: '{n} agents · engine {engine} ({url}) · {scope}',
scopeAdmin: 'Admins only',
scopeOpen: 'Available to {n}',
@@ -383,7 +383,7 @@ export default {
tabConfig: 'Config',
tabRuns: 'Runs',
pickAgent: 'Pick an agent on the left',
engineBadge: 'QwenPaw engine',
engineBadge: 'Agent',
statusPublished: 'Published',
statusDraft: 'Draft',
statusRetired: 'Archived',
@@ -391,7 +391,7 @@ export default {
thisChat: 'This chat',
engineReady: 'Engine ready',
engineDown: 'Engine unreachable',
engineDownHint: 'QwenPaw is not running — start it on the server first',
engineDownHint: 'Engine not ready, please try again later',
retry: 'Retry',
stop: 'Stop',
stopRun: 'Background',
@@ -407,40 +407,26 @@ export default {
cfgBasicSub: 'Name and slug are editable',
cfgName: 'Name',
cfgSlug: 'slug',
cfgSlugHint: 'Used as session kind agent_{slug}; must not clash with model id / alias / QwenPaw profile',
cfgSlugHint: 'Must not clash with an existing model id or alias',
cfgDesc: 'Description',
cfgModel: 'Model',
cfgModelSub: 'From the gateway models',
cfgModelPick: 'Pick a model',
cfgModelRefresh: 'Refresh',
cfgModelVision: 'vision',
cfgModelSwitched: 'Switched to {model} (shared by all agents, takes effect immediately)',
cfgModelHintShared: 'All agents share this one model (the engine stores it per profile). Switching takes effect immediately, no restart. You can also change it in QwenPaw:',
cfgOpenQwenpaw: 'Open QwenPaw',
cfgModelSwitched: 'Switched to {model}',
cfgModelAtChat: 'Switch it at the bottom-left of the chat box (shared by all agents, takes effect immediately)',
cfgExec: 'Execution',
cfgExecSub: 'Affects server safety, read-only for now',
cfgEngine: 'Engine',
cfgWorkspace: 'Workspace',
cfgApproval: 'Approval level',
cfgSandbox: 'Sandbox',
cfgSandboxOff: 'off',
cfgSandboxHint: 'sandbox_enabled=false — tools run directly on the server',
cfgParams: 'Parameters',
cfgTemp: 'temperature',
cfgMaxTokens: 'max_tokens',
cfgTopP: 'top_p',
cfgSuffix: 'Role suffix (system_suffix)',
cfgSuffixHint: 'Appended on top of QwenPaw main prompt (max 2000 chars)',
cfgCapability: 'Capability',
cfgCapabilitySub: '27 built-in tools',
cfgCapabilityHint: 'Decided by QwenPaw profile ai-gateway · fully enabled (files, commands, browser)',
cfgSuffixHint: 'Role add-on for this agent, layered on top of the base instructions (max 2000 chars)',
cfgAccess: 'Access',
cfgAccessSub: 'Gradual rollout',
cfgAccessAdmin: 'Admins only',
cfgAccessHint: 'Phase 2 adds per-user / per-role rollout here',
cfgReadonly: 'read-only',
cfgPromptTitle: 'Prompt',
cfgPromptHint: 'Prompts live in QwenPaw (SOUL.md / AGENTS.md); the gateway does not own them',
save: 'Save',
saved: 'Saved',
test: 'Test run',
@@ -453,7 +439,7 @@ export default {
showRetired: 'Show archived',
limitReached: 'Limit reached ({n})',
limitHint: 'Limit reached ({n}); archive unused agents first',
sharedNote: 'All agents share one engine — models and params are per-agent, prompts and memory are shared',
sharedNote: 'Each agent has its own params and sessions; the model is shared',
riskNote: 'This agent can read/write files and run commands on the server',
runsTotal: 'Calls',
runsTools: 'Tool calls',
@@ -476,7 +462,7 @@ export default {
imgMax: 'Up to {n} images',
imgErr: 'Failed to pick image: {msg}',
imgCount: '{n}/{max}',
listFootHint: 'All agents share one engine — new ones share model and memory; only params and sessions differ.',
listFootHint: 'The model is shared; params, role suffix and sessions are per-agent.',
runDefaultTitle: 'Chat',
cacheHit: 'cache {n}',
meLabel: 'Me',
+10 -24
View File
@@ -23,7 +23,7 @@ export default {
subchat: '支持附图视觉 · 多供应商直连',
subimages: '参数在左 · 历史在右 · 下载走网关代拉',
subvideos: '720P · 时长 4–12 秒 · 异步轮询',
subagents: '给管理员用的全能助手 · 引擎 QwenPaw',
subagents: '能干活的助手,可按需创建',
submodels: '供应商 / 模型 / 协议线',
submetrics: '用量与成本 · 按账号隔离',
subkeys: '每个账号最多 3 把 · 明文保存,可反复复制',
@@ -370,7 +370,7 @@ export default {
},
agents: {
title: '智能体',
sub: '路线 A:界面在网关,引擎是 QwenPaw',
sub: '能干活的助手 —— 每个智能体有自己的参数和会话',
subHint: '{n} 个智能体 · 引擎 {engine}({url})· {scope}',
scopeAdmin: '仅管理员可见',
scopeOpen: '{n} 人可用',
@@ -384,7 +384,7 @@ export default {
tabRuns: '运行记录',
pickAgent: '左侧选一个智能体',
// 列表卡片
engineBadge: 'QwenPaw 引擎',
engineBadge: '智能体',
statusPublished: '已发布',
statusDraft: '草稿',
statusRetired: '已归档',
@@ -393,7 +393,7 @@ export default {
thisChat: '本条对话',
engineReady: '引擎就绪',
engineDown: '引擎不可达',
engineDownHint: 'QwenPaw 未运行或未就绪 —— 请先在服务器上启动它',
engineDownHint: '引擎未就绪,请稍后再试',
retry: '重试连接',
stop: '停止',
stopRun: '转后台',
@@ -410,40 +410,26 @@ export default {
cfgBasicSub: '显示名与 slug 可改',
cfgName: '名称',
cfgSlug: 'slug',
cfgSlugHint: '用于会话类别 agent_{slug};不能与模型 id / 别名 / QwenPaw profile 重名',
cfgSlugHint: '不能与已有的模型 id 或别名重名',
cfgDesc: '描述',
cfgModel: '模型',
cfgModelSub: '从网关的模型里选',
cfgModelPick: '选择模型',
cfgModelRefresh: '刷新',
cfgModelVision: '视觉',
cfgModelSwitched: '已切换到 {model}(所有智能体共用,即时生效)',
cfgModelHintShared: '所有智能体共用这一个模型(引擎按 profile 存模型)。切换即时生效,不用重启引擎。也可以去 QwenPaw 改:',
cfgOpenQwenpaw: '打开 QwenPaw',
cfgModelSwitched: '已切换到 {model}',
cfgModelAtChat: '在对话框左下角切换(所有智能体共用,即时生效)',
cfgExec: '执行',
cfgExecSub: '影响服务器安全,一期只读',
cfgEngine: '引擎',
cfgWorkspace: '工作区',
cfgApproval: '审批等级',
cfgSandbox: '沙箱',
cfgSandboxOff: '关',
cfgSandboxHint: '当前 sandbox_enabled=false —— 工具直接在服务器上跑',
cfgParams: '参数',
cfgTemp: 'temperature',
cfgMaxTokens: 'max_tokens',
cfgTopP: 'top_p',
cfgSuffix: '角色补充(system_suffix)',
cfgSuffixHint: '这段是智能体的角色补充,与 QwenPaw 的主提示词叠加生效(上限 2000 字)',
cfgCapability: '能力',
cfgCapabilitySub: '27 项内置工具',
cfgCapabilityHint: '能力由 QwenPaw 的 ai-gateway profile 决定 · 一期全开(可读写文件、执行命令、开浏览器)',
cfgSuffixHint: '智能体的角色补充,叠加在基础指令之上(上限 2000 字)',
cfgAccess: '访问范围',
cfgAccessSub: '灰度下发',
cfgAccessAdmin: '仅管理员',
cfgAccessHint: '二期这里会出现「指定用户 / 按角色」——先把人加进来内测,稳了再放开',
cfgReadonly: '只读',
cfgPromptTitle: '提示词',
cfgPromptHint: '提示词归 QwenPaw 管(改 SOUL.md / AGENTS.md);网关这边不接管',
save: '保存',
saved: '已保存',
test: '试跑',
@@ -456,7 +442,7 @@ export default {
showRetired: '显示已归档',
limitReached: '已达上限({n} 个)',
limitHint: '已达上限 {n} 个(软上限);需要更多时先归档不用的',
sharedNote: '智能体共用同一个引擎 —— 模型与参数各自独立,但提示词与记忆共用',
sharedNote: '每个智能体有自己的参数和会话,模型是共用的',
riskNote: '该智能体可在服务器上读写文件、执行命令',
// 运行记录
runsTotal: '调用次数',
@@ -480,7 +466,7 @@ export default {
imgMax: '最多 {n} 张',
imgErr: '选图失败:{msg}',
imgCount: '{n}/{max} 张',
listFootHint: '所有智能体共用同一个引擎 —— 新建时它们会共用模型与记忆,只有参数和会话各自独立。',
listFootHint: '模型是共用的;参数、角色补充与会话各智能体独立。',
runDefaultTitle: '对话',
cacheHit: '缓存 {n}',
meLabel: '我',
+41 -45
View File
@@ -101,7 +101,7 @@
<div class="ag-tabs">
<span :class="{ on: tab === 'chat' }" @click="tab = 'chat'">{{ t('agents.tabChat') }}</span>
<span :class="{ on: tab === 'config' }" @click="tab = 'config'; loadEngineModels()">{{ t('agents.tabConfig') }}</span>
<span :class="{ on: tab === 'config' }" @click="tab = 'config'">{{ t('agents.tabConfig') }}</span>
<span :class="{ on: tab === 'runs' }" @click="tab = 'runs'; loadRuns()">{{ t('agents.tabRuns') }}</span>
</div>
</div>
@@ -208,7 +208,30 @@
<button class="clip-btn" :disabled="streaming" :title="t('agents.attach')" @click="fileInput?.click()">
<Icon name="clip" :size="15" />
</button>
<span class="tok">{{ cur.engine_model || '—' }}</span>
<!-- 模型切换:就在输入框左下角,选完即时生效 -->
<el-select
v-model="enginePick"
class="model-inline"
size="small"
filterable
:loading="engineLoading"
:placeholder="t('agents.cfgModelPick')"
@change="doSetModel"
@visible-change="(v: boolean) => v && loadEngineModels()"
>
<el-option-group
v-for="g in engineGroups" :key="g.provider_id"
:label="g.provider_name"
>
<el-option
v-for="o in g.items" :key="o.provider_id + '/' + o.model"
:label="o.model" :value="o.provider_id + '/' + o.model"
>
<span>{{ o.model }}</span>
<span v-if="o.vision" class="opt-vision">{{ t('agents.cfgModelVision') }}</span>
</el-option>
</el-option-group>
</el-select>
<span style="flex:1" />
<el-button v-if="!streaming" type="primary" size="small"
:disabled="!input.trim() && !pendingImgs.length" @click="send">
@@ -252,41 +275,15 @@
</div>
<div class="card" style="padding:14px">
<div class="card-h"><b>{{ t('agents.cfgModel') }}</b><span class="sub">{{ t('agents.cfgModelSub') }}</span></div>
<div class="card-h"><b>{{ t('agents.cfgModel') }}</b></div>
<div class="frow">
<div class="f-lab">{{ t('agents.cfgModel') }}</div>
<div class="f-val model-pick">
<el-select
v-model="enginePick"
size="small"
filterable
:loading="engineLoading"
:placeholder="t('agents.cfgModelPick')"
style="flex:1;min-width:0"
@change="doSetModel"
>
<el-option-group
v-for="g in engineGroups" :key="g.provider_id"
:label="g.provider_name"
>
<el-option
v-for="o in g.items" :key="o.provider_id + '/' + o.model"
:label="o.model" :value="o.provider_id + '/' + o.model"
>
<span>{{ o.model }}</span>
<span v-if="o.vision" class="opt-vision">{{ t('agents.cfgModelVision') }}</span>
</el-option>
</el-option-group>
</el-select>
<el-button size="small" :loading="engineLoading" @click="loadEngineModels">
{{ t('agents.cfgModelRefresh') }}
</el-button>
<div class="f-val">
<span class="code">{{ enginePick.split('/')[1] || cur.engine_model || '—' }}</span>
<span class="f-lock"><Icon name="lock" :size="12" />{{ t('agents.cfgReadonly') }}</span>
</div>
</div>
<div class="f-hint">
{{ t('agents.cfgModelHintShared') }}
<a :href="qwenpawUrl" target="_blank" rel="noopener">{{ t('agents.cfgOpenQwenpaw') }} ↗</a>
</div>
<div class="f-hint">{{ t('agents.cfgModelAtChat') }}</div>
<div class="card-h" style="margin-top:var(--gap)">
<b>{{ t('agents.cfgParams') }}</b>
</div>
@@ -318,15 +315,10 @@
<div class="f-val">{{ cur.engine?.type }} · {{ cur.engine?.base_url }}</div></div>
<div class="frow"><div class="f-lab">{{ t('agents.cfgWorkspace') }}</div>
<div class="f-val">{{ cur.engine?.agent_id }}</div></div>
<div class="f-row-note">{{ t('agents.cfgCapabilityHint') }}</div>
<div class="f-hint">
{{ t('agents.cfgPromptTitle') }}:{{ t('agents.cfgPromptHint') }}
<a :href="qwenpawUrl" target="_blank" rel="noopener">{{ t('agents.cfgOpenQwenpaw') }} ↗</a>
</div>
</div>
<div class="card" style="padding:14px">
<div class="card-h"><b>{{ t('agents.cfgAccess') }}</b><span class="sub">{{ t('agents.cfgAccessSub') }}</span></div>
<div class="card-h"><b>{{ t('agents.cfgAccess') }}</b></div>
<div class="frow">
<div class="f-lab">{{ t('agents.cfgAccess') }}</div>
<div class="f-val">
@@ -334,7 +326,6 @@
<span class="f-lock"><Icon name="lock" :size="12" />{{ t('agents.cfgReadonly') }}</span>
</div>
</div>
<div class="f-hint">{{ t('agents.cfgAccessHint') }}</div>
</div>
</div>
@@ -458,7 +449,6 @@ const activeCount = computed(() => data.agents.filter((a) => a.status !== 'retir
const atLimit = computed(() => activeCount.value >= data.max_agents)
const totalRuns = computed(() => data.agents.reduce((s, a) => s + (a.run_total || 0), 0))
const totalTokensText = computed(() => `${(totalRuns.value * 12).toFixed(0)}k`)
const qwenpawUrl = computed(() => (data.engine.base_url || 'http://127.0.0.1:8088').replace(/\/api$/, ''))
const curSessionTitle = computed(() => sessions.value.find((s) => s.id === sessionId.value)?.title || t('agents.newChat'))
const dirty = computed(() => {
const c = cur.value; if (!c) return false
@@ -751,7 +741,10 @@ async function loadRuns() {
catch { runList.value = [] }
}
onMounted(load)
onMounted(() => {
load()
loadEngineModels() // 模型切换器在对话页左下角,进页面就得备好清单
})
</script>
<style scoped>
@@ -858,9 +851,12 @@ onMounted(load)
.f-val { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; font-size: 12.5px; padding: 8px 10px; border-radius: 9px; background: var(--chip); }
.f-val.code { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }
.f-lock { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--muted-2); }
/* 模型下拉(第四十轮):撑满 f-val,右侧留刷新按钮 */
.model-pick { gap: var(--gap-sm); padding: 4px 6px 4px 4px; }
.model-pick .el-select { flex: 1; min-width: 0; }
/* 模型切换器(对话页左下角):紧凑、不抢输入框的视觉重心 */
.model-inline { width: 168px; flex: none; }
.model-inline :deep(.el-select__wrapper) { box-shadow: none; background: transparent; padding-left: 6px; }
.model-inline :deep(.el-select__wrapper:hover) { background: var(--chip); }
.model-inline :deep(.el-select__placeholder),
.model-inline :deep(.el-select__selected-item) { font-size: 11.5px; font-family: ui-monospace, Menlo, monospace; color: var(--muted-2); }
.opt-vision { float: right; margin-left: 10px; font-size: 10.5px; color: var(--primary); opacity: .8; }
.f-hint { font-size: 11px; color: var(--muted-2); line-height: 1.65; margin: var(--gap-xs) 0 0 88px; }
.f-row-note { font-size: 11.5px; color: var(--muted); line-height: 1.6; margin-top: var(--gap-s); }