diff --git a/studio/src/components/layout/ui/data-table.tsx b/studio/src/components/layout/ui/data-table.tsx index c0378db90..60a12fb3f 100644 --- a/studio/src/components/layout/ui/data-table.tsx +++ b/studio/src/components/layout/ui/data-table.tsx @@ -50,6 +50,8 @@ export interface DataTableProps { toolbar?: React.ReactNode className?: string onRowClick?: (row: TData) => void + paginationPageInfoLabel?: (currentPage: number, totalPages: number) => string + paginationTotalRecordsLabel?: (totalRecords: number) => string } export function DataTable({ @@ -67,6 +69,9 @@ export function DataTable({ toolbar, className, onRowClick, + paginationPageInfoLabel = (currentPage, totalPages) => + `Page ${currentPage} of ${totalPages}`, + paginationTotalRecordsLabel = (totalRecords) => `${totalRecords} records`, }: DataTableProps) { const [sorting, setSorting] = React.useState([]) const [columnFilters, setColumnFilters] = React.useState( @@ -237,11 +242,17 @@ export function DataTable({
- 第 {table.getState().pagination.pageIndex + 1} 页,共{" "} - {table.getPageCount()} 页 + {paginationPageInfoLabel( + table.getState().pagination.pageIndex + 1, + table.getPageCount() + )} - 共 {table.getFilteredRowModel().rows.length} 条记录 + + {paginationTotalRecordsLabel( + table.getFilteredRowModel().rows.length + )} +
); @@ -277,7 +289,7 @@ const ConfigFieldRenderer: React.FC = ({ default: return (
- 不支持的字段类型: {field.type} + {t('modManagement.settings.unsupportedFieldType', '不支持的字段类型')}: {field.type}
); } diff --git a/studio/src/pages/mod-management/ModManagementPage.tsx b/studio/src/pages/mod-management/ModManagementPage.tsx index cdf3592a5..5d47f8f09 100644 --- a/studio/src/pages/mod-management/ModManagementPage.tsx +++ b/studio/src/pages/mod-management/ModManagementPage.tsx @@ -411,6 +411,17 @@ const ModManagementPage: React.FC = () => { searchColumn={["id", "name", "displayName", "description"]} pagination={true} pageSize={10} + paginationPageInfoLabel={(currentPage, totalPages) => + t("modManagement.table.pageInfo", "第 {{current}} 页,共 {{total}} 页", { + current: currentPage, + total: totalPages, + }) + } + paginationTotalRecordsLabel={(totalRecords) => + t("modManagement.table.totalRecords", "共 {{count}} 条记录", { + count: totalRecords, + }) + } emptyMessage={t( "modManagement.enabledMods.empty", "No mods configured"