fix: details layout
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import SealSelect from '@/components/seal-form/seal-select';
|
||||
import { PageAction } from '@/config';
|
||||
import useAppUtils from '@/hooks/use-app-utils';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
@@ -77,6 +78,7 @@ const DatasetForm: React.FC = () => {
|
||||
]}
|
||||
>
|
||||
<SealSelect
|
||||
disabled={action === PageAction.EDIT}
|
||||
onChange={handleProfileChange}
|
||||
options={profilesOptions}
|
||||
label={intl.formatMessage({ id: 'benchmark.form.profile' })}
|
||||
|
||||
@@ -78,7 +78,11 @@ const ProviderForm: React.FC<ProviderFormProps> = forwardRef((props, ref) => {
|
||||
useEffect(() => {
|
||||
if (action === PageAction.EDIT && currentData) {
|
||||
form.setFieldsValue({
|
||||
...currentData
|
||||
...currentData,
|
||||
model_instance: [
|
||||
currentData.model_name,
|
||||
currentData.model_instance_name
|
||||
]
|
||||
});
|
||||
}
|
||||
}, [form, currentData, action]);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import SealCascader from '@/components/seal-form/seal-cascader';
|
||||
import { PageAction } from '@/config';
|
||||
import useAppUtils from '@/hooks/use-app-utils';
|
||||
import {
|
||||
InstanceStatusMap,
|
||||
@@ -133,6 +134,7 @@ const ModelInstanceForm: React.FC = () => {
|
||||
<SealCascader
|
||||
required
|
||||
showSearch
|
||||
disabled={action === PageAction.EDIT}
|
||||
loading={modelLoading || instanceLoading}
|
||||
changeOnSelect={false}
|
||||
expandTrigger="hover"
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import SealInputNumber from '@/components/seal-form/input-number';
|
||||
import SealSelect from '@/components/seal-form/seal-select';
|
||||
import { PageAction } from '@/config';
|
||||
import useAppUtils from '@/hooks/use-app-utils';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import React from 'react';
|
||||
import React, { useMemo } from 'react';
|
||||
import { useFormContext } from '../config/form-context';
|
||||
import { FormData } from '../config/types';
|
||||
|
||||
const RandomSettingsForm: React.FC<{
|
||||
@@ -13,11 +15,16 @@ const RandomSettingsForm: React.FC<{
|
||||
}> = (props) => {
|
||||
const { datasetList, datasetLoading, handleOnDataSetChange } = props;
|
||||
const intl = useIntl();
|
||||
const { action, open } = useFormContext();
|
||||
const form = Form.useFormInstance();
|
||||
const profile = Form.useWatch('profile', form);
|
||||
const { getRuleMessage } = useAppUtils();
|
||||
|
||||
const disabled = profile !== 'Custom' && Boolean(profile);
|
||||
const disabled = useMemo(() => {
|
||||
return (
|
||||
(profile !== 'Custom' && Boolean(profile)) || action === PageAction.EDIT
|
||||
);
|
||||
}, [profile, action]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user