fix: select gpu stype when creating cluster from gpu service

This commit is contained in:
jialin
2026-06-17 12:35:24 +08:00
committed by jialin
parent 1f5678f781
commit aa49539210
7 changed files with 45 additions and 14 deletions
@@ -6,6 +6,7 @@ import { Form } from 'antd';
import _ from 'lodash';
import React, { useEffect, useId, useMemo } from 'react';
import styled from 'styled-components';
import { useStepsContext } from '../config/steps-context';
import { ClusterListItem as ListItem } from '../config/types';
import ImageCredential from './image-credential';
import K8SVolumeMount from './k8s-volume-mount';
@@ -175,6 +176,7 @@ const RadioDot = styled.span<{ $active: boolean }>`
export const ClusterTypeSelector: React.FC = () => {
const intl = useIntl();
const form = Form.useFormInstance();
const { presetClusterType } = useStepsContext();
const labelId = useId();
const gpuInstanceOptions = Form.useWatch(GPU_INSTANCE_OPTIONS_PATH, {
form,
@@ -211,6 +213,12 @@ export const ClusterTypeSelector: React.FC = () => {
}
];
useEffect(() => {
if (presetClusterType) {
handleSelect(presetClusterType);
}
}, [presetClusterType]);
return (
<ClusterTypeWrap>
<ClusterTypeLabel id={labelId}>