fix: do not paste multiple lines
This commit is contained in:
@@ -475,9 +475,7 @@ const InstanceItem: React.FC<InstanceItemProps> = ({
|
||||
<div className="flex-center">
|
||||
<ThunderboltFilled className="m-r-5" />
|
||||
{intl.formatMessage({ id: 'models.form.backend' })}:{' '}
|
||||
{modelData?.backend === backendOptionsMap.custom
|
||||
? intl.formatMessage({ id: 'models.form.backend.custom' })
|
||||
: modelData?.backend || ''}
|
||||
{modelData?.backend || ''}
|
||||
{modelData.backend_version ? `(${modelData.backend_version})` : ''}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,6 @@ import SealSelect from '@/components/seal-form/seal-select';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import _ from 'lodash';
|
||||
import { useCallback } from 'react';
|
||||
import { DeployFormKeyMap, modelCategories } from '../config';
|
||||
import { backendOptionsMap } from '../config/backend-parameters';
|
||||
import { useFormContext } from '../config/form-context';
|
||||
@@ -17,16 +16,13 @@ const AdvanceConfig = () => {
|
||||
const intl = useIntl();
|
||||
const form = Form.useFormInstance();
|
||||
const EnviromentVars = Form.useWatch('env', form);
|
||||
const scheduleType = Form.useWatch('scheduleType', form);
|
||||
const backend = Form.useWatch('backend', form);
|
||||
const { onValuesChange, formKey } = useFormContext();
|
||||
|
||||
const handleEnviromentVarsChange = useCallback(
|
||||
(labels: Record<string, any>) => {
|
||||
form.setFieldValue('env', labels);
|
||||
},
|
||||
[]
|
||||
);
|
||||
const handleEnviromentVarsChange = (labels: Record<string, any>) => {
|
||||
console.log('handleEnviromentVarsChange', labels);
|
||||
form.setFieldValue('env', labels);
|
||||
};
|
||||
|
||||
const onSelectorChange = (field: string, allowEmpty?: boolean) => {
|
||||
const workerSelector = form.getFieldValue(field);
|
||||
|
||||
@@ -38,8 +38,12 @@ const BackendFields: React.FC = () => {
|
||||
}, [backend]);
|
||||
|
||||
const backendGroupedOptions = useMemo(() => {
|
||||
const builtInBackends = backendOptions?.filter((item) => item.isBuiltIn);
|
||||
const customBackends = backendOptions?.filter((item) => !item.isBuiltIn);
|
||||
const builtInBackends = backendOptions?.filter(
|
||||
(item) => item.isBuiltIn || item.value === backendOptionsMap.custom
|
||||
);
|
||||
const customBackends = backendOptions?.filter(
|
||||
(item) => !item.isBuiltIn && item.value !== backendOptionsMap.custom
|
||||
);
|
||||
|
||||
const options = [];
|
||||
|
||||
@@ -52,7 +56,7 @@ const BackendFields: React.FC = () => {
|
||||
|
||||
if (customBackends && customBackends.length > 0) {
|
||||
options.push({
|
||||
label: intl.formatMessage({ id: 'backend.custom' }),
|
||||
label: intl.formatMessage({ id: 'models.form.backend.custom' }),
|
||||
options: customBackends
|
||||
});
|
||||
}
|
||||
@@ -93,7 +97,7 @@ const BackendFields: React.FC = () => {
|
||||
|
||||
if (customVersions.length > 0) {
|
||||
options.push({
|
||||
label: intl.formatMessage({ id: 'backend.custom' }),
|
||||
label: intl.formatMessage({ id: 'models.form.backend.custom' }),
|
||||
options: customVersions
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user