From 5c45f0b48bd6a6bdaf57d729460e77c922ba4891 Mon Sep 17 00:00:00 2001 From: kei5uke Date: Fri, 22 May 2026 11:38:29 +0200 Subject: [PATCH 1/5] feat: default machine, storage names, sizes, limit on options --- .../components/price-estimator/LabCard.vue | 2 +- .../components/price-estimator/LabModal.vue | 1 + .../price-estimator/MachineModal.vue | 19 +++++++--- .../price-estimator/StorageModal.vue | 35 ++++++++++--------- .../stores/priceEstimatorStore.ts | 21 ++++++++--- .../components/price-estimator/types/index.ts | 2 ++ 6 files changed, 54 insertions(+), 26 deletions(-) diff --git a/docs/.vitepress/theme/components/price-estimator/LabCard.vue b/docs/.vitepress/theme/components/price-estimator/LabCard.vue index 3e855850e3..ffa098cb86 100644 --- a/docs/.vitepress/theme/components/price-estimator/LabCard.vue +++ b/docs/.vitepress/theme/components/price-estimator/LabCard.vue @@ -195,7 +195,7 @@ const removeStorageById = (storageId: number) => { diff --git a/docs/.vitepress/theme/components/price-estimator/LabModal.vue b/docs/.vitepress/theme/components/price-estimator/LabModal.vue index 6b4271069c..50419daab8 100644 --- a/docs/.vitepress/theme/components/price-estimator/LabModal.vue +++ b/docs/.vitepress/theme/components/price-estimator/LabModal.vue @@ -44,6 +44,7 @@ const save = () => { machineSubscription: formData.value.machineSubscription, hddSize: Number(formData.value.hddSize), nvmeSize: Number(formData.value.nvmeSize), + isDefault: true, }) emit("close") } diff --git a/docs/.vitepress/theme/components/price-estimator/MachineModal.vue b/docs/.vitepress/theme/components/price-estimator/MachineModal.vue index 7539fb2a4c..8107021526 100644 --- a/docs/.vitepress/theme/components/price-estimator/MachineModal.vue +++ b/docs/.vitepress/theme/components/price-estimator/MachineModal.vue @@ -22,14 +22,15 @@ const formData = ref({ gpu: undefined, gpu_count: 1, subscription: undefined, + isDefault: false, }) -const subscriptions = [ +let subscriptions = ref([ { text: "Commitment - 1 Year", value: "COMMITMENT_1Y" }, { text: "Commitment - 3 Years", value: "COMMITMENT_3Y" }, { text: "On demand", value: "ONDEMAND" }, { text: "Spot", value: "SPOT" }, -] +]) const getComputePriceYear = computed((): string | number => { if (!formData.value.machine_type || !formData.value.subscription) { @@ -144,6 +145,7 @@ const save = () => { subscription: subscription!, gpu: gpu, gpuCount: gpuCount, + isDefault: formData.value.isDefault!, }) } else { // Add new compute @@ -155,6 +157,7 @@ const save = () => { subscription: subscription!, gpu: gpu, gpu_count: gpuCount, + isDefault: formData.value.isDefault!, }) } @@ -166,6 +169,11 @@ onMounted(() => { formData.value.id = props.editData.id formData.value.name = props.editData.name formData.value.subscription = props.editData.subscription + formData.value.isDefault = props.editData.isDefault + + if (formData.value.isDefault) { + subscriptions.value = subscriptions.value.slice(0, 2) + } if (props.editData.machine_type.includes(" + ")) { const parts = props.editData.machine_type.split(" + ") @@ -178,7 +186,8 @@ onMounted(() => { } } else { formData.value.id = props.computeId - formData.value.name = `machine-${props.computeId + 1}` + const labName = priceEstimatorStore.labs[props.labId].title + formData.value.name = `${labName}-iasss-${props.computeId + 1}` } }) @@ -221,10 +230,10 @@ onMounted(() => { - + - + diff --git a/docs/.vitepress/theme/components/price-estimator/StorageModal.vue b/docs/.vitepress/theme/components/price-estimator/StorageModal.vue index d495305186..6d069fadda 100644 --- a/docs/.vitepress/theme/components/price-estimator/StorageModal.vue +++ b/docs/.vitepress/theme/components/price-estimator/StorageModal.vue @@ -1,5 +1,5 @@ diff --git a/docs/.vitepress/theme/components/price-estimator/stores/priceEstimatorStore.ts b/docs/.vitepress/theme/components/price-estimator/stores/priceEstimatorStore.ts index e3c5a2b687..474e8c7a16 100644 --- a/docs/.vitepress/theme/components/price-estimator/stores/priceEstimatorStore.ts +++ b/docs/.vitepress/theme/components/price-estimator/stores/priceEstimatorStore.ts @@ -177,7 +177,7 @@ export const priceEstimatorStore = reactive({ const ram = parseInt(machineTitle[1].split(" ")[0]) const unit: ComputeUnit = { id: 0, - name: `${payload.name}-home`, + name: `${payload.name.toLowerCase().replace(" ", "-")}-home`, machine_type: payload.machineType, core_count: coreCount, ram, From 1c2301cac235b24c696bd1ab67e75030dced2bf1 Mon Sep 17 00:00:00 2001 From: kei5uke Date: Fri, 22 May 2026 16:53:31 +0200 Subject: [PATCH 3/5] fix: typo --- .../theme/components/price-estimator/MachineModal.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/.vitepress/theme/components/price-estimator/MachineModal.vue b/docs/.vitepress/theme/components/price-estimator/MachineModal.vue index 8107021526..935aed073c 100644 --- a/docs/.vitepress/theme/components/price-estimator/MachineModal.vue +++ b/docs/.vitepress/theme/components/price-estimator/MachineModal.vue @@ -187,7 +187,7 @@ onMounted(() => { } else { formData.value.id = props.computeId const labName = priceEstimatorStore.labs[props.labId].title - formData.value.name = `${labName}-iasss-${props.computeId + 1}` + formData.value.name = `${labName}-iaas-${props.computeId + 1}` } }) From be11b5f3ee21fdf2c141e62a3e513d2674d0d7f9 Mon Sep 17 00:00:00 2001 From: Matus Kosut Date: Fri, 22 May 2026 17:07:37 +0200 Subject: [PATCH 4/5] feat: keep delete on home machine as readonly with warning --- .../components/price-estimator/LabCard.vue | 6 +++--- .../price-estimator/StorageModal.vue | 19 ++----------------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/docs/.vitepress/theme/components/price-estimator/LabCard.vue b/docs/.vitepress/theme/components/price-estimator/LabCard.vue index 26f585805c..9387f0065a 100644 --- a/docs/.vitepress/theme/components/price-estimator/LabCard.vue +++ b/docs/.vitepress/theme/components/price-estimator/LabCard.vue @@ -140,7 +140,7 @@ const openSnackbar = (message: string) => { const removeComputeById = (computeId: number) => { if (computeId === selectedCompute.value[0]?.id) { - openSnackbar("Cannot remove the default machine") + openSnackbar("Cannot remove the home machine. Home machine is an essential component of your lab.") return } priceEstimatorStore.removeComputeFromLab(props.lab.id, computeId) @@ -192,7 +192,7 @@ const removeStorageById = (storageId: number) => { @@ -350,7 +350,7 @@ const removeStorageById = (storageId: number) => { - {{ snackbar.message }} + {{ snackbar.message }} diff --git a/docs/.vitepress/theme/components/price-estimator/StorageModal.vue b/docs/.vitepress/theme/components/price-estimator/StorageModal.vue index 6d069fadda..9cc896a030 100644 --- a/docs/.vitepress/theme/components/price-estimator/StorageModal.vue +++ b/docs/.vitepress/theme/components/price-estimator/StorageModal.vue @@ -1,5 +1,5 @@