fix: remove input box for gpus_per_replica

This commit is contained in:
jialin
2025-10-30 16:38:55 +08:00
parent e9fa3e3aa3
commit b733b3615d
3 changed files with 18 additions and 51 deletions
+9
View File
@@ -9,6 +9,7 @@ import { useIntl } from '@umijs/max';
import { Form } from 'antd';
import { useMemo } from 'react';
import { sourceOptions } from '../config';
import { useFormContext } from '../config/form-context';
import { FormData } from '../config/types';
import CatalogFrom from './catalog';
import LocalPathSource from './local-path-source';
@@ -34,12 +35,19 @@ const BasicForm: React.FC<BasicFormProps> = (props) => {
} = props;
const intl = useIntl();
const { getRuleMessage } = useAppUtils();
const { onValuesChange } = useFormContext();
const form = Form.useFormInstance();
const handleOnSourceChange = (val: string) => {
onSourceChange?.(val);
};
const handleReplicasChange = (val: number) => {
if (val > 0) {
onValuesChange?.({}, form.getFieldsValue());
}
};
const clusterOptions = useMemo(() => {
return clusterList?.map((item) => {
return {
@@ -126,6 +134,7 @@ const BasicForm: React.FC<BasicFormProps> = (props) => {
]}
>
<SealInput.Number
onChange={handleReplicasChange}
style={{ width: '100%' }}
label={intl.formatMessage({
id: 'models.form.replicas'