Feat: Place the new mcp button at the end of the line. #10427 (#11170)

### What problem does this PR solve?

Feat: Place the new mcp button at the end of the line. #10427

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-11-11 17:11:32 +08:00
committed by GitHub
parent f441f8ffc2
commit 8ddeaca3d6
13 changed files with 24 additions and 29 deletions

View File

@ -1229,7 +1229,6 @@ export default {
}, },
addVariable: 'Variable hinzufügen', addVariable: 'Variable hinzufügen',
variableSettings: 'Variableneinstellungen', variableSettings: 'Variableneinstellungen',
globalVariables: 'Globale Variablen',
systemPrompt: 'System-Prompt', systemPrompt: 'System-Prompt',
addCategory: 'Kategorie hinzufügen', addCategory: 'Kategorie hinzufügen',
categoryName: 'Kategoriename', categoryName: 'Kategoriename',

View File

@ -1064,10 +1064,10 @@ Example: general/v2/`,
exceptionMethod: 'Exception method', exceptionMethod: 'Exception method',
maxRounds: 'Max reflection rounds', maxRounds: 'Max reflection rounds',
delayEfterError: 'Delay after error', delayEfterError: 'Delay after error',
maxRetries: 'Max reflection rounds', maxRetries: 'Max retry rounds',
advancedSettings: 'Advanced Settings', advancedSettings: 'Advanced Settings',
addTools: 'Add Tools', addTools: 'Add Tools',
sysPromptDefultValue: ` sysPromptDefaultValue: `
<role> <role>
You are a helpful assistant, an AI assistant specialized in problem-solving for the user. You are a helpful assistant, an AI assistant specialized in problem-solving for the user.
If a specific domain is provided, adapt your expertise to that domain; otherwise, operate as a generalist. If a specific domain is provided, adapt your expertise to that domain; otherwise, operate as a generalist.
@ -1524,7 +1524,6 @@ This delimiter is used to split the input text into several text pieces echo of
}, },
addVariable: 'Add variable', addVariable: 'Add variable',
variableSettings: 'Variable settings', variableSettings: 'Variable settings',
globalVariables: 'Global variables',
systemPrompt: 'System prompt', systemPrompt: 'System prompt',
userPrompt: 'User prompt', userPrompt: 'User prompt',
addCategory: 'Add category', addCategory: 'Add category',

View File

@ -1154,7 +1154,6 @@ export default {
}, },
addVariable: 'Ajouter une variable', addVariable: 'Ajouter une variable',
variableSettings: 'Paramètres des variables', variableSettings: 'Paramètres des variables',
globalVariables: 'Variables globales',
systemPrompt: 'Invite système', systemPrompt: 'Invite système',
addCategory: 'Ajouter une catégorie', addCategory: 'Ajouter une catégorie',
categoryName: 'Nom de la catégorie', categoryName: 'Nom de la catégorie',

View File

@ -1131,7 +1131,6 @@ export default {
}, },
addVariable: 'Adicionar variável', addVariable: 'Adicionar variável',
variableSettings: 'Configurações da variável', variableSettings: 'Configurações da variável',
globalVariables: 'Variáveis globais',
systemPrompt: 'Prompt do sistema', systemPrompt: 'Prompt do sistema',
addCategory: 'Adicionar categoria', addCategory: 'Adicionar categoria',
categoryName: 'Nome da categoria', categoryName: 'Nome da categoria',

View File

@ -937,7 +937,7 @@ export default {
maxRetries: 'Макс. попыток', maxRetries: 'Макс. попыток',
advancedSettings: 'Расширенные настройки', advancedSettings: 'Расширенные настройки',
addTools: 'Добавить инструменты', addTools: 'Добавить инструменты',
sysPromptDefultValue: ` sysPromptDefaultValue: `
<role> <role>
Вы полезный помощник, ИИ-ассистент, специализирующийся на решении проблем пользователя. Вы полезный помощник, ИИ-ассистент, специализирующийся на решении проблем пользователя.
Если указана конкретная область, адаптируйте вашу экспертизу к этой области; в противном случае действуйте как универсальный специалист. Если указана конкретная область, адаптируйте вашу экспертизу к этой области; в противном случае действуйте как универсальный специалист.
@ -1385,7 +1385,6 @@ export default {
}, },
addVariable: 'Добавить переменную', addVariable: 'Добавить переменную',
variableSettings: 'Настройки переменных', variableSettings: 'Настройки переменных',
globalVariables: 'Глобальные переменные',
systemPrompt: 'Системный промпт', systemPrompt: 'Системный промпт',
userPrompt: 'Пользовательский промпт', userPrompt: 'Пользовательский промпт',
addCategory: 'Добавить категорию', addCategory: 'Добавить категорию',

View File

@ -759,7 +759,7 @@ General实体和关系提取提示来自 GitHub - microsoft/graphrag基于
confirmPasswordMessage: '请确认新密码', confirmPasswordMessage: '请确认新密码',
confirmPasswordNonMatchMessage: '您输入的新密码不匹配!', confirmPasswordNonMatchMessage: '您输入的新密码不匹配!',
cancel: '取消', cancel: '取消',
addedModels: '添加的模型', addedModels: '添加的模型',
modelsToBeAdded: '待添加的模型', modelsToBeAdded: '待添加的模型',
addTheModel: '添加', addTheModel: '添加',
apiKey: 'API-Key', apiKey: 'API-Key',
@ -1011,10 +1011,10 @@ General实体和关系提取提示来自 GitHub - microsoft/graphrag基于
exceptionMethod: '异常处理方法', exceptionMethod: '异常处理方法',
maxRounds: '最大反思轮数', maxRounds: '最大反思轮数',
delayEfterError: '错误后延迟', delayEfterError: '错误后延迟',
maxRetries: '最大反思轮数', maxRetries: '最大重试轮数',
advancedSettings: '高级设置', advancedSettings: '高级设置',
addTools: '添加工具', addTools: '添加工具',
sysPromptDefultValue: ` sysPromptDefaultValue: `
<role> <role>
你是一名乐于助人的助手,一名专注于为用户解决问题的 AI 助手。 你是一名乐于助人的助手,一名专注于为用户解决问题的 AI 助手。
如果用户指定了特定领域,你需要在该领域展现专业性;如果没有,则以通用助手的方式工作。 如果用户指定了特定领域,你需要在该领域展现专业性;如果没有,则以通用助手的方式工作。

View File

@ -446,7 +446,7 @@ export const initialAgentValues = {
...initialLlmBaseValues, ...initialLlmBaseValues,
description: '', description: '',
user_prompt: '', user_prompt: '',
sys_prompt: t('flow.sysPromptDefultValue'), sys_prompt: t('flow.sysPromptDefaultValue'),
prompts: [{ role: PromptRole.User, content: `{${AgentGlobals.SysQuery}}` }], prompts: [{ role: PromptRole.User, content: `{${AgentGlobals.SysQuery}}` }],
message_history_window_size: 12, message_history_window_size: 12,
max_retries: 3, max_retries: 3,

View File

@ -212,7 +212,7 @@ function AgentForm({ node }: INextOperatorForm) {
<FormItem className="flex-1"> <FormItem className="flex-1">
<FormLabel>{t('flow.maxRetries')}</FormLabel> <FormLabel>{t('flow.maxRetries')}</FormLabel>
<FormControl> <FormControl>
<NumberInput {...field} max={8}></NumberInput> <NumberInput {...field} max={8} min={0}></NumberInput>
</FormControl> </FormControl>
</FormItem> </FormItem>
)} )}
@ -237,7 +237,7 @@ function AgentForm({ node }: INextOperatorForm) {
<FormItem className="flex-1"> <FormItem className="flex-1">
<FormLabel>{t('flow.maxRounds')}</FormLabel> <FormLabel>{t('flow.maxRounds')}</FormLabel>
<FormControl> <FormControl>
<NumberInput {...field}></NumberInput> <NumberInput {...field} min={0}></NumberInput>
</FormControl> </FormControl>
</FormItem> </FormItem>
)} )}

View File

@ -5,7 +5,7 @@ import {
FormFieldConfig, FormFieldConfig,
FormFieldType, FormFieldType,
} from '@/components/dynamic-form'; } from '@/components/dynamic-form';
import { Button } from '@/components/ui/button'; import { BlockButton, Button } from '@/components/ui/button';
import { Modal } from '@/components/ui/modal/modal'; import { Modal } from '@/components/ui/modal/modal';
import { import {
Sheet, Sheet,
@ -142,13 +142,12 @@ export const GobalParamSheet = (props: IGobalParamModalProps) => {
> >
<SheetHeader className="p-5"> <SheetHeader className="p-5">
<SheetTitle className="flex items-center gap-2.5"> <SheetTitle className="flex items-center gap-2.5">
{t('flow.gobalVariable')} {t('flow.conversationVariable')}
</SheetTitle> </SheetTitle>
</SheetHeader> </SheetHeader>
<div className="px-5 pb-5"> <div className="px-5 pb-5">
<Button <BlockButton
variant={'secondary'}
onClick={() => { onClick={() => {
setFields(GobalFormFields); setFields(GobalFormFields);
setDefaultValues(GobalVariableFormDefaultValues); setDefaultValues(GobalVariableFormDefaultValues);
@ -156,7 +155,7 @@ export const GobalParamSheet = (props: IGobalParamModalProps) => {
}} }}
> >
{t('flow.add')} {t('flow.add')}
</Button> </BlockButton>
</div> </div>
<div className="flex flex-col gap-2 px-5 "> <div className="flex flex-col gap-2 px-5 ">
@ -203,7 +202,7 @@ export const GobalParamSheet = (props: IGobalParamModalProps) => {
</div> </div>
</SheetContent> </SheetContent>
<Modal <Modal
title={t('flow.add') + t('flow.gobalVariable')} title={t('flow.add') + t('flow.conversationVariable')}
open={visible} open={visible}
onCancel={hideAddModal} onCancel={hideAddModal}
showfooter={false} showfooter={false}

View File

@ -6,7 +6,7 @@ import { DefaultOptionType } from 'antd/es/select';
import { t } from 'i18next'; import { t } from 'i18next';
import { isEmpty, toLower } from 'lodash'; import { isEmpty, toLower } from 'lodash';
import get from 'lodash/get'; import get from 'lodash/get';
import { MessageCircleCode } from 'lucide-react'; import { MessageSquareCode } from 'lucide-react';
import { useCallback, useContext, useEffect, useMemo, useState } from 'react'; import { useCallback, useContext, useEffect, useMemo, useState } from 'react';
import { import {
AgentDialogueMode, AgentDialogueMode,
@ -162,7 +162,7 @@ export function useBuildConversationVariableOptions() {
return { return {
label: keyWithPrefix, label: keyWithPrefix,
parentLabel: <span>{t('flow.conversationVariable')}</span>, parentLabel: <span>{t('flow.conversationVariable')}</span>,
icon: <MessageCircleCode className="size-3" />, icon: <MessageSquareCode className="size-3" />,
value: keyWithPrefix, value: keyWithPrefix,
type: value.type, type: value.type,
}; };

View File

@ -28,6 +28,7 @@ import {
History, History,
LaptopMinimalCheck, LaptopMinimalCheck,
Logs, Logs,
MessageSquareCode,
ScreenShare, ScreenShare,
Settings, Settings,
Upload, Upload,
@ -218,7 +219,7 @@ export default function Agent() {
onClick={() => showGobalParamSheet()} onClick={() => showGobalParamSheet()}
loading={loading} loading={loading}
> >
{t('flow.conversationVariable')} <MessageSquareCode /> {t('flow.conversationVariable')}
</ButtonLoading> </ButtonLoading>
<Button variant={'secondary'} onClick={handleButtonRunClick}> <Button variant={'secondary'} onClick={handleButtonRunClick}>
<CirclePlay /> <CirclePlay />

View File

@ -124,7 +124,7 @@ export function EditMcpDialog({
form={form} form={form}
setFieldChanged={setFieldChanged} setFieldChanged={setFieldChanged}
></EditMcpForm> ></EditMcpForm>
<Card> <Card className="bg-transparent">
<CardContent className="p-3"> <CardContent className="p-3">
<Collapse <Collapse
title={ title={

View File

@ -59,7 +59,7 @@ export default function McpServer() {
<ProfileSettingWrapperCard <ProfileSettingWrapperCard
header={ header={
<> <>
<div className="text-text-primary text-2xl font-medium"> <div className="text-text-primary text-2xl font-semibold">
{t('mcp.mcpServers')} {t('mcp.mcpServers')}
</div> </div>
<section className="flex items-center justify-between"> <section className="flex items-center justify-between">
@ -80,13 +80,13 @@ export default function McpServer() {
)} )}
{t(`mcp.${isSelectionMode ? 'exitBulkManage' : 'bulkManage'}`)} {t(`mcp.${isSelectionMode ? 'exitBulkManage' : 'bulkManage'}`)}
</Button> </Button>
<Button variant={'secondary'} onClick={showEditModal('')}> <Button variant={'secondary'} onClick={showImportModal}>
<Plus className="size-3.5" /> {t('mcp.addMCP')}
</Button>
<Button onClick={showImportModal}>
<Download className="size-3.5" /> <Download className="size-3.5" />
{t('mcp.import')} {t('mcp.import')}
</Button> </Button>
<Button onClick={showEditModal('')}>
<Plus className="size-3.5" /> {t('mcp.addMCP')}
</Button>
</div> </div>
</section> </section>
</> </>