diff --git a/web/src/components/Table/index.tsx b/web/src/components/Table/index.tsx index 578bbd1b..d33f8171 100644 --- a/web/src/components/Table/index.tsx +++ b/web/src/components/Table/index.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-02-02 15:29:46 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-03-24 16:12:56 + * @Last Modified time: 2026-03-25 17:11:55 */ /** * RbTable Component @@ -30,21 +30,21 @@ import Empty from '@/components/Empty'; interface TablePaginationConfig { pagesize: number; page: number; } /** Props interface for Table component */ -interface TableComponentProps extends Omit { +interface TableComponentProps, Q = Record> extends Omit, 'pagination'> { /** Table column definitions */ - columns: ColumnsType; + columns: ColumnsType; /** API endpoint URL for data fetching */ apiUrl?: string; /** Query parameters for API request */ - apiParams?: Record; + apiParams?: Q; /** Pagination configuration or boolean to enable/disable */ pagination?: boolean | TablePaginationConfig; /** Key to use for row identification */ rowKey: string; /** Row selection configuration */ - rowSelection?: TableProps['rowSelection']; + rowSelection?: TableProps['rowSelection']; /** Initial data to display (used when no API) */ - initialData?: Record[]; + initialData?: T[]; /** Size of empty state icon */ emptySize?: number; /** Custom empty state text */ @@ -81,7 +81,7 @@ const dealSo = (params: any) => { } /** Table component with pagination and API integration */ -const RbTable = forwardRef(({ +const RbTable = forwardRef(, Q = Record>({ columns, apiUrl, apiParams, @@ -96,9 +96,9 @@ const RbTable = forwardRef(({ scrollY, currentPageKey = 'page', ...props -}, ref) => { +}: TableComponentProps, ref: React.Ref) => { const { t } = useTranslation(); - const [data, setData] = useState[]>(initialData || []) + const [data, setData] = useState(initialData || []) const [loading, setLoading] = useState(false) const [currentPagination, setCurrentPagination] = useState({ page: 1, @@ -122,7 +122,7 @@ const RbTable = forwardRef(({ }) } } - + /** Fetch data from API with pagination */ const getList = (pageData: TablePaginationConfig) => { if (!apiUrl) { @@ -134,7 +134,7 @@ const RbTable = forwardRef(({ ...currentPagination, ...pageData, }) - params = { ...params, ...pageData, [currentPageKey]: pageData.page} + params = { ...params, ...pageData, [currentPageKey]: pageData.page } } setLoading(true) /** Build query parameters and call API */ @@ -151,7 +151,7 @@ const RbTable = forwardRef(({ setLoading(false) }) } - + /** Reload data when initialized or apiParams changes */ useEffect(() => { loadData() @@ -164,7 +164,7 @@ const RbTable = forwardRef(({ pagesize }) } - + /** Pagination configuration with i18n support */ const paginationConfig = pagination ? ({ ...(typeof pagination === 'object' ? pagination : {}), @@ -173,7 +173,7 @@ const RbTable = forwardRef(({ onChange: handlePageChange, showSizeChanger: true, showQuickJumper: true, - showTotal: (totalCount: number) => t('table.totalRecords', {total: totalCount}) + showTotal: (totalCount: number) => t('table.totalRecords', { total: totalCount }) }) : false; @@ -186,27 +186,27 @@ const RbTable = forwardRef(({ /** Calculate scroll configuration based on props */ const getScrollConfig = () => { if (!isScroll && !scrollX && !scrollY) return undefined; - + const config: { x?: number | string | true; y?: number | string } = {}; - + /** Only apply horizontal scroll when there is data */ if (scrollX !== undefined && data.length > 0) { config.x = scrollX; } else if (isScroll) { config.x = 'max-content'; } - + if (scrollY !== undefined) { config.y = scrollY; } else if (isScroll) { - config.y = 'calc(100vh - 256px)'; + config.y = 'calc(100vh - 232px)'; } - + return Object.keys(config).length > 0 ? config : undefined; }; return ( - {...props} rowKey={rowKey} loading={loading} @@ -219,6 +219,6 @@ const RbTable = forwardRef(({ tableLayout="auto" /> ); -}); +}) as , Q = Record>(props: TableComponentProps & { ref?: React.Ref }) => React.ReactElement; export default RbTable; \ No newline at end of file diff --git a/web/src/i18n/en.ts b/web/src/i18n/en.ts index b6e474e6..0900e8d8 100644 --- a/web/src/i18n/en.ts +++ b/web/src/i18n/en.ts @@ -1444,6 +1444,7 @@ export const en = { noShareAuth: 'No permission to share apps', appCount: '{{count}} apps shared to this space', resetFeaturesTip: 'Please reconfigure the [Conversation Features - File Upload] settings', + logTitle: 'Description', }, userMemory: { userMemory: 'User Memory', diff --git a/web/src/i18n/zh.ts b/web/src/i18n/zh.ts index b6159e8e..140e3009 100644 --- a/web/src/i18n/zh.ts +++ b/web/src/i18n/zh.ts @@ -819,6 +819,7 @@ export const zh = { noShareAuth: '无共享应用的权限', appCount: '{{count}}个应用共享到此空间', resetFeaturesTip: '请重新配置【对话功能-文件上传】功能', + logTitle: '描述', }, table: { totalRecords: '共 {{total}} 条记录' diff --git a/web/src/styles/index.css b/web/src/styles/index.css index 5d66c8cb..b928b939 100644 --- a/web/src/styles/index.css +++ b/web/src/styles/index.css @@ -156,6 +156,19 @@ body { border-radius: 12px; border: none; } + +.ant-table-wrapper .ant-table.ant-table-bordered { + border-radius: 12px; +} +.ant-table-wrapper table.ant-table-bordered { + border-radius: 12px; +} +.ant-table-bordered .ant-table-row:last-child .ant-table-cell:first-child { + border-bottom-left-radius: 12px; +} +.ant-table-bordered .ant-table-row:last-child .ant-table-cell:last-child { + border-bottom-right-radius: 12px; +} .ant-table-wrapper table { border-radius: 12px; } @@ -200,6 +213,18 @@ body { .table-header.ant-table-wrapper .ant-table-thead>tr>th, .table-header.ant-table-wrapper .ant-table-thead>tr>td { background-color: #F6F6F6; + border-bottom: 1px solid #EBEBEB; +} +.ant-table-wrapper .ant-table-bordered .ant-table-thead>tr>th, +.ant-table-wrapper .ant-table-bordered .ant-table-thead>tr>td, +.table-header.ant-table-wrapper .ant-table-bordered .ant-table-thead>tr>th, +.table-header.ant-table-wrapper .ant-table-bordered .ant-table-thead>tr>td { + background-color: #FFFFFF; + font-weight: 500; +} +.ant-table-wrapper .ant-table.ant-table-small.ant-table-bordered .ant-table-tbody>tr>th, +.ant-table-wrapper .ant-table.ant-table-small.ant-table-bordered .ant-table-tbody>tr>td { + color: #171719; } .ant-table-wrapper .ant-btn { height: 24px; diff --git a/web/src/views/ApplicationConfig/Logs.tsx b/web/src/views/ApplicationConfig/Logs.tsx index 5dc75baf..88fa2607 100644 --- a/web/src/views/ApplicationConfig/Logs.tsx +++ b/web/src/views/ApplicationConfig/Logs.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-03-24 15:41:20 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-03-24 16:06:44 + * @Last Modified time: 2026-03-25 16:20:32 */ import { type FC, useRef } from 'react'; import { useTranslation } from 'react-i18next'; @@ -26,7 +26,7 @@ const Statistics: FC = () => { } /** Table column configuration */ - const columns: ColumnsType = [ + const columns: ColumnsType = [ { title: t('application.logTitle'), dataIndex: 'title', @@ -62,7 +62,7 @@ const Statistics: FC = () => { ]; return (
-
apiUrl={getAppLogsUrl(id || '')} apiParams={{ is_draft: false, diff --git a/web/src/views/ApplicationConfig/components/VariableList/VariableList.tsx b/web/src/views/ApplicationConfig/components/VariableList/VariableList.tsx index 6f72c0da..9f7f71f5 100644 --- a/web/src/views/ApplicationConfig/components/VariableList/VariableList.tsx +++ b/web/src/views/ApplicationConfig/components/VariableList/VariableList.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-02-03 16:26:32 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-02-25 15:09:09 + * @Last Modified time: 2026-03-25 17:10:30 */ /** * Variable List Component @@ -78,9 +78,10 @@ interface VariableListProps { <> {fields.length > 0 ? (
-
size="small" rowKey="index" + bordered={true} pagination={false} columns={[ { @@ -123,7 +124,7 @@ interface VariableListProps { ), }, ]} - initialData={value as unknown as Record[]} + initialData={value} emptySize={88} /> diff --git a/web/src/views/MemberManagement/index.tsx b/web/src/views/MemberManagement/index.tsx index 2f103c48..f1f6c0b5 100644 --- a/web/src/views/MemberManagement/index.tsx +++ b/web/src/views/MemberManagement/index.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-02-03 16:42:12 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-03-24 16:49:45 + * @Last Modified time: 2026-03-25 16:25:23 */ /** * Member Management Page @@ -13,7 +13,6 @@ import React, { useRef } from 'react'; import { App, Button, Space, Flex } from 'antd'; import { useTranslation } from 'react-i18next'; import type { ColumnsType } from 'antd/es/table'; -import type { AnyObject } from 'antd/es/_util/type'; import { deleteMember, memberListUrl } from '@/api/member'; import MemberModal from './components/MemberModal'; @@ -61,7 +60,7 @@ const MemberManagement: React.FC = () => { }; /** Table column configuration */ - const columns: ColumnsType = [ + const columns: ColumnsType = [ { title: t('member.username'), dataIndex: 'username', @@ -89,15 +88,15 @@ const MemberManagement: React.FC = () => { { title: t('common.operation'), key: 'action', - render: (_, record: AnyObject) => ( + render: (_, record) => ( - @@ -112,7 +111,7 @@ const MemberManagement: React.FC = () => { {t('member.createMember')} -
ref={tableRef} apiUrl={memberListUrl} columns={columns} diff --git a/web/src/views/ToolManagement/components/CustomToolModal.tsx b/web/src/views/ToolManagement/components/CustomToolModal.tsx index 0ea8aca9..cbcddb7c 100644 --- a/web/src/views/ToolManagement/components/CustomToolModal.tsx +++ b/web/src/views/ToolManagement/components/CustomToolModal.tsx @@ -12,21 +12,23 @@ const FormItem = Form.Item; interface CustomToolModalProps { refresh: () => void; } + +interface OperationItem { + method: string; + path: string; + summary: string; + description: string; + parameters: Record> + request_body: null | string; + responses: Record> + 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> - request_body: null | string; - responses: Record> - tags: string[] - }> + operations: OperationItem[] } const authTypeList = ['none', 'api_key', 'basic_auth'] const CustomToolModal = forwardRef(({ @@ -170,9 +172,10 @@ const CustomToolModal = forwardRef(({ -
rowKey="summary" pagination={false} + bordered={true} columns={[ { title: t('tool.name'), diff --git a/web/src/views/ToolManagement/components/McpServiceModal.tsx b/web/src/views/ToolManagement/components/McpServiceModal.tsx index 0e344049..d2c453d8 100644 --- a/web/src/views/ToolManagement/components/McpServiceModal.tsx +++ b/web/src/views/ToolManagement/components/McpServiceModal.tsx @@ -355,9 +355,10 @@ const McpServiceModal = forwardRef(({ {requestHeaderList.length === 0 ? : -
rowKey="key" pagination={false} + bordered={true} columns={[ { title: t('tool.requestHeaderName'), @@ -381,7 +382,7 @@ const McpServiceModal = forwardRef(({ diff --git a/web/src/views/UserManagement/index.tsx b/web/src/views/UserManagement/index.tsx index 548cb322..4f7aea92 100644 --- a/web/src/views/UserManagement/index.tsx +++ b/web/src/views/UserManagement/index.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-02-03 17:51:08 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-03-25 10:41:25 + * @Last Modified time: 2026-03-25 16:45:18 */ /** * User Management Page @@ -63,7 +63,7 @@ const UserManagement: React.FC = () => { }; /** Table column configuration */ - const columns: ColumnsType = [ + const columns: ColumnsType = [ { title: t('user.userId'), dataIndex: 'id', @@ -150,7 +150,7 @@ const UserManagement: React.FC = () => { -
ref={tableRef} apiUrl={getUserListUrl} apiParams={{ @@ -159,6 +159,7 @@ const UserManagement: React.FC = () => { columns={columns} rowKey="id" isScroll={true} + scrollY="calc(100vh - 256px)" /> = ({ onChange, size = 'middle', filterBooleanType = false, + mode, ...resetPorps }) => { @@ -63,9 +64,10 @@ const VariableSelect: FC = ({ if (filterOption) { return ( @@ -131,6 +133,7 @@ const VariableSelect: FC = ({ return (