diff --git a/frontend/src/i18n/locales/en-US.ts b/frontend/src/i18n/locales/en-US.ts index a15553a5..0712483c 100755 --- a/frontend/src/i18n/locales/en-US.ts +++ b/frontend/src/i18n/locales/en-US.ts @@ -637,6 +637,8 @@ export default { webSearchConfig: 'Web Search', webSearchConfigDesc: 'Configure web search capabilities for the agent', configuration: 'Configuration', + agentId: 'Agent ID', + agentIdDesc: 'Use this ID to target the agent in API integrations', name: 'Name', namePlaceholder: 'Enter agent name', nameRequired: 'Agent name is required', diff --git a/frontend/src/i18n/locales/ko-KR.ts b/frontend/src/i18n/locales/ko-KR.ts index d763e03c..9d33ed8d 100755 --- a/frontend/src/i18n/locales/ko-KR.ts +++ b/frontend/src/i18n/locales/ko-KR.ts @@ -1569,6 +1569,8 @@ export default { webSearchConfig: "웹 검색", webSearchConfigDesc: "에이전트의 네트워크 검색 기능 구성", configuration: "구성 항목", + agentId: "에이전트 ID", + agentIdDesc: "API 연동에서 이 ID로 에이전트를 지정할 수 있습니다", name: "이름", namePlaceholder: "에이전트 이름을 입력해주세요.", nameRequired: "에이전트 이름을 입력해주세요.", diff --git a/frontend/src/i18n/locales/ru-RU.ts b/frontend/src/i18n/locales/ru-RU.ts index d8828968..f285b03d 100755 --- a/frontend/src/i18n/locales/ru-RU.ts +++ b/frontend/src/i18n/locales/ru-RU.ts @@ -461,6 +461,8 @@ export default { webSearchConfig: 'Web Search', webSearchConfigDesc: 'Configure web search capabilities for the agent', configuration: 'Configuration', + agentId: 'Agent ID', + agentIdDesc: 'Use this ID to target the agent in API integrations', name: 'Name', namePlaceholder: 'Enter agent name', nameRequired: 'Agent name is required', diff --git a/frontend/src/i18n/locales/zh-CN.ts b/frontend/src/i18n/locales/zh-CN.ts index b6bb222e..ae181c52 100755 --- a/frontend/src/i18n/locales/zh-CN.ts +++ b/frontend/src/i18n/locales/zh-CN.ts @@ -1562,6 +1562,8 @@ export default { webSearchConfig: "网络搜索", webSearchConfigDesc: "配置智能体的网络搜索能力", configuration: "配置项", + agentId: "智能体 ID", + agentIdDesc: "API 集成时可使用此 ID 指定智能体", name: "名称", namePlaceholder: "请输入智能体名称", nameRequired: "请输入智能体名称", diff --git a/frontend/src/views/agent/AgentEditorModal.vue b/frontend/src/views/agent/AgentEditorModal.vue index f810b009..91013d7c 100644 --- a/frontend/src/views/agent/AgentEditorModal.vue +++ b/frontend/src/views/agent/AgentEditorModal.vue @@ -43,6 +43,26 @@ {{ $t('agentEditor.builtinHint') }} + +
+
+ +

{{ $t('agent.editor.agentIdDesc') }}

+
+
+
+ + + + + + +
+
+
+
@@ -1342,6 +1362,30 @@ const emit = defineEmits<{ (e: 'success'): void; }>(); +const copyAgentId = async () => { + const id = props.agent?.id; + if (!id) return; + + try { + if (navigator.clipboard?.writeText) { + await navigator.clipboard.writeText(id); + } else { + const textarea = document.createElement('textarea'); + textarea.value = id; + textarea.setAttribute('readonly', ''); + textarea.style.position = 'fixed'; + textarea.style.opacity = '0'; + document.body.appendChild(textarea); + textarea.select(); + document.execCommand('copy'); + document.body.removeChild(textarea); + } + MessagePlugin.success(t('common.copied')); + } catch { + MessagePlugin.error(t('common.copyFailed')); + } +}; + const currentSection = ref(props.initialSection || 'basic'); const saving = ref(false); const allModels = ref([]); @@ -3940,6 +3984,18 @@ const handleSave = async () => { } } +.agent-id-control { + display: flex; + align-items: center; + gap: 8px; + width: 100%; +} + +.agent-id-input { + flex: 1; + min-width: 0; +} + .settings-footer { padding: 16px 32px; border-top: 1px solid var(--td-component-stroke);