mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Add authorization token field to the MCP form #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -12,7 +12,7 @@ import { IModalProps } from '@/interfaces/common';
|
||||
import { IMCPTool, IMCPToolObject } from '@/interfaces/database/mcp';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import { isEmpty, pick } from 'lodash';
|
||||
import { isEmpty, omit, pick } from 'lodash';
|
||||
import { RefreshCw } from 'lucide-react';
|
||||
import {
|
||||
MouseEventHandler,
|
||||
@ -82,10 +82,14 @@ export function EditMcpDialog({
|
||||
}, []);
|
||||
|
||||
const handleOk = async (values: z.infer<typeof FormSchema>) => {
|
||||
const nextValues = {
|
||||
...omit(values, 'authorization_token'),
|
||||
headers: { authorization_token: values.authorization_token },
|
||||
};
|
||||
if (isTriggeredBySaving) {
|
||||
onOk?.(values);
|
||||
onOk?.(nextValues);
|
||||
} else {
|
||||
const ret = await testMcpServer(values);
|
||||
const ret = await testMcpServer(nextValues);
|
||||
if (ret.code === 0) {
|
||||
setFieldChanged(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user