fix: do not trigger evaluation after switching model
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
import { clusterListAtom } from '@/atoms/models';
|
||||
import { queryClusterList } from '@/pages/cluster-management/apis';
|
||||
import {
|
||||
ClusterStatusLabelMap,
|
||||
ClusterStatusValueMap
|
||||
} from '@/pages/cluster-management/config';
|
||||
import { ClusterListItem } from '@/pages/cluster-management/config/types';
|
||||
import { queryWorkersList } from '@/pages/resources/apis';
|
||||
import {
|
||||
@@ -239,7 +235,7 @@ export default function useFormInitialValues() {
|
||||
const [, setClusterListAtom] = useAtom(clusterListAtom);
|
||||
|
||||
const [clusterList, setClusterList] = useState<
|
||||
Global.BaseOption<number, { provider: string; state: string | number }>[]
|
||||
Global.BaseOption<number, { provider: string; state: string }>[]
|
||||
>([]);
|
||||
|
||||
const getClusterList = async (): Promise<Global.BaseOption<number>[]> => {
|
||||
@@ -249,12 +245,8 @@ export default function useFormInitialValues() {
|
||||
perPage: 100
|
||||
});
|
||||
const list = response.items.map((item) => ({
|
||||
label:
|
||||
item.state === ClusterStatusValueMap.Ready
|
||||
? item.name
|
||||
: `${item.name} [${ClusterStatusLabelMap[item.state]}]`,
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
disabled: item.state !== ClusterStatusValueMap.Ready,
|
||||
provider: item.provider as string,
|
||||
state: item.state
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user