feat(web): table ui
This commit is contained in:
@@ -12,21 +12,23 @@ const FormItem = Form.Item;
|
||||
interface CustomToolModalProps {
|
||||
refresh: () => void;
|
||||
}
|
||||
|
||||
interface OperationItem {
|
||||
method: string;
|
||||
path: string;
|
||||
summary: string;
|
||||
description: string;
|
||||
parameters: Record<string, Record<string, string | null>>
|
||||
request_body: null | string;
|
||||
responses: Record<string, Record<string, string | null>>
|
||||
tags: string[]
|
||||
}
|
||||
interface ParseSchemaData {
|
||||
title: string;
|
||||
description: string;
|
||||
version: string;
|
||||
base_url: string;
|
||||
operations: Array<{
|
||||
method: string;
|
||||
path: string;
|
||||
summary: string;
|
||||
description: string;
|
||||
parameters: Record<string, Record<string, string | null>>
|
||||
request_body: null | string;
|
||||
responses: Record<string, Record<string, string | null>>
|
||||
tags: string[]
|
||||
}>
|
||||
operations: OperationItem[]
|
||||
}
|
||||
const authTypeList = ['none', 'api_key', 'basic_auth']
|
||||
const CustomToolModal = forwardRef<CustomToolModalRef, CustomToolModalProps>(({
|
||||
@@ -170,9 +172,10 @@ const CustomToolModal = forwardRef<CustomToolModalRef, CustomToolModalProps>(({
|
||||
<Form.Item
|
||||
label={t('tool.availableTools')}
|
||||
>
|
||||
<Table
|
||||
<Table<OperationItem>
|
||||
rowKey="summary"
|
||||
pagination={false}
|
||||
bordered={true}
|
||||
columns={[
|
||||
{
|
||||
title: t('tool.name'),
|
||||
|
||||
@@ -355,9 +355,10 @@ const McpServiceModal = forwardRef<McpServiceModalRef, McpServiceModalProps>(({
|
||||
{requestHeaderList.length === 0
|
||||
? <Empty size={88} />
|
||||
:
|
||||
<Table
|
||||
<Table<RequestHeader>
|
||||
rowKey="key"
|
||||
pagination={false}
|
||||
bordered={true}
|
||||
columns={[
|
||||
{
|
||||
title: t('tool.requestHeaderName'),
|
||||
@@ -381,7 +382,7 @@ const McpServiceModal = forwardRef<McpServiceModalRef, McpServiceModalProps>(({
|
||||
<Space size="middle">
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => handleEditRequestHeader(index, record as RequestHeader)}
|
||||
onClick={() => handleEditRequestHeader(index, record)}
|
||||
>
|
||||
{t('common.edit')}
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user