fix: click twice for submitting deployment form, using iconfont static files
This commit is contained in:
@@ -101,6 +101,7 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
||||
const [form] = Form.useForm();
|
||||
const intl = useIntl();
|
||||
const [activeKey, setActiveKey] = React.useState<string[]>([]);
|
||||
const [submitAttempted, setSubmitAttempted] = React.useState(false);
|
||||
const { modelContextData, fetchContextLength } = useQueryContextLength();
|
||||
const localPath = Form.useWatch('local_path', form);
|
||||
const modelScopeModelId = Form.useWatch('model_scope_model_id', form);
|
||||
@@ -229,6 +230,7 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
||||
..._.omit(data, ['scheduleType']),
|
||||
...gpuSelector
|
||||
};
|
||||
console.log('submit form data:', allValues);
|
||||
onOk(allValues);
|
||||
};
|
||||
|
||||
@@ -282,6 +284,8 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
||||
};
|
||||
|
||||
const handleOnFinishFailed = (errorInfo: any) => {
|
||||
setSubmitAttempted(true);
|
||||
console.log('Failed:', errorInfo);
|
||||
const { errorFields } = errorInfo;
|
||||
if (errorFields && errorFields.length > 0) {
|
||||
const collapseKeys: string[] = [];
|
||||
@@ -398,6 +402,7 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
||||
workerLabelOptions: workerLabelOptions,
|
||||
initialValues: initialValues,
|
||||
modelContextData: modelContextData,
|
||||
submitAttempted: submitAttempted,
|
||||
clearCacheFormValues: clearCacheFormValues,
|
||||
onValuesChange: onValuesChange,
|
||||
onBackendChange: handleBackendChange
|
||||
|
||||
Reference in New Issue
Block a user