merge compute and sla price into managed service price
This commit is contained in:
parent
2da6285800
commit
15ede53cc3
2 changed files with 8 additions and 13 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue