From ed6c6b4968e1eed1d2f07838fa694bbff90262d3 Mon Sep 17 00:00:00 2001 From: kei5uke Date: Tue, 26 May 2026 09:26:39 +0200 Subject: [PATCH 1/2] feat: default storage --- .../components/price-estimator/LabModal.vue | 12 ---- .../stores/priceEstimatorStore.ts | 68 +++++++++++-------- 2 files changed, 39 insertions(+), 41 deletions(-) diff --git a/docs/.vitepress/theme/components/price-estimator/LabModal.vue b/docs/.vitepress/theme/components/price-estimator/LabModal.vue index 50419daab8..fa66f7c318 100644 --- a/docs/.vitepress/theme/components/price-estimator/LabModal.vue +++ b/docs/.vitepress/theme/components/price-estimator/LabModal.vue @@ -12,8 +12,6 @@ const formData = ref({ subscription: "1Y", machineType: "c1", machineSubscription: "COMMITMENT_1Y", - hddSize: 1, - nvmeSize: 0, }) const subscriptions = computed(() => { @@ -42,8 +40,6 @@ const save = () => { subscription: formData.value.subscription, machineType: formData.value.machineType, machineSubscription: formData.value.machineSubscription, - hddSize: Number(formData.value.hddSize), - nvmeSize: Number(formData.value.nvmeSize), isDefault: true, }) emit("close") @@ -81,14 +77,6 @@ onMounted(() => { - - - - - - - - diff --git a/docs/.vitepress/theme/components/price-estimator/stores/priceEstimatorStore.ts b/docs/.vitepress/theme/components/price-estimator/stores/priceEstimatorStore.ts index 8efefcd1c5..d0d1316484 100644 --- a/docs/.vitepress/theme/components/price-estimator/stores/priceEstimatorStore.ts +++ b/docs/.vitepress/theme/components/price-estimator/stores/priceEstimatorStore.ts @@ -157,7 +157,7 @@ export const priceEstimatorStore = reactive({ }, /* Lab helpers */ - addLab(payload: { name: string; subscription: string; machineType: string; machineSubscription: string; hddSize: number; nvmeSize: number; isDefault: boolean }) { + addLab(payload: { name: string; subscription: string; machineType: string; machineSubscription: string; isDefault: boolean }) { const newLab: LabCard = { id: this.labs.length, title: payload.name, @@ -189,36 +189,46 @@ export const priceEstimatorStore = reactive({ newLab.selectedCompute.push(unit) } - // Add HDD storage - if (payload.hddSize > 0) { - const hddPrices = this.getStoragePriceFromCatalogue("HDD", payload.hddSize) - if (hddPrices) { - newLab.selectedStorage.push({ - id: 0, - name: "volume-1", - usage: "Archive", - type: "HDD", - size: payload.hddSize, - monthlyPrice: hddPrices.monthlyPrice, - yearlyPrice: hddPrices.yearlyPrice, - }) - } + // Add Archieve storage + const archivePrice = this.getStoragePriceFromCatalogue("HDD", 0.4) + if (archivePrice) { + newLab.selectedStorage.push({ + id: 0, + name: "volume-1", + usage: "Archive", + type: "HDD", + size: 0.4, + monthlyPrice: archivePrice.monthlyPrice, + yearlyPrice: archivePrice.yearlyPrice, + }) } - // Add NVME storage - if (payload.nvmeSize > 0) { - const nvmePrices = this.getStoragePriceFromCatalogue("NVME", payload.nvmeSize) - if (nvmePrices) { - newLab.selectedStorage.push({ - id: newLab.selectedStorage.length, - name: "volume-nvme", - usage: "Work", - type: "NVME", - size: payload.nvmeSize, - monthlyPrice: nvmePrices.monthlyPrice, - yearlyPrice: nvmePrices.yearlyPrice, - }) - } + // Add Archieve storage + const workPrice = this.getStoragePriceFromCatalogue("HDD", 0.3) + if (workPrice) { + newLab.selectedStorage.push({ + id: 1, + name: "volume-2", + usage: "Work", + type: "HDD", + size: 0.3, + monthlyPrice: workPrice.monthlyPrice, + yearlyPrice: workPrice.yearlyPrice, + }) + } + + // Add Scratch storage + const scratchPrice = this.getStoragePriceFromCatalogue("HDD", 0.4) + if (scratchPrice) { + newLab.selectedStorage.push({ + id: 2, + name: "volume-3", + usage: "Scratch", + type: "HDD", + size: 0.3, + monthlyPrice: scratchPrice.monthlyPrice, + yearlyPrice: scratchPrice.yearlyPrice, + }) } // Update From 50478375a194d335572e99de463e83a70994b7c0 Mon Sep 17 00:00:00 2001 From: kei5uke Date: Tue, 26 May 2026 09:54:15 +0200 Subject: [PATCH 2/2] feat: add fields in lab modal --- .../components/price-estimator/LabModal.vue | 18 ++++++++++++++++++ .../stores/priceEstimatorStore.ts | 16 ++++++++-------- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/docs/.vitepress/theme/components/price-estimator/LabModal.vue b/docs/.vitepress/theme/components/price-estimator/LabModal.vue index fa66f7c318..73e45c28d2 100644 --- a/docs/.vitepress/theme/components/price-estimator/LabModal.vue +++ b/docs/.vitepress/theme/components/price-estimator/LabModal.vue @@ -12,6 +12,9 @@ const formData = ref({ subscription: "1Y", machineType: "c1", machineSubscription: "COMMITMENT_1Y", + archive: 0.4, + work: 0.3, + scratch: 0.3, }) const subscriptions = computed(() => { @@ -40,6 +43,9 @@ const save = () => { subscription: formData.value.subscription, machineType: formData.value.machineType, machineSubscription: formData.value.machineSubscription, + archive: Number(formData.value.archive), + work: Number(formData.value.work), + scratch: Number(formData.value.scratch), isDefault: true, }) emit("close") @@ -77,6 +83,18 @@ onMounted(() => { + + + + + + + + + + + + diff --git a/docs/.vitepress/theme/components/price-estimator/stores/priceEstimatorStore.ts b/docs/.vitepress/theme/components/price-estimator/stores/priceEstimatorStore.ts index d0d1316484..62bfaf7b26 100644 --- a/docs/.vitepress/theme/components/price-estimator/stores/priceEstimatorStore.ts +++ b/docs/.vitepress/theme/components/price-estimator/stores/priceEstimatorStore.ts @@ -157,7 +157,7 @@ export const priceEstimatorStore = reactive({ }, /* Lab helpers */ - addLab(payload: { name: string; subscription: string; machineType: string; machineSubscription: string; isDefault: boolean }) { + addLab(payload: { name: string; subscription: string; machineType: string; machineSubscription: string; isDefault: boolean; archive: number; work: number; scratch: number }) { const newLab: LabCard = { id: this.labs.length, title: payload.name, @@ -190,42 +190,42 @@ export const priceEstimatorStore = reactive({ } // Add Archieve storage - const archivePrice = this.getStoragePriceFromCatalogue("HDD", 0.4) + const archivePrice = this.getStoragePriceFromCatalogue("HDD", payload.archive) if (archivePrice) { newLab.selectedStorage.push({ id: 0, name: "volume-1", usage: "Archive", type: "HDD", - size: 0.4, + size: payload.archive, monthlyPrice: archivePrice.monthlyPrice, yearlyPrice: archivePrice.yearlyPrice, }) } - // Add Archieve storage - const workPrice = this.getStoragePriceFromCatalogue("HDD", 0.3) + // Add Work storage + const workPrice = this.getStoragePriceFromCatalogue("HDD", payload.work) if (workPrice) { newLab.selectedStorage.push({ id: 1, name: "volume-2", usage: "Work", type: "HDD", - size: 0.3, + size: payload.work, monthlyPrice: workPrice.monthlyPrice, yearlyPrice: workPrice.yearlyPrice, }) } // Add Scratch storage - const scratchPrice = this.getStoragePriceFromCatalogue("HDD", 0.4) + const scratchPrice = this.getStoragePriceFromCatalogue("HDD", payload.scratch) if (scratchPrice) { newLab.selectedStorage.push({ id: 2, name: "volume-3", usage: "Scratch", type: "HDD", - size: 0.3, + size: payload.scratch, monthlyPrice: scratchPrice.monthlyPrice, yearlyPrice: scratchPrice.yearlyPrice, })