fix: the fields for trigger checking

This commit is contained in:
jialin
2025-04-03 18:08:43 +08:00
parent 939f46c7e6
commit b6136a092d
22 changed files with 226 additions and 73 deletions
+10 -3
View File
@@ -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}