fix: add pool not work

This commit is contained in:
jialin
2025-09-16 11:26:17 +08:00
parent c467280170
commit f1bb305cbc
18 changed files with 185 additions and 79 deletions
@@ -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);
};