fix: add pool not work
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
// columns.ts
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import DropdownButtons from '@/components/drop-down-buttons';
|
||||
import { SealColumnProps } from '@/components/seal-table/types';
|
||||
import StatusTag from '@/components/status-tag';
|
||||
import { Link, useIntl } from '@umijs/max';
|
||||
import { ColumnsType } from 'antd/es/table';
|
||||
import dayjs from 'dayjs';
|
||||
import { useMemo } from 'react';
|
||||
import {
|
||||
@@ -25,7 +25,7 @@ const setActionsItems = (row: ClusterListItem) => {
|
||||
|
||||
const useClusterColumns = (
|
||||
handleSelect: (val: string, record: ClusterListItem) => void
|
||||
): ColumnsType<ClusterListItem & { dataIndex: string; span: number }> => {
|
||||
): SealColumnProps[] => {
|
||||
const intl = useIntl();
|
||||
|
||||
return useMemo(() => {
|
||||
|
||||
@@ -130,6 +130,7 @@ export const useProviderRegions = () => {
|
||||
};
|
||||
});
|
||||
setAllInstanceTypes(list);
|
||||
return list;
|
||||
} catch (error) {
|
||||
setAllInstanceTypes([]);
|
||||
}
|
||||
@@ -155,18 +156,21 @@ export const useProviderRegions = () => {
|
||||
};
|
||||
});
|
||||
setAllOSImageList(list);
|
||||
return list;
|
||||
} catch (error) {}
|
||||
};
|
||||
|
||||
const updateInstanceTypes = (region: string) => {
|
||||
const sizes = allInstanceTypes.filter((item) =>
|
||||
const updateInstanceTypes = (region: string, allTypes?: any[]) => {
|
||||
const sizes = (allTypes || allInstanceTypes).filter((item) =>
|
||||
item.regions.includes(region)
|
||||
);
|
||||
setInstanceTypes(sizes);
|
||||
};
|
||||
|
||||
const updateOSImages = (region: string) => {
|
||||
const list = allOSImageList.filter((item) => item.regions.includes(region));
|
||||
const updateOSImages = (region: string, allImages?: any[]) => {
|
||||
const list = (allImages || allOSImageList).filter((item) =>
|
||||
item.regions.includes(region)
|
||||
);
|
||||
setOSImageList(list);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user