fix: the fields for trigger checking
This commit is contained in:
@@ -58,7 +58,7 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
|
||||
const {
|
||||
setWarningStatus,
|
||||
generateGPUIds,
|
||||
handleOnValuesChange,
|
||||
handleBackendChangeBefore,
|
||||
checkTokenRef,
|
||||
warningStatus
|
||||
} = useCheckCompatibility();
|
||||
@@ -68,6 +68,8 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
|
||||
const localPathCache = useRef<string>('');
|
||||
const submitAnyway = useRef<boolean>(false);
|
||||
|
||||
const handleOnValuesChange = (data: any) => {};
|
||||
|
||||
// voxbox is not support multi gpu
|
||||
const handleSetGPUIds = (backend: string) => {
|
||||
const gpuids = form.getFieldValue(['gpu_selector', 'gpu_ids']) || [];
|
||||
@@ -91,6 +93,10 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
|
||||
handleSetGPUIds(backend);
|
||||
|
||||
const data = form.getFieldsValue?.();
|
||||
const res = handleBackendChangeBefore(data);
|
||||
if (res.show) {
|
||||
return;
|
||||
}
|
||||
if (data.local_path || data.source !== modelSourceMap.local_path_value) {
|
||||
handleOnValuesChange?.({
|
||||
changedValues: {},
|
||||
@@ -390,9 +396,10 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
|
||||
<ModalFooter
|
||||
onCancel={onCancel}
|
||||
onOk={handleSumit}
|
||||
showOkBtn={!warningStatus.show}
|
||||
showOkBtn={!warningStatus.show || warningStatus.type === 'success'}
|
||||
extra={
|
||||
warningStatus.show && (
|
||||
warningStatus.show &&
|
||||
warningStatus.type !== 'success' && (
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={handleSubmitAnyway}
|
||||
|
||||
Reference in New Issue
Block a user