mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Filter MCP server list by text. #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -11,8 +11,15 @@ import {
|
|||||||
ITestMcpRequestBody,
|
ITestMcpRequestBody,
|
||||||
} from '@/interfaces/request/mcp';
|
} from '@/interfaces/request/mcp';
|
||||||
import i18n from '@/locales/config';
|
import i18n from '@/locales/config';
|
||||||
import mcpServerService from '@/services/mcp-server-service';
|
import mcpServerService, {
|
||||||
|
listMcpServers,
|
||||||
|
} from '@/services/mcp-server-service';
|
||||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
||||||
|
import { useDebounce } from 'ahooks';
|
||||||
|
import {
|
||||||
|
useGetPaginationWithRouter,
|
||||||
|
useHandleSearchChange,
|
||||||
|
} from './logic-hooks';
|
||||||
|
|
||||||
export const enum McpApiAction {
|
export const enum McpApiAction {
|
||||||
ListMcpServer = 'listMcpServer',
|
ListMcpServer = 'listMcpServer',
|
||||||
@ -29,17 +36,38 @@ export const enum McpApiAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const useListMcpServer = () => {
|
export const useListMcpServer = () => {
|
||||||
|
const { searchString, handleInputChange } = useHandleSearchChange();
|
||||||
|
const { pagination, setPagination } = useGetPaginationWithRouter();
|
||||||
|
const debouncedSearchString = useDebounce(searchString, { wait: 500 });
|
||||||
|
|
||||||
const { data, isFetching: loading } = useQuery<IMcpServerListResponse>({
|
const { data, isFetching: loading } = useQuery<IMcpServerListResponse>({
|
||||||
queryKey: [McpApiAction.ListMcpServer],
|
queryKey: [
|
||||||
|
McpApiAction.ListMcpServer,
|
||||||
|
{
|
||||||
|
debouncedSearchString,
|
||||||
|
...pagination,
|
||||||
|
},
|
||||||
|
],
|
||||||
initialData: { total: 0, mcp_servers: [] },
|
initialData: { total: 0, mcp_servers: [] },
|
||||||
gcTime: 0,
|
gcTime: 0,
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const { data } = await mcpServerService.list({});
|
const { data } = await listMcpServers({
|
||||||
|
keywords: debouncedSearchString,
|
||||||
|
page_size: pagination.pageSize,
|
||||||
|
page: pagination.current,
|
||||||
|
});
|
||||||
return data?.data;
|
return data?.data;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
return { data, loading };
|
return {
|
||||||
|
data,
|
||||||
|
loading,
|
||||||
|
handleInputChange,
|
||||||
|
setPagination,
|
||||||
|
searchString,
|
||||||
|
pagination: { ...pagination, total: data?.total },
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export const useGetMcpServer = (id: string) => {
|
export const useGetMcpServer = (id: string) => {
|
||||||
@ -191,12 +219,12 @@ export const useTestMcpServer = () => {
|
|||||||
data,
|
data,
|
||||||
isPending: loading,
|
isPending: loading,
|
||||||
mutateAsync,
|
mutateAsync,
|
||||||
} = useMutation<IMCPTool[], Error, ITestMcpRequestBody>({
|
} = useMutation<ResponseType<IMCPTool[]>, Error, ITestMcpRequestBody>({
|
||||||
mutationKey: [McpApiAction.TestMcpServer],
|
mutationKey: [McpApiAction.TestMcpServer],
|
||||||
mutationFn: async (params) => {
|
mutationFn: async (params) => {
|
||||||
const { data } = await mcpServerService.test(params);
|
const { data } = await mcpServerService.test(params);
|
||||||
|
|
||||||
return data?.data || [];
|
return data;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1307,6 +1307,8 @@ This delimiter is used to split the input text into several text pieces echo of
|
|||||||
export: 'Export',
|
export: 'Export',
|
||||||
import: 'Import',
|
import: 'Import',
|
||||||
addMcp: 'Add MCP',
|
addMcp: 'Add MCP',
|
||||||
|
url: 'URL',
|
||||||
|
serverType: 'Server Type',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -10,10 +10,17 @@ import {
|
|||||||
import { useGetMcpServer, useTestMcpServer } from '@/hooks/use-mcp-request';
|
import { useGetMcpServer, useTestMcpServer } from '@/hooks/use-mcp-request';
|
||||||
import { IModalProps } from '@/interfaces/common';
|
import { IModalProps } from '@/interfaces/common';
|
||||||
import { IMCPTool, IMCPToolObject } from '@/interfaces/database/mcp';
|
import { IMCPTool, IMCPToolObject } from '@/interfaces/database/mcp';
|
||||||
|
import { cn } from '@/lib/utils';
|
||||||
import { zodResolver } from '@hookform/resolvers/zod';
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
import { isEmpty, omit, pick } from 'lodash';
|
import { isEmpty, pick } from 'lodash';
|
||||||
import { RefreshCw } from 'lucide-react';
|
import { RefreshCw } from 'lucide-react';
|
||||||
import { MouseEventHandler, useCallback, useMemo, useState } from 'react';
|
import {
|
||||||
|
MouseEventHandler,
|
||||||
|
useCallback,
|
||||||
|
useEffect,
|
||||||
|
useMemo,
|
||||||
|
useState,
|
||||||
|
} from 'react';
|
||||||
import { useForm } from 'react-hook-form';
|
import { useForm } from 'react-hook-form';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
@ -25,13 +32,6 @@ import {
|
|||||||
} from './edit-mcp-form';
|
} from './edit-mcp-form';
|
||||||
import { McpToolCard } from './tool-card';
|
import { McpToolCard } from './tool-card';
|
||||||
|
|
||||||
function transferToolToObject(tools: IMCPTool[] = []) {
|
|
||||||
return tools.reduce<IMCPToolObject>((pre, tool) => {
|
|
||||||
pre[tool.name] = omit(tool, 'name');
|
|
||||||
return pre;
|
|
||||||
}, {});
|
|
||||||
}
|
|
||||||
|
|
||||||
function transferToolToArray(tools: IMCPToolObject) {
|
function transferToolToArray(tools: IMCPToolObject) {
|
||||||
return Object.entries(tools).reduce<IMCPTool[]>((pre, [name, tool]) => {
|
return Object.entries(tools).reduce<IMCPTool[]>((pre, [name, tool]) => {
|
||||||
pre.push({ ...tool, name });
|
pre.push({ ...tool, name });
|
||||||
@ -39,6 +39,12 @@ function transferToolToArray(tools: IMCPToolObject) {
|
|||||||
}, []);
|
}, []);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const DefaultValues = {
|
||||||
|
name: '',
|
||||||
|
server_type: ServerType.SSE,
|
||||||
|
url: '',
|
||||||
|
};
|
||||||
|
|
||||||
export function EditMcpDialog({
|
export function EditMcpDialog({
|
||||||
hideModal,
|
hideModal,
|
||||||
loading,
|
loading,
|
||||||
@ -48,19 +54,22 @@ export function EditMcpDialog({
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const {
|
const {
|
||||||
testMcpServer,
|
testMcpServer,
|
||||||
data: tools,
|
data: testData,
|
||||||
loading: testLoading,
|
loading: testLoading,
|
||||||
} = useTestMcpServer();
|
} = useTestMcpServer();
|
||||||
const [isTriggeredBySaving, setIsTriggeredBySaving] = useState(false);
|
const [isTriggeredBySaving, setIsTriggeredBySaving] = useState(false);
|
||||||
const FormSchema = useBuildFormSchema();
|
const FormSchema = useBuildFormSchema();
|
||||||
const [collapseOpen, setCollapseOpen] = useState(true);
|
const [collapseOpen, setCollapseOpen] = useState(true);
|
||||||
const { data } = useGetMcpServer(id);
|
const { data } = useGetMcpServer(id);
|
||||||
|
const [fieldChanged, setFieldChanged] = useState(false);
|
||||||
|
|
||||||
|
const tools = useMemo(() => {
|
||||||
|
return testData?.data || [];
|
||||||
|
}, [testData?.data]);
|
||||||
|
|
||||||
const form = useForm<z.infer<typeof FormSchema>>({
|
const form = useForm<z.infer<typeof FormSchema>>({
|
||||||
resolver: zodResolver(FormSchema),
|
resolver: zodResolver(FormSchema),
|
||||||
values: isEmpty(data)
|
defaultValues: DefaultValues,
|
||||||
? { name: '', server_type: ServerType.SSE, url: '' }
|
|
||||||
: pick(data, ['name', 'server_type', 'url']),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleTest: MouseEventHandler<HTMLButtonElement> = useCallback((e) => {
|
const handleTest: MouseEventHandler<HTMLButtonElement> = useCallback((e) => {
|
||||||
@ -74,35 +83,42 @@ export function EditMcpDialog({
|
|||||||
|
|
||||||
const handleOk = async (values: z.infer<typeof FormSchema>) => {
|
const handleOk = async (values: z.infer<typeof FormSchema>) => {
|
||||||
if (isTriggeredBySaving) {
|
if (isTriggeredBySaving) {
|
||||||
onOk?.({
|
onOk?.(values);
|
||||||
...values,
|
|
||||||
variables: {
|
|
||||||
...(values?.variables || {}),
|
|
||||||
tools: transferToolToObject(tools),
|
|
||||||
},
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
testMcpServer(values);
|
const ret = await testMcpServer(values);
|
||||||
|
if (ret.code === 0) {
|
||||||
|
setFieldChanged(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!isEmpty(data)) {
|
||||||
|
form.reset(pick(data, ['name', 'server_type', 'url']));
|
||||||
|
}
|
||||||
|
}, [data, form]);
|
||||||
|
|
||||||
const nextTools = useMemo(() => {
|
const nextTools = useMemo(() => {
|
||||||
return tools || transferToolToArray(data.variables?.tools || {});
|
return isEmpty(tools)
|
||||||
|
? transferToolToArray(data.variables?.tools || {})
|
||||||
|
: tools;
|
||||||
}, [data.variables?.tools, tools]);
|
}, [data.variables?.tools, tools]);
|
||||||
|
|
||||||
const dirtyFields = form.formState.dirtyFields;
|
|
||||||
const fieldChanged = 'server_type' in dirtyFields || 'url' in dirtyFields;
|
|
||||||
const disabled = !!!tools?.length || testLoading || fieldChanged;
|
const disabled = !!!tools?.length || testLoading || fieldChanged;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open onOpenChange={hideModal}>
|
<Dialog open onOpenChange={hideModal}>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
<DialogTitle>Edit profile</DialogTitle>
|
<DialogTitle>{t('common.edit')}</DialogTitle>
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
<EditMcpForm onOk={handleOk} form={form}></EditMcpForm>
|
<EditMcpForm
|
||||||
|
onOk={handleOk}
|
||||||
|
form={form}
|
||||||
|
setFieldChanged={setFieldChanged}
|
||||||
|
></EditMcpForm>
|
||||||
<Collapse
|
<Collapse
|
||||||
title={<div>{tools?.length || 0} tools available</div>}
|
title={<div>{nextTools?.length || 0} tools available</div>}
|
||||||
open={collapseOpen}
|
open={collapseOpen}
|
||||||
onOpenChange={setCollapseOpen}
|
onOpenChange={setCollapseOpen}
|
||||||
rightContent={
|
rightContent={
|
||||||
@ -112,7 +128,11 @@ export function EditMcpDialog({
|
|||||||
type="submit"
|
type="submit"
|
||||||
onClick={handleTest}
|
onClick={handleTest}
|
||||||
>
|
>
|
||||||
<RefreshCw className="text-background-checked" />
|
<RefreshCw
|
||||||
|
className={cn('text-background-checked', {
|
||||||
|
'animate-spin': testLoading,
|
||||||
|
})}
|
||||||
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -15,6 +15,7 @@ import { Input } from '@/components/ui/input';
|
|||||||
import { RAGFlowSelect } from '@/components/ui/select';
|
import { RAGFlowSelect } from '@/components/ui/select';
|
||||||
import { IModalProps } from '@/interfaces/common';
|
import { IModalProps } from '@/interfaces/common';
|
||||||
import { buildOptions } from '@/utils/form';
|
import { buildOptions } from '@/utils/form';
|
||||||
|
import { Dispatch, SetStateAction } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
export const FormId = 'EditMcpForm';
|
export const FormId = 'EditMcpForm';
|
||||||
@ -38,6 +39,7 @@ export function useBuildFormSchema() {
|
|||||||
.trim(),
|
.trim(),
|
||||||
url: z
|
url: z
|
||||||
.string()
|
.string()
|
||||||
|
.url()
|
||||||
.min(1, {
|
.min(1, {
|
||||||
message: t('common.namePlaceholder'),
|
message: t('common.namePlaceholder'),
|
||||||
})
|
})
|
||||||
@ -48,7 +50,7 @@ export function useBuildFormSchema() {
|
|||||||
message: t('common.namePlaceholder'),
|
message: t('common.namePlaceholder'),
|
||||||
})
|
})
|
||||||
.trim(),
|
.trim(),
|
||||||
variables: z.object({}).optional(),
|
// variables: z.object({}).optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
return FormSchema;
|
return FormSchema;
|
||||||
@ -57,7 +59,11 @@ export function useBuildFormSchema() {
|
|||||||
export function EditMcpForm({
|
export function EditMcpForm({
|
||||||
form,
|
form,
|
||||||
onOk,
|
onOk,
|
||||||
}: IModalProps<any> & { form: UseFormReturn<any> }) {
|
setFieldChanged,
|
||||||
|
}: IModalProps<any> & {
|
||||||
|
form: UseFormReturn<any>;
|
||||||
|
setFieldChanged: Dispatch<SetStateAction<boolean>>;
|
||||||
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const FormSchema = useBuildFormSchema();
|
const FormSchema = useBuildFormSchema();
|
||||||
|
|
||||||
@ -94,12 +100,16 @@ export function EditMcpForm({
|
|||||||
name="url"
|
name="url"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>{t('common.url')}</FormLabel>
|
<FormLabel>{t('mcp.url')}</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input
|
<Input
|
||||||
placeholder={t('common.namePlaceholder')}
|
placeholder={t('common.namePlaceholder')}
|
||||||
{...field}
|
{...field}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
|
onChange={(e) => {
|
||||||
|
field.onChange(e.target.value.trim());
|
||||||
|
setFieldChanged(true);
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
@ -111,12 +121,16 @@ export function EditMcpForm({
|
|||||||
name="server_type"
|
name="server_type"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>{t('common.serverType')}</FormLabel>
|
<FormLabel>{t('mcp.serverType')}</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<RAGFlowSelect
|
<RAGFlowSelect
|
||||||
{...field}
|
{...field}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
options={ServerTypeOptions}
|
options={ServerTypeOptions}
|
||||||
|
onChange={(value) => {
|
||||||
|
field.onChange(value);
|
||||||
|
setFieldChanged(true);
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
|
|||||||
@ -1,8 +1,11 @@
|
|||||||
import { BulkOperateBar } from '@/components/bulk-operate-bar';
|
import { BulkOperateBar } from '@/components/bulk-operate-bar';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { SearchInput } from '@/components/ui/input';
|
import { SearchInput } from '@/components/ui/input';
|
||||||
|
import { RAGFlowPagination } from '@/components/ui/ragflow-pagination';
|
||||||
import { useListMcpServer } from '@/hooks/use-mcp-request';
|
import { useListMcpServer } from '@/hooks/use-mcp-request';
|
||||||
|
import { pick } from 'lodash';
|
||||||
import { Import, Plus } from 'lucide-react';
|
import { Import, Plus } from 'lucide-react';
|
||||||
|
import { useCallback } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { EditMcpDialog } from './edit-mcp-dialog';
|
import { EditMcpDialog } from './edit-mcp-dialog';
|
||||||
import { ImportMcpDialog } from './import-mcp-dialog';
|
import { ImportMcpDialog } from './import-mcp-dialog';
|
||||||
@ -12,14 +15,22 @@ import { useEditMcp } from './use-edit-mcp';
|
|||||||
import { useImportMcp } from './use-import-mcp';
|
import { useImportMcp } from './use-import-mcp';
|
||||||
|
|
||||||
export default function McpServer() {
|
export default function McpServer() {
|
||||||
const { data } = useListMcpServer();
|
const { data, setPagination, searchString, handleInputChange, pagination } =
|
||||||
const { editVisible, showEditModal, hideEditModal, handleOk, id } =
|
useListMcpServer();
|
||||||
|
const { editVisible, showEditModal, hideEditModal, handleOk, id, loading } =
|
||||||
useEditMcp();
|
useEditMcp();
|
||||||
const { list, selectedList, handleSelectChange } = useBulkOperateMCP();
|
const { list, selectedList, handleSelectChange } = useBulkOperateMCP();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { importVisible, showImportModal, hideImportModal, onImportOk } =
|
const { importVisible, showImportModal, hideImportModal, onImportOk } =
|
||||||
useImportMcp();
|
useImportMcp();
|
||||||
|
|
||||||
|
const handlePageChange = useCallback(
|
||||||
|
(page: number, pageSize?: number) => {
|
||||||
|
setPagination({ page, pageSize });
|
||||||
|
},
|
||||||
|
[setPagination],
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="p-4">
|
<section className="p-4">
|
||||||
<div className="text-text-title text-2xl">MCP Servers</div>
|
<div className="text-text-title text-2xl">MCP Servers</div>
|
||||||
@ -28,7 +39,11 @@ export default function McpServer() {
|
|||||||
Customize the list of MCP servers
|
Customize the list of MCP servers
|
||||||
</div>
|
</div>
|
||||||
<div className="flex gap-5">
|
<div className="flex gap-5">
|
||||||
<SearchInput className="w-40"></SearchInput>
|
<SearchInput
|
||||||
|
className="w-40"
|
||||||
|
value={searchString}
|
||||||
|
onChange={handleInputChange}
|
||||||
|
></SearchInput>
|
||||||
<Button variant={'secondary'} onClick={showImportModal}>
|
<Button variant={'secondary'} onClick={showImportModal}>
|
||||||
<Import /> {t('mcp.import')}
|
<Import /> {t('mcp.import')}
|
||||||
</Button>
|
</Button>
|
||||||
@ -37,6 +52,7 @@ export default function McpServer() {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{selectedList.length > 0 && (
|
{selectedList.length > 0 && (
|
||||||
<BulkOperateBar
|
<BulkOperateBar
|
||||||
list={list}
|
list={list}
|
||||||
@ -55,11 +71,19 @@ export default function McpServer() {
|
|||||||
></McpCard>
|
></McpCard>
|
||||||
))}
|
))}
|
||||||
</section>
|
</section>
|
||||||
|
<div className="mt-8 px-8">
|
||||||
|
<RAGFlowPagination
|
||||||
|
{...pick(pagination, 'current', 'pageSize')}
|
||||||
|
total={pagination.total || 0}
|
||||||
|
onChange={handlePageChange}
|
||||||
|
></RAGFlowPagination>
|
||||||
|
</div>
|
||||||
{editVisible && (
|
{editVisible && (
|
||||||
<EditMcpDialog
|
<EditMcpDialog
|
||||||
hideModal={hideEditModal}
|
hideModal={hideEditModal}
|
||||||
onOk={handleOk}
|
onOk={handleOk}
|
||||||
id={id}
|
id={id}
|
||||||
|
loading={loading}
|
||||||
></EditMcpDialog>
|
></EditMcpDialog>
|
||||||
)}
|
)}
|
||||||
{importVisible && (
|
{importVisible && (
|
||||||
|
|||||||
@ -14,7 +14,7 @@ export const useEditMcp = () => {
|
|||||||
const { createMcpServer, loading } = useCreateMcpServer();
|
const { createMcpServer, loading } = useCreateMcpServer();
|
||||||
const [id, setId] = useState('');
|
const [id, setId] = useState('');
|
||||||
|
|
||||||
const { updateMcpServer } = useUpdateMcpServer();
|
const { updateMcpServer, loading: updateLoading } = useUpdateMcpServer();
|
||||||
|
|
||||||
const handleShowModal = useCallback(
|
const handleShowModal = useCallback(
|
||||||
(id: string) => () => {
|
(id: string) => () => {
|
||||||
@ -28,7 +28,7 @@ export const useEditMcp = () => {
|
|||||||
async (values: any) => {
|
async (values: any) => {
|
||||||
let code;
|
let code;
|
||||||
if (id) {
|
if (id) {
|
||||||
code = await updateMcpServer(values);
|
code = await updateMcpServer({ ...values, mcp_id: id });
|
||||||
} else {
|
} else {
|
||||||
code = await createMcpServer(values);
|
code = await createMcpServer(values);
|
||||||
}
|
}
|
||||||
@ -43,7 +43,7 @@ export const useEditMcp = () => {
|
|||||||
editVisible,
|
editVisible,
|
||||||
hideEditModal,
|
hideEditModal,
|
||||||
showEditModal: handleShowModal,
|
showEditModal: handleShowModal,
|
||||||
loading,
|
loading: loading || updateLoading,
|
||||||
createMcpServer,
|
createMcpServer,
|
||||||
handleOk,
|
handleOk,
|
||||||
id,
|
id,
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import { IPaginationRequestBody } from '@/interfaces/request/base';
|
||||||
import api from '@/utils/api';
|
import api from '@/utils/api';
|
||||||
import registerServer from '@/utils/register-server';
|
import registerServer from '@/utils/register-server';
|
||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
@ -66,3 +67,6 @@ const methods = {
|
|||||||
const mcpServerService = registerServer<keyof typeof methods>(methods, request);
|
const mcpServerService = registerServer<keyof typeof methods>(methods, request);
|
||||||
|
|
||||||
export default mcpServerService;
|
export default mcpServerService;
|
||||||
|
|
||||||
|
export const listMcpServers = (params?: IPaginationRequestBody, body?: any) =>
|
||||||
|
request.post(api.listMcpServer, { data: body || {}, params });
|
||||||
|
|||||||
Reference in New Issue
Block a user