fix: set env null after change backend
This commit is contained in:
@@ -82,9 +82,7 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
||||
|
||||
const handleBackendChange = async (val: string) => {
|
||||
const updates = {
|
||||
backend_version: '',
|
||||
backend_parameters: [],
|
||||
env: {}
|
||||
backend_version: ''
|
||||
};
|
||||
if (val === backendOptionsMap.llamaBox) {
|
||||
Object.assign(updates, {
|
||||
@@ -92,7 +90,11 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
||||
cpu_offloading: true
|
||||
});
|
||||
}
|
||||
form.setFieldsValue(updates);
|
||||
form.setFieldsValue({
|
||||
...updates,
|
||||
backend_parameters: [],
|
||||
env: null
|
||||
});
|
||||
handleSetGPUIds(val);
|
||||
props.onBackendChange?.(val);
|
||||
};
|
||||
|
||||
@@ -126,9 +126,7 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
|
||||
|
||||
const handleBackendChange = (backend: string) => {
|
||||
const updates = {
|
||||
backend_version: '',
|
||||
backend_parameters: [],
|
||||
env: {}
|
||||
backend_version: ''
|
||||
};
|
||||
if (backend === backendOptionsMap.llamaBox) {
|
||||
Object.assign(updates, {
|
||||
@@ -136,12 +134,11 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
|
||||
cpu_offloading: true
|
||||
});
|
||||
}
|
||||
form.setFieldsValue(updates);
|
||||
form.setFieldsValue({ ...updates, backend_parameters: [], env: null });
|
||||
handleSetGPUIds(backend);
|
||||
|
||||
const data = form.getFieldsValue?.();
|
||||
const res = handleBackendChangeBefore(data);
|
||||
console.log('res+++++++++++', res);
|
||||
if (res.show) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user