From 042bda9c4aeee4b88e71b2f1894514d9a8eb9880 Mon Sep 17 00:00:00 2001 From: jingrow Date: Mon, 3 Nov 2025 04:35:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/jingrow/frontend/src/locales/zh-CN.json | 36 ++++++++++++++++++- .../frontend/src/views/dev/AgentDetail.vue | 24 ++++++------- .../src/views/dev/AgentMarketplace.vue | 32 ++++++++--------- 3 files changed, 63 insertions(+), 29 deletions(-) diff --git a/apps/jingrow/frontend/src/locales/zh-CN.json b/apps/jingrow/frontend/src/locales/zh-CN.json index ce0114f..9ecc406 100644 --- a/apps/jingrow/frontend/src/locales/zh-CN.json +++ b/apps/jingrow/frontend/src/locales/zh-CN.json @@ -1004,5 +1004,39 @@ "Publish failed, please check permission and server logs": "发布失败,请检查权限和服务器日志", "Node published to marketplace successfully": "节点已成功发布到市场", "Are you sure you want to publish node \"{0}\" to the marketplace?": "确定要将节点 \"{0}\" 发布到市场吗?", - "Confirm": "确认" + "Confirm": "确认", + + "Agent Marketplace": "智能体市场", + "Browse and install agents from Jingrow Agent Marketplace": "浏览并安装来自 Jingrow 智能体市场的智能体", + "Loading agents...": "加载智能体中...", + "No agents found": "未找到智能体", + "Publishing...": "正在发布...", + "Publish to Agent Marketplace": "发布到智能体市场", + "Agent flow data is required for publishing": "发布需要智能体流程数据", + "Agent flow data is required": "需要智能体流程数据", + "Invalid agent flow data format": "智能体流程数据格式无效", + "Agent flow data must be a valid JSON object": "智能体流程数据必须是有效的 JSON 对象", + "Agent published successfully": "智能体发布成功", + "Agent Name": "智能体名称", + "Agent Title": "智能体标题", + "Loading agent details...": "加载智能体详情中...", + "Untitled Agent": "未命名智能体", + "Failed to load agents": "加载智能体失败", + "Failed to load agent details": "加载智能体详情失败", + "Agent execution started successfully": "智能体执行已启动", + "Execution failed": "执行失败", + "Please save the agent first": "请先保存智能体", + "Are you sure you want to publish agent \"{0}\" to the marketplace?": "确定要将智能体 \"{0}\" 发布到市场吗?", + "Agent flow data or name is missing": "智能体流程数据或名称不存在", + "Agent already exists": "智能体已存在", + "Agent \"{0}\" is already installed, do you want to overwrite?": "智能体 \"{0}\" 已安装,是否覆盖安装?", + "Confirm Overwrite": "确认覆盖", + "Preparing installation...": "正在准备安装...", + "Fetching agent details...": "正在获取智能体详情...", + "Failed to fetch agent details": "获取智能体详情失败", + "Installing agent...": "正在安装智能体...", + "Agent installed successfully!": "智能体安装成功!", + "Agent installed successfully": "智能体安装成功", + "Agent flow data is missing": "智能体流程数据不存在", + "Installation failed": "安装失败" } diff --git a/apps/jingrow/frontend/src/views/dev/AgentDetail.vue b/apps/jingrow/frontend/src/views/dev/AgentDetail.vue index 1193bda..6ce7bb4 100644 --- a/apps/jingrow/frontend/src/views/dev/AgentDetail.vue +++ b/apps/jingrow/frontend/src/views/dev/AgentDetail.vue @@ -204,7 +204,7 @@ function goBack() { async function installAgent() { if (!agent.value?.agent_flow && !agent.value?.agent_name) { - message.error(t('智能体流程数据或名称不存在')) + message.error(t('Agent flow data or name is missing')) return } @@ -217,10 +217,10 @@ async function installAgent() { if (checkResponse.data.exists) { // 显示确认对话框 dialog.warning({ - title: t('智能体已存在'), - content: t('智能体 "{0}" 已安装,是否覆盖安装?').replace('{0}', agentNameValue), - positiveText: t('确认覆盖'), - negativeText: t('取消'), + title: t('Agent already exists'), + content: t('Agent "{0}" is already installed, do you want to overwrite?').replace('{0}', agentNameValue), + positiveText: t('Confirm Overwrite'), + negativeText: t('Cancel'), onPositiveClick: () => { performInstall() } @@ -239,7 +239,7 @@ async function performInstall() { try { installing.value = true installProgress.value = 0 - installMessage.value = t('正在准备安装...') + installMessage.value = t('Preparing installation...') installStatus.value = 'info' showProgressModal.value = true @@ -248,11 +248,11 @@ async function performInstall() { let agentNameValue = agent.value.agent_name || agent.value.name if (!agentFlow) { - throw new Error(t('智能体流程数据不存在')) + throw new Error(t('Agent flow data is missing')) } installProgress.value = 30 - installMessage.value = t('正在安装智能体...') + installMessage.value = t('Installing agent...') // 如果 agent_flow 是字符串,尝试解析为 JSON if (typeof agentFlow === 'string') { @@ -280,8 +280,8 @@ async function performInstall() { // 所有步骤完成后才显示成功 installing.value = false installStatus.value = 'success' - installMessage.value = t('智能体安装成功!') - message.success(t('智能体安装成功')) + installMessage.value = t('Agent installed successfully!') + message.success(t('Agent installed successfully')) // 刷新已安装智能体列表 loadInstalledAgents() @@ -296,8 +296,8 @@ async function performInstall() { console.error('Install agent error:', error) installing.value = false installStatus.value = 'error' - installMessage.value = error.response?.data?.detail || error.message || t('安装失败') - message.error(error.response?.data?.detail || t('安装失败')) + installMessage.value = error.response?.data?.detail || error.message || t('Installation failed') + message.error(error.response?.data?.detail || t('Installation failed')) setTimeout(() => { showProgressModal.value = false diff --git a/apps/jingrow/frontend/src/views/dev/AgentMarketplace.vue b/apps/jingrow/frontend/src/views/dev/AgentMarketplace.vue index dea7ba4..aadca93 100644 --- a/apps/jingrow/frontend/src/views/dev/AgentMarketplace.vue +++ b/apps/jingrow/frontend/src/views/dev/AgentMarketplace.vue @@ -237,7 +237,7 @@ function viewAgentDetail(agent: any) { async function installAgent(agent: any) { if (!agent.agent_flow && !agent.agent_name) { - message.error(t('智能体流程数据或名称不存在')) + message.error(t('Agent flow data or name is missing')) return } @@ -250,10 +250,10 @@ async function installAgent(agent: any) { if (checkResponse.data.exists) { // 显示确认对话框 dialog.warning({ - title: t('智能体已存在'), - content: t('智能体 "{0}" 已安装,是否覆盖安装?').replace('{0}', agentName), - positiveText: t('确认覆盖'), - negativeText: t('取消'), + title: t('Agent already exists'), + content: t('Agent "{0}" is already installed, do you want to overwrite?').replace('{0}', agentName), + positiveText: t('Confirm Overwrite'), + negativeText: t('Cancel'), onPositiveClick: () => { performInstall(agent) } @@ -272,7 +272,7 @@ async function performInstall(agent: any) { try { installing.value = true installProgress.value = 0 - installMessage.value = t('正在准备安装...') + installMessage.value = t('Preparing installation...') installStatus.value = 'info' showProgressModal.value = true @@ -281,7 +281,7 @@ async function performInstall(agent: any) { let agentName = agent.agent_name || agent.name if (!agentFlow) { - installMessage.value = t('正在获取智能体详情...') + installMessage.value = t('Fetching agent details...') installProgress.value = 20 try { @@ -290,16 +290,16 @@ async function performInstall(agent: any) { agentFlow = detail.agent_flow agentName = detail.agent_name || agentName } catch (error) { - throw new Error(t('获取智能体详情失败')) + throw new Error(t('Failed to fetch agent details')) } } if (!agentFlow) { - throw new Error(t('智能体流程数据不存在')) + throw new Error(t('Agent flow data is missing')) } installProgress.value = 40 - installMessage.value = t('正在安装智能体...') + installMessage.value = t('Installing agent...') // 如果 agent_flow 是字符串,尝试解析为 JSON if (typeof agentFlow === 'string') { @@ -327,8 +327,8 @@ async function performInstall(agent: any) { // 所有步骤完成后才显示成功 installing.value = false installStatus.value = 'success' - installMessage.value = t('智能体安装成功!') - message.success(t('智能体安装成功')) + installMessage.value = t('Agent installed successfully!') + message.success(t('Agent installed successfully')) // 刷新已安装智能体列表 loadInstalledAgents() @@ -337,14 +337,14 @@ async function performInstall(agent: any) { showProgressModal.value = false }, 2000) } else { - throw new Error(response.data.error || t('安装失败')) + throw new Error(response.data.error || t('Installation failed')) } - } catch (error: any) { + } catch (error: any) { console.error('Install agent error:', error) installing.value = false installStatus.value = 'error' - installMessage.value = error.response?.data?.detail || error.message || t('安装失败') - message.error(error.response?.data?.detail || t('安装失败')) + installMessage.value = error.response?.data?.detail || error.message || t('Installation failed') + message.error(error.response?.data?.detail || t('Installation failed')) setTimeout(() => { showProgressModal.value = false