fix(striker-ui): add clear to file selects

main
Tsu-ba-me 3 years ago
parent 653f7e6609
commit 949afb4f62
  1. 74
      striker-ui/components/ProvisionServerDialog.tsx

@ -1064,6 +1064,42 @@ const ProvisionServerDialog = ({
);
};
const handleInstallISOFileUUIDChange = (uuid: string) => {
setInstallISOFileUUID(uuid);
updateLimits(
[
allAnvils,
storageGroupUUIDMapToFree,
cpuCoresValue,
memoryValue,
virtualDisks.sizes,
virtualDisks.inputStorageGroupUUIDs,
[uuid, driverISOFileUUID],
],
inputMemoryUnit,
virtualDisks,
);
};
const handleDriverISOFileUUIDChange = (uuid: string) => {
setDriverISOFileUUID(uuid);
updateLimits(
[
allAnvils,
storageGroupUUIDMapToFree,
cpuCoresValue,
memoryValue,
virtualDisks.sizes,
virtualDisks.inputStorageGroupUUIDs,
[installISOFileUUID, uuid],
],
inputMemoryUnit,
virtualDisks,
);
};
useEffect(() => {
const data = MOCK_DATA;
@ -1245,21 +1281,10 @@ const ProvisionServerDialog = ({
onChange: ({ target: { value } }) => {
const newInstallISOFileUUID = value as string;
setInstallISOFileUUID(newInstallISOFileUUID);
updateLimits(
[
allAnvils,
storageGroupUUIDMapToFree,
cpuCoresValue,
memoryValue,
virtualDisks.sizes,
virtualDisks.inputStorageGroupUUIDs,
[newInstallISOFileUUID, driverISOFileUUID],
],
inputMemoryUnit,
virtualDisks,
);
handleInstallISOFileUUIDChange(newInstallISOFileUUID);
},
onClearIndicatorClick: () => {
handleInstallISOFileUUIDChange('');
},
value: installISOFileUUID,
},
@ -1275,21 +1300,10 @@ const ProvisionServerDialog = ({
onChange: ({ target: { value } }) => {
const newDriverISOFileUUID = value as string;
setDriverISOFileUUID(newDriverISOFileUUID);
updateLimits(
[
allAnvils,
storageGroupUUIDMapToFree,
cpuCoresValue,
memoryValue,
virtualDisks.sizes,
virtualDisks.inputStorageGroupUUIDs,
[installISOFileUUID, newDriverISOFileUUID],
],
inputMemoryUnit,
virtualDisks,
);
handleDriverISOFileUUIDChange(newDriverISOFileUUID);
},
onClearIndicatorClick: () => {
handleDriverISOFileUUIDChange('');
},
value: driverISOFileUUID,
},

Loading…
Cancel
Save