Merge #52 into develop_web from feature/20251219_zy
feat(web): 1. user memory; 2. update workspace's model config * feature/20251219_zy: (2 commits) feat(web): order feat(web): 1. user memory; 2. update workspace's model config Signed-off-by: zhaoying <zhaoying@redbearai.com> Merged-by: zhaoying <zhaoying@redbearai.com> CR-link: https://codeup.aliyun.com/redbearai/python/redbear-mem-open/change/52
This commit is contained in:
@@ -38,6 +38,8 @@ import toolIcon from '@/assets/images/menu/tool.png';
|
||||
import toolActiveIcon from '@/assets/images/menu/tool_active.png';
|
||||
import apiKeyIcon from '@/assets/images/menu/apiKey.png';
|
||||
import apiKeyActiveIcon from '@/assets/images/menu/apiKey_active.png';
|
||||
import pricingIcon from '@/assets/images/menu/pricing.svg'
|
||||
import pricingActiveIcon from '@/assets/images/menu/pricing_active.svg'
|
||||
|
||||
// 图标路径映射表
|
||||
const iconPathMap: Record<string, string> = {
|
||||
@@ -65,6 +67,8 @@ const iconPathMap: Record<string, string> = {
|
||||
'toolActive': toolActiveIcon,
|
||||
'apiKey': apiKeyIcon,
|
||||
'apiKeyActive': apiKeyActiveIcon,
|
||||
'pricing': pricingIcon,
|
||||
'pricingActive': pricingActiveIcon
|
||||
};
|
||||
|
||||
const { Sider } = Layout;
|
||||
|
||||
@@ -19,6 +19,7 @@ interface TableComponentProps extends Omit<TableProps, 'pagination'> {
|
||||
isScroll?: boolean;
|
||||
scrollX?: number | string | true; // 支持自定义横向滚动宽度
|
||||
scrollY?: number | string; // 支持自定义纵向滚动高度
|
||||
currentPageKey?: string;
|
||||
}
|
||||
export interface TableRef {
|
||||
loadData: () => void;
|
||||
@@ -48,6 +49,7 @@ const TableComponent = forwardRef<TableRef, TableComponentProps>(({
|
||||
isScroll = false,
|
||||
scrollX,
|
||||
scrollY,
|
||||
currentPageKey = 'page',
|
||||
...props
|
||||
}, ref) => {
|
||||
const { t } = useTranslation();
|
||||
@@ -86,7 +88,7 @@ const TableComponent = forwardRef<TableRef, TableComponentProps>(({
|
||||
...currentPagination,
|
||||
...pageData,
|
||||
})
|
||||
params = {...params, ...pageData}
|
||||
params = { ...params, ...pageData, [currentPageKey]: pageData.page}
|
||||
}
|
||||
setLoading(true)
|
||||
// 构建查询参数并调用API
|
||||
@@ -95,7 +97,7 @@ const TableComponent = forwardRef<TableRef, TableComponentProps>(({
|
||||
// 支持两种响应格式:直接返回 total 或在 page 对象中返回
|
||||
const totalCount = res.page?.total ?? res.total ?? 0;
|
||||
setTotal(totalCount)
|
||||
setData(Array.isArray(res.items) ? res.items : Array.isArray(res.hosts) ? res.hosts : res || [])
|
||||
setData(Array.isArray(res.items) ? res.items : Array.isArray(res.hosts) ? res.hosts : Array.isArray(res.list) ? res.list : res || [])
|
||||
setLoading(false)
|
||||
})
|
||||
.catch(err => {
|
||||
|
||||
Reference in New Issue
Block a user