mirror of
https://github.com/langgenius/dify.git
synced 2026-04-28 14:38:06 +08:00
add warning of MCP editing
This commit is contained in:
@ -51,6 +51,7 @@ const MCPModal = ({
|
||||
}: DuplicateAppModalProps) => {
|
||||
const { t } = useTranslation()
|
||||
|
||||
const originalServerUrl = data?.server_url
|
||||
const [name, setName] = React.useState(data?.name || '')
|
||||
const [appIcon, setAppIcon] = useState<AppIconSelection>(getIcon(data))
|
||||
const [url, setUrl] = React.useState(data?.server_url || '')
|
||||
@ -77,7 +78,7 @@ const MCPModal = ({
|
||||
<div className='absolute right-5 top-5 z-10 cursor-pointer p-1.5' onClick={onHide}>
|
||||
<RiCloseLine className='h-5 w-5 text-text-tertiary' />
|
||||
</div>
|
||||
<div className='title-2xl-semi-bold relative pb-3 text-xl text-text-primary'>{t('tools.mcp.modal.title')}</div>
|
||||
<div className='title-2xl-semi-bold relative pb-3 text-xl text-text-primary'>{data ? t('tools.mcp.modal.editTitle') : t('tools.mcp.modal.title')}</div>
|
||||
<div className='space-y-5 py-3'>
|
||||
<div className='flex space-x-3'>
|
||||
<div className='grow pb-1'>
|
||||
@ -110,6 +111,11 @@ const MCPModal = ({
|
||||
onChange={e => setUrl(e.target.value)}
|
||||
placeholder={t('tools.mcp.modal.serverUrlPlaceholder')}
|
||||
/>
|
||||
{originalServerUrl && originalServerUrl !== url && (
|
||||
<div className='mt-1 flex h-5 items-center'>
|
||||
<span className='body-xs-regular text-text-warning'>{t('tools.mcp.modal.warning')}</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className='flex flex-row-reverse pt-5'>
|
||||
|
||||
@ -164,10 +164,12 @@ const translation = {
|
||||
noTools: 'No tools available',
|
||||
modal: {
|
||||
title: 'Add MCP Server (HTTP)',
|
||||
editTitle: 'Edit MCP Server (HTTP)',
|
||||
name: 'Name & Icon',
|
||||
namePlaceholder: 'Name your MCP server',
|
||||
serverUrl: 'Server URL',
|
||||
serverUrlPlaceholder: 'URL to server endpiont',
|
||||
warning: 'Updating the server address may affect applications currently using this MCP',
|
||||
cancel: 'Cancel',
|
||||
save: 'Save',
|
||||
confirm: 'Add & Authorize',
|
||||
|
||||
@ -164,10 +164,12 @@ const translation = {
|
||||
noTools: '没有可用的工具',
|
||||
modal: {
|
||||
title: '添加 MCP 服务 (HTTP)',
|
||||
editTitle: '修改 MCP 服务 (HTTP)',
|
||||
name: '名称和图标',
|
||||
namePlaceholder: '命名你的 MCP 服务',
|
||||
serverUrl: '服务端点 URL',
|
||||
serverUrlPlaceholder: '服务端点的 URL',
|
||||
warning: '修改服务端点 URL 可能会影响使用当前 MCP 的应用。',
|
||||
cancel: '取消',
|
||||
save: '保存',
|
||||
confirm: '添加并授权',
|
||||
|
||||
Reference in New Issue
Block a user