diff --git a/src/hooks/use-table-fetch.ts b/src/hooks/use-table-fetch.ts index 00dcc679..2444a2bc 100644 --- a/src/hooks/use-table-fetch.ts +++ b/src/hooks/use-table-fetch.ts @@ -37,6 +37,7 @@ export default function useTableFetch( key?: (typeof PaginationKey)[keyof typeof PaginationKey]; fetchAPI: (params: any, options?: any) => Promise>; deleteAPI?: (id: number, params?: any) => Promise; + afterDelete?: (id?: number | number[]) => void; contentForDelete?: string; defaultData?: any[]; events?: EventsType[]; @@ -48,6 +49,7 @@ export default function useTableFetch( const { fetchAPI, deleteAPI, + afterDelete, contentForDelete, API, polling = false, @@ -363,7 +365,7 @@ export default function useTableFetch( // remove the deleted id from selected ids in row selection rowSelection.removeSelectedKeys([row.id]); - + afterDelete?.(row.id); // ======== to avoid fetch data twice, because of debounceFetchData has been run ======= if (!updateManually) { fetchData(); @@ -390,6 +392,7 @@ export default function useTableFetch( successIds.push(id); } ); + afterDelete?.(successIds); rowSelection.removeSelectedKeys(successIds); fetchData(); return res; diff --git a/src/pages/benchmark/hooks/use-benchmark-columns.tsx b/src/pages/benchmark/hooks/use-benchmark-columns.tsx index f7647f56..7809269f 100644 --- a/src/pages/benchmark/hooks/use-benchmark-columns.tsx +++ b/src/pages/benchmark/hooks/use-benchmark-columns.tsx @@ -27,7 +27,7 @@ const useBenchmarkColumns = (params: { dataIndex: 'name', sorter: tableSorter(1), render: (text: string, record) => ( - + onCellClick?.(record, 'name')}> {text} diff --git a/src/pages/cluster-management/hooks/use-credential-columns.tsx b/src/pages/cluster-management/hooks/use-credential-columns.tsx index 94749694..57b4f8fd 100644 --- a/src/pages/cluster-management/hooks/use-credential-columns.tsx +++ b/src/pages/cluster-management/hooks/use-credential-columns.tsx @@ -20,7 +20,7 @@ const useCredentialColumns = ( dataIndex: 'name', sorter: tableSorter(1), render: (text: string) => ( - + {text} ) diff --git a/src/pages/dashboard/components/active-table.tsx b/src/pages/dashboard/components/active-table.tsx index dbf8a731..da975354 100644 --- a/src/pages/dashboard/components/active-table.tsx +++ b/src/pages/dashboard/components/active-table.tsx @@ -30,7 +30,16 @@ const ActiveTable = () => { ellipsis: true, render: (text: any, record: any) => { return ( - + + {record.provider_name + ? `${record.provider_name}/${text}` + : text} + + } + > {record.provider_name ? `${record.provider_name}/${text}` : text} diff --git a/src/pages/gpu-service/instances/hooks/use-instances-columns.tsx b/src/pages/gpu-service/instances/hooks/use-instances-columns.tsx index 268eb77e..7dad8d7f 100644 --- a/src/pages/gpu-service/instances/hooks/use-instances-columns.tsx +++ b/src/pages/gpu-service/instances/hooks/use-instances-columns.tsx @@ -195,7 +195,11 @@ const useInstancesColumns = ({ showTitle: false }, render: (text: string, record: ListItem) => ( - + {record.displayName || text}} + maxWidth={300} + > {record.displayName || text} ) @@ -312,7 +316,7 @@ const useInstancesColumns = ({ ellipsis: { showTitle: false }, - width: 260, + width: 300, render: (_text: string, record: ListItem) => renderInstanceType(record) }, { diff --git a/src/pages/gpu-service/public-keys/hooks/use-public-key-columns.tsx b/src/pages/gpu-service/public-keys/hooks/use-public-key-columns.tsx index 2de8aa5c..533f3574 100644 --- a/src/pages/gpu-service/public-keys/hooks/use-public-key-columns.tsx +++ b/src/pages/gpu-service/public-keys/hooks/use-public-key-columns.tsx @@ -44,7 +44,11 @@ const usePublicKeyColumns = ({ showTitle: false }, render: (text: string, record: ListItem) => ( - + {record.displayName || text}} + > {record.displayName || text} ) diff --git a/src/pages/gpu-service/storage-types/hooks/use-storage-type-columns.tsx b/src/pages/gpu-service/storage-types/hooks/use-storage-type-columns.tsx index 7455d1fc..17a91604 100644 --- a/src/pages/gpu-service/storage-types/hooks/use-storage-type-columns.tsx +++ b/src/pages/gpu-service/storage-types/hooks/use-storage-type-columns.tsx @@ -55,7 +55,11 @@ const useStorageTypeColumns = ({ sorter: true, ellipsis: { showTitle: false }, render: (text: string, record: ListItem) => ( - + {record.displayName || text}} + > {record.displayName || text} ) diff --git a/src/pages/gpu-service/storage/hooks/use-storage-columns.tsx b/src/pages/gpu-service/storage/hooks/use-storage-columns.tsx index 6350ba0b..d381b69d 100644 --- a/src/pages/gpu-service/storage/hooks/use-storage-columns.tsx +++ b/src/pages/gpu-service/storage/hooks/use-storage-columns.tsx @@ -29,7 +29,11 @@ const useStorageColumns = ({ showTitle: false }, render: (text: string, record: ListItem) => ( - + {record.displayName || text}} + > {record.displayName || text} ) diff --git a/src/pages/resources/hooks/use-gpu-columns.tsx b/src/pages/resources/hooks/use-gpu-columns.tsx index de08263c..26ef094b 100644 --- a/src/pages/resources/hooks/use-gpu-columns.tsx +++ b/src/pages/resources/hooks/use-gpu-columns.tsx @@ -51,7 +51,7 @@ const useGPUColumns = (props: { minWidth: 32, sorter: tableSorter(1), render: (text: string, record: GPUDeviceItem) => ( - + {text} ) diff --git a/src/pages/resources/hooks/use-worker-columns.tsx b/src/pages/resources/hooks/use-worker-columns.tsx index e707e98b..aeb29714 100644 --- a/src/pages/resources/hooks/use-worker-columns.tsx +++ b/src/pages/resources/hooks/use-worker-columns.tsx @@ -390,7 +390,7 @@ const useWorkerColumns = ({ sorter: tableSorter(1), render: (text: string, record: ListItem) => (
- + {text} {renderVersionInfo(record)} diff --git a/src/pages/users/hooks/use-users-columns.tsx b/src/pages/users/hooks/use-users-columns.tsx index 4ba3e87c..a1bfa659 100644 --- a/src/pages/users/hooks/use-users-columns.tsx +++ b/src/pages/users/hooks/use-users-columns.tsx @@ -138,7 +138,7 @@ const useUsersColumns = ({ key: 'username', sorter: tableSorter(1), render: (text: string, record: ListItem) => ( - + {text} )