diff --git a/src/App.vue b/src/App.vue index 1450411..47eafed 100644 --- a/src/App.vue +++ b/src/App.vue @@ -19,6 +19,7 @@ import ThumbBar from './components/editor/ThumbBar.vue' import Canvas from './components/editor/Canvas.vue' import PropsPanel from './components/editor/PropsPanel.vue' import AiPanel from './components/ai/AiPanel.vue' +import AgentPanel from './components/ai/AgentPanel.vue' import SettingsModal from './components/modals/SettingsModal.vue' import OssSettingsModal from './components/modals/OssSettingsModal.vue' import LibraryModal from './components/modals/LibraryModal.vue' @@ -34,8 +35,8 @@ const presentVisible = ref(false) const presentStartIndex = ref(0) /* ---------- 活动面板 tab ---------- */ -const activeTab = ref<'props' | 'ai'>('props') -function switchTab(name: 'props' | 'ai') { +const activeTab = ref<'props' | 'ai' | 'agent'>('props') +function switchTab(name: 'props' | 'ai' | 'agent') { activeTab.value = name } @@ -506,6 +507,7 @@ onUnmounted(() => {
+
@@ -515,7 +517,13 @@ onUnmounted(() => { @busy-change="onBusyChange" @toast="toast" @open-settings="settingsVisible = true" - @switch-tab="(t: string) => switchTab(t as 'props' | 'ai')" + @switch-tab="(t: string) => switchTab(t as 'props' | 'ai' | 'agent')" + /> + + @@ -543,7 +551,7 @@ onUnmounted(() => { :visible="libraryVisible" @close="libraryVisible = false" @toast="toast" - @switch-tab="(t: string) => switchTab(t as 'props' | 'ai')" + @switch-tab="(t: string) => switchTab(t as 'props' | 'ai' | 'agent')" @open-deck="mode = 'editor'" /> + + + + + diff --git a/src/components/modals/SettingsModal.vue b/src/components/modals/SettingsModal.vue index 2f87e6a..8bc51a1 100644 --- a/src/components/modals/SettingsModal.vue +++ b/src/components/modals/SettingsModal.vue @@ -34,7 +34,8 @@ const PROTO_DEFAULTS: Record = { const form = ref({ preset: 'zhipu', protocol: 'openai', base: '', key: '', model: '', proxy: '', - imgBase: '', imgKey: '', imgModel: '' + imgBase: '', imgKey: '', imgModel: '', + relayUrl: '', relayToken: '', relayDeviceId: '' }) /** 从 store 读取并填充表单 */ @@ -46,7 +47,10 @@ function loadFromStore() { base: c.base, key: c.key, model: c.model, proxy: c.proxy, imgBase: c.imgBase || '', imgKey: c.imgKey || '', - imgModel: c.imgModel || '' + imgModel: c.imgModel || '', + relayUrl: c.relayUrl || '', + relayToken: c.relayToken || '', + relayDeviceId: c.relayDeviceId || '' } } @@ -87,7 +91,10 @@ function save() { proxy: form.value.proxy.trim(), imgBase: (form.value.imgBase || '').trim(), imgKey: (form.value.imgKey || '').trim(), - imgModel: (form.value.imgModel || '').trim() + imgModel: (form.value.imgModel || '').trim(), + relayUrl: (form.value.relayUrl || '').trim(), + relayToken: (form.value.relayToken || '').trim(), + relayDeviceId: (form.value.relayDeviceId || '').trim() }) const label = form.value.preset === 'custom' ? (form.value.protocol === 'anthropic' ? 'Anthropic' : 'OpenAI') + ' 自定义' @@ -172,6 +179,23 @@ function save() { +
Agent 中继(可选,三项齐备即启用 Agent 模式)
+ +
+ + +
+ +
+ + +
+ +
+ + +
+