From 15ede53cc31e7586843c1af3719a7a989d1847da Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Wed, 4 Jun 2025 16:22:47 +0200 Subject: [PATCH] merge compute and sla price into managed service price --- hub/services/static/js/price-calculator.js | 11 +++++------ hub/services/templates/services/offering_detail.html | 10 +++------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/hub/services/static/js/price-calculator.js b/hub/services/static/js/price-calculator.js index 2cafe7d..ef44778 100644 --- a/hub/services/static/js/price-calculator.js +++ b/hub/services/static/js/price-calculator.js @@ -54,8 +54,7 @@ class PriceCalculator { this.planDescription = document.getElementById('planDescription'); this.planCpus = document.getElementById('planCpus'); this.planMemory = document.getElementById('planMemory'); - this.computePrice = document.getElementById('computePrice'); - this.servicePrice = document.getElementById('servicePrice'); + this.managedServicePrice = document.getElementById('managedServicePrice'); this.storagePriceEl = document.getElementById('storagePrice'); this.storageAmount = document.getElementById('storageAmount'); this.totalPrice = document.getElementById('totalPrice'); @@ -262,7 +261,7 @@ class PriceCalculator { availablePlans.forEach(plan => { const option = document.createElement('option'); option.value = JSON.stringify(plan); - option.textContent = `${plan.compute_plan} - ${plan.vcpus} vCPUs, ${plan.ram} GB RAM (CHF ${parseFloat(plan.final_price).toFixed(2)}/month)`; + option.textContent = `${plan.compute_plan} - ${plan.vcpus} vCPUs, ${plan.ram} GB RAM`; this.planSelect.appendChild(option); }); } @@ -361,12 +360,12 @@ class PriceCalculator { // Calculate pricing const computePriceValue = parseFloat(plan.compute_plan_price); const servicePriceValue = parseFloat(plan.sla_price); + const managedServicePrice = computePriceValue + servicePriceValue; const storagePriceValue = storage * this.storagePrice; - const totalPriceValue = computePriceValue + servicePriceValue + storagePriceValue; + const totalPriceValue = managedServicePrice + storagePriceValue; // Update pricing display - if (this.computePrice) this.computePrice.textContent = computePriceValue.toFixed(2); - if (this.servicePrice) this.servicePrice.textContent = servicePriceValue.toFixed(2); + if (this.managedServicePrice) this.managedServicePrice.textContent = managedServicePrice.toFixed(2); if (this.storagePriceEl) this.storagePriceEl.textContent = storagePriceValue.toFixed(2); if (this.storageAmount) this.storageAmount.textContent = storage; if (this.totalPrice) this.totalPrice.textContent = totalPriceValue.toFixed(2); diff --git a/hub/services/templates/services/offering_detail.html b/hub/services/templates/services/offering_detail.html index 92f5c28..3dfdd09 100644 --- a/hub/services/templates/services/offering_detail.html +++ b/hub/services/templates/services/offering_detail.html @@ -269,15 +269,11 @@
- Compute Plan - CHF 0.00 + Managed Service (incl. Compute) + CHF 0.00
- Service Price - CHF 0.00 -
-
- Storage (20 GB) + Storage - 20 GB CHF 0.00