Skip to content

Commit

Permalink
fix(web): error when click recommend specs (#1793)
Browse files Browse the repository at this point in the history
  • Loading branch information
0fatal committed Jan 9, 2024
1 parent b127a0b commit cea1c88
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions web/src/pages/home/mods/CreateAppModal/BundleControl/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,22 +119,28 @@ export default function BundleControl(props: {
onChange={() => {
onBundleItemChange("cpu", item.spec.cpu.value);
onBundleItemChange("memory", item.spec.memory.value);
onBundleItemChange("databaseCapacity", undefined);
onBundleItemChange("storageCapacity", item.spec.storageCapacity.value);
onBundleItemChange("dedicatedDatabase.cpu", item.spec.dedicatedDatabaseCPU.value);
onBundleItemChange(
"dedicatedDatabase.memory",
item.spec.dedicatedDatabaseMemory.value,
);
if (type !== "change") {
if (bundle.dedicatedDatabase) {
onBundleItemChange(
"dedicatedDatabase.capacity",
item.spec.dedicatedDatabaseCapacity.value,
"dedicatedDatabase.cpu",
item.spec.dedicatedDatabaseCPU.value,
);
onBundleItemChange(
"dedicatedDatabase.replicas",
item.spec.dedicatedDatabaseReplicas.value,
"dedicatedDatabase.memory",
item.spec.dedicatedDatabaseMemory.value,
);
if (type !== "change") {
onBundleItemChange(
"dedicatedDatabase.capacity",
item.spec.dedicatedDatabaseCapacity.value,
);
onBundleItemChange(
"dedicatedDatabase.replicas",
item.spec.dedicatedDatabaseReplicas.value,
);
}
} else {
onBundleItemChange("databaseCapacity", item.spec.databaseCapacity.value);
}
}}
bundle={item}
Expand Down

0 comments on commit cea1c88

Please sign in to comment.