chore: model list render time
This commit is contained in:
@@ -10,7 +10,7 @@ import { useIntl } from '@umijs/max';
|
||||
import { Col, Row, Space, Tooltip } from 'antd';
|
||||
import dayjs from 'dayjs';
|
||||
import _ from 'lodash';
|
||||
import React from 'react';
|
||||
import React, { useCallback } from 'react';
|
||||
import { InstanceStatusMap, InstanceStatusMapValue, status } from '../config';
|
||||
import { ModelInstanceListItem } from '../config/types';
|
||||
|
||||
@@ -49,14 +49,14 @@ const InstanceItem: React.FC<InstanceItemProps> = ({
|
||||
}
|
||||
];
|
||||
|
||||
const setChildActionList = (item: ModelInstanceListItem) => {
|
||||
const setChildActionList = useCallback((item: ModelInstanceListItem) => {
|
||||
return _.filter(childActionList, (action: any) => {
|
||||
if (action.key === 'viewlog') {
|
||||
return action.status.includes(item.state);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
};
|
||||
}, []);
|
||||
|
||||
const renderWorkerInfo = (item: ModelInstanceListItem) => {
|
||||
let workerIp = '-';
|
||||
|
||||
@@ -39,10 +39,8 @@ import ViewLogsModal from './view-logs-modal';
|
||||
interface ModelsProps {
|
||||
handleSearch: (e: any) => void;
|
||||
handleNameChange: (e: any) => void;
|
||||
fetchData: () => Promise<any>;
|
||||
handleShowSizeChange?: (page: number, size: number) => void;
|
||||
handlePageChange: (page: number, pageSize: number | undefined) => void;
|
||||
createModelsChunkRequest: () => void;
|
||||
queryParams: {
|
||||
page: number;
|
||||
perPage: number;
|
||||
@@ -101,14 +99,14 @@ const Models: React.FC<ModelsProps> = ({
|
||||
}
|
||||
];
|
||||
|
||||
const setActionList = (record: ListItem) => {
|
||||
const setActionList = useCallback((record: ListItem) => {
|
||||
return _.filter(ActionList, (action: any) => {
|
||||
if (action.key === 'chat') {
|
||||
return record.ready_replicas > 0;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
};
|
||||
}, []);
|
||||
|
||||
const handleOnSort = (dataIndex: string, order: any) => {
|
||||
console.log('handleTableChange=======', dataIndex, order);
|
||||
|
||||
Reference in New Issue
Block a user