mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Fix: Add prompt text to the form in the MCP module (#9222)
### What problem does this PR solve? Fix: Add prompt text to the form in the MCP module #3221 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -39,6 +39,13 @@ export default {
|
|||||||
nextPage: 'Next',
|
nextPage: 'Next',
|
||||||
add: 'Add',
|
add: 'Add',
|
||||||
promptPlaceholder: `Please input or use / to quickly insert variables.`,
|
promptPlaceholder: `Please input or use / to quickly insert variables.`,
|
||||||
|
mcp: {
|
||||||
|
namePlaceholder: 'My MCP Server',
|
||||||
|
nameRequired:
|
||||||
|
'It must be 1–64 characters long and can only contain letters, numbers, hyphens, and underscores.',
|
||||||
|
urlPlaceholder: 'https://api.example.com/v1/mcp',
|
||||||
|
tokenPlaceholder: 'e.g. eyJhbGciOiJIUzI1Ni...',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
login: {
|
login: {
|
||||||
login: 'Sign in',
|
login: 'Sign in',
|
||||||
|
|||||||
@ -37,20 +37,23 @@ export function useBuildFormSchema() {
|
|||||||
name: z
|
name: z
|
||||||
.string()
|
.string()
|
||||||
.min(1, {
|
.min(1, {
|
||||||
message: t('common.namePlaceholder'),
|
message: t('common.mcp.namePlaceholder'),
|
||||||
|
})
|
||||||
|
.regex(/^[a-zA-Z0-9_-]{1,64}$/, {
|
||||||
|
message: t('common.mcp.nameRequired'),
|
||||||
})
|
})
|
||||||
.trim(),
|
.trim(),
|
||||||
url: z
|
url: z
|
||||||
.string()
|
.string()
|
||||||
.url()
|
.url()
|
||||||
.min(1, {
|
.min(1, {
|
||||||
message: t('common.namePlaceholder'),
|
message: t('common.mcp.urlPlaceholder'),
|
||||||
})
|
})
|
||||||
.trim(),
|
.trim(),
|
||||||
server_type: z
|
server_type: z
|
||||||
.string()
|
.string()
|
||||||
.min(1, {
|
.min(1, {
|
||||||
message: t('common.namePlaceholder'),
|
message: t('common.pleaseSelect'),
|
||||||
})
|
})
|
||||||
.trim(),
|
.trim(),
|
||||||
authorization_token: z.string().optional(),
|
authorization_token: z.string().optional(),
|
||||||
@ -89,7 +92,7 @@ export function EditMcpForm({
|
|||||||
<FormLabel>{t('common.name')}</FormLabel>
|
<FormLabel>{t('common.name')}</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input
|
<Input
|
||||||
placeholder={t('common.namePlaceholder')}
|
placeholder={t('common.mcp.namePlaceholder')}
|
||||||
{...field}
|
{...field}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
/>
|
/>
|
||||||
@ -106,7 +109,7 @@ export function EditMcpForm({
|
|||||||
<FormLabel>{t('mcp.url')}</FormLabel>
|
<FormLabel>{t('mcp.url')}</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input
|
<Input
|
||||||
placeholder={t('common.namePlaceholder')}
|
placeholder={t('common.mcp.urlPlaceholder')}
|
||||||
{...field}
|
{...field}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
@ -148,7 +151,7 @@ export function EditMcpForm({
|
|||||||
<FormLabel>Authorization Token</FormLabel>
|
<FormLabel>Authorization Token</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input
|
<Input
|
||||||
placeholder={t('common.namePlaceholder')}
|
placeholder={t('common.mcp.tokenPlaceholder')}
|
||||||
{...field}
|
{...field}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
type="password"
|
type="password"
|
||||||
|
|||||||
Reference in New Issue
Block a user