fix: rpc server field error
This commit is contained in:
@@ -10,9 +10,10 @@ interface SimpleTableProps {
|
||||
columns: any[];
|
||||
dataSource: any[];
|
||||
bordered?: boolean;
|
||||
rowKey?: string;
|
||||
}
|
||||
const SimpleTabel: React.FC<SimpleTableProps> = (props) => {
|
||||
const { columns, dataSource, bordered = true } = props;
|
||||
const { columns, dataSource, rowKey, bordered = true } = props;
|
||||
return (
|
||||
<SimpleBar style={{ maxHeight: 200 }}>
|
||||
<table
|
||||
@@ -26,7 +27,11 @@ const SimpleTabel: React.FC<SimpleTableProps> = (props) => {
|
||||
<tbody>
|
||||
{dataSource.map((item: any, index: number) => {
|
||||
return (
|
||||
<TableRow row={item} columns={columns} key="index"></TableRow>
|
||||
<TableRow
|
||||
row={item}
|
||||
columns={columns}
|
||||
key={rowKey ? item[rowKey] : index}
|
||||
></TableRow>
|
||||
);
|
||||
})}
|
||||
</tbody>
|
||||
|
||||
@@ -102,24 +102,24 @@ const InstanceItem: React.FC<InstanceItemProps> = ({
|
||||
);
|
||||
};
|
||||
|
||||
const renderDistributionInfo = (item: ModelInstanceListItem) => {
|
||||
const rpcServerList = item.distributed_servers?.rpc_servers || [];
|
||||
const renderDistributionInfo = (row: ModelInstanceListItem) => {
|
||||
const rpcServerList = row.distributed_servers?.rpc_servers || [];
|
||||
const list = _.map(rpcServerList, (item: any) => {
|
||||
const data = _.find(workerList, { id: item.worker_id });
|
||||
return {
|
||||
woker_name: data?.name,
|
||||
work_ip: data.ip,
|
||||
port: item.port,
|
||||
worker_name: data?.name,
|
||||
worker_ip: data?.ip,
|
||||
port: data?.port,
|
||||
gpu_index: item.gpu_index
|
||||
};
|
||||
});
|
||||
|
||||
const mainWorker = [
|
||||
{
|
||||
worker_name: `${item.worker_name}`,
|
||||
worker_ip: `${item.worker_ip}`,
|
||||
port: item.port,
|
||||
gpu_index: `${item.gpu_indexes} (main)`
|
||||
worker_name: `${row.worker_name}`,
|
||||
worker_ip: `${row.worker_ip}`,
|
||||
port: row.port,
|
||||
gpu_index: `${row.gpu_indexes} (main)`
|
||||
}
|
||||
];
|
||||
|
||||
@@ -135,6 +135,7 @@ const InstanceItem: React.FC<InstanceItemProps> = ({
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<Space size={16} direction="vertical" style={{ width: '100%' }}>
|
||||
{_.map(list, (item: ModelInstanceListItem, index: number) => {
|
||||
|
||||
@@ -361,16 +361,19 @@ const Models: React.FC<ModelsProps> = ({
|
||||
[]
|
||||
);
|
||||
|
||||
const renderChildren = useCallback((list: any) => {
|
||||
return (
|
||||
<InstanceItem
|
||||
list={list}
|
||||
gpuDeviceList={gpuDeviceList}
|
||||
workerList={workerList}
|
||||
handleChildSelect={handleChildSelect}
|
||||
></InstanceItem>
|
||||
);
|
||||
}, []);
|
||||
const renderChildren = useCallback(
|
||||
(list: any) => {
|
||||
return (
|
||||
<InstanceItem
|
||||
list={list}
|
||||
gpuDeviceList={gpuDeviceList}
|
||||
workerList={workerList}
|
||||
handleChildSelect={handleChildSelect}
|
||||
></InstanceItem>
|
||||
);
|
||||
},
|
||||
[workerList]
|
||||
);
|
||||
|
||||
const handleCloseViewCode = useCallback(() => {
|
||||
setEmbeddingParams({
|
||||
|
||||
Reference in New Issue
Block a user