Compare commits
1
Commits
v2.2.1
...
gpu-service
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
17527b0fa5 |
@@ -70,11 +70,13 @@ const getConnectEntries = (record: ListItem): ConnectEntry[] => {
|
|||||||
|
|
||||||
interface ColumnsHookProps {
|
interface ColumnsHookProps {
|
||||||
handleSelect: (val: string, record: ListItem) => void;
|
handleSelect: (val: string, record: ListItem) => void;
|
||||||
|
clusterList: Global.BaseOption<string>[];
|
||||||
sortOrder: string[];
|
sortOrder: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const useInstancesColumns = ({
|
const useInstancesColumns = ({
|
||||||
handleSelect,
|
handleSelect,
|
||||||
|
clusterList,
|
||||||
sortOrder
|
sortOrder
|
||||||
}: ColumnsHookProps): ColumnsType<ListItem> => {
|
}: ColumnsHookProps): ColumnsType<ListItem> => {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
@@ -242,6 +244,15 @@ const useInstancesColumns = ({
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: intl.formatMessage({ id: 'clusters.title' }),
|
||||||
|
dataIndex: 'clusterId',
|
||||||
|
render: (id: number) => (
|
||||||
|
<AutoTooltip ghost maxWidth={240}>
|
||||||
|
{_.find(clusterList, { value: id })?.label || id || '-'}
|
||||||
|
</AutoTooltip>
|
||||||
|
)
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: intl.formatMessage({ id: 'common.table.createTime' }),
|
title: intl.formatMessage({ id: 'common.table.createTime' }),
|
||||||
dataIndex: 'created_at',
|
dataIndex: 'created_at',
|
||||||
@@ -271,7 +282,7 @@ const useInstancesColumns = ({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}, [handleSelect, sortOrder, intl]);
|
}, [handleSelect, sortOrder, clusterList, intl]);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default useInstancesColumns;
|
export default useInstancesColumns;
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
import { PageAction } from '@/config';
|
import { PageAction } from '@/config';
|
||||||
import { PaginationKey, TABLE_SORT_DIRECTIONS } from '@/config/settings';
|
import { PaginationKey, TABLE_SORT_DIRECTIONS } from '@/config/settings';
|
||||||
import useTableFetch from '@/hooks/use-table-fetch';
|
import useTableFetch from '@/hooks/use-table-fetch';
|
||||||
|
import { useQueryClusterList } from '@/pages/cluster-management/services/use-query-cluster-list';
|
||||||
import { DeleteModal, FilterBar, IconFont, NoResult } from '@gpustack/core-ui';
|
import { DeleteModal, FilterBar, IconFont, NoResult } from '@gpustack/core-ui';
|
||||||
import { useIntl } from '@umijs/max';
|
import { useIntl } from '@umijs/max';
|
||||||
import { useMemoizedFn } from 'ahooks';
|
import { useMemoizedFn } from 'ahooks';
|
||||||
import { ConfigProvider, message, Modal, Table } from 'antd';
|
import { ConfigProvider, message, Modal, Table } from 'antd';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
import { useEffect } from 'react';
|
||||||
import PageBox from '../../_components/page-box';
|
import PageBox from '../../_components/page-box';
|
||||||
import {
|
import {
|
||||||
deleteGPUServiceInstance,
|
deleteGPUServiceInstance,
|
||||||
@@ -66,6 +68,15 @@ const GPUService: React.FC = () => {
|
|||||||
closeViewEventsModal,
|
closeViewEventsModal,
|
||||||
openViewEventsModalStatus
|
openViewEventsModalStatus
|
||||||
} = useViewEvents();
|
} = useViewEvents();
|
||||||
|
const {
|
||||||
|
fetchClusterList,
|
||||||
|
cancelRequest: cancelClusterRequest,
|
||||||
|
clusterList
|
||||||
|
} = useQueryClusterList();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
fetchClusterList({ page: -1 });
|
||||||
|
}, []);
|
||||||
|
|
||||||
const handleModalOk = async (data: FormData) => {
|
const handleModalOk = async (data: FormData) => {
|
||||||
try {
|
try {
|
||||||
@@ -142,6 +153,7 @@ const GPUService: React.FC = () => {
|
|||||||
|
|
||||||
const columns = useInstancesColumns({
|
const columns = useInstancesColumns({
|
||||||
handleSelect,
|
handleSelect,
|
||||||
|
clusterList,
|
||||||
sortOrder
|
sortOrder
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user