add service level detail infos

This commit is contained in:
Tobias Brunner 2025-06-04 16:30:28 +02:00
parent 15ede53cc3
commit 21c9734fd3
No known key found for this signature in database
2 changed files with 17 additions and 2 deletions

View file

@ -54,6 +54,7 @@ class PriceCalculator {
this.planDescription = document.getElementById('planDescription'); this.planDescription = document.getElementById('planDescription');
this.planCpus = document.getElementById('planCpus'); this.planCpus = document.getElementById('planCpus');
this.planMemory = document.getElementById('planMemory'); this.planMemory = document.getElementById('planMemory');
this.planServiceLevel = document.getElementById('planServiceLevel');
this.managedServicePrice = document.getElementById('managedServicePrice'); this.managedServicePrice = document.getElementById('managedServicePrice');
this.storagePriceEl = document.getElementById('storagePrice'); this.storagePriceEl = document.getElementById('storagePrice');
this.storageAmount = document.getElementById('storageAmount'); this.storageAmount = document.getElementById('storageAmount');
@ -350,12 +351,16 @@ class PriceCalculator {
this.selectedPlanDetails.style.display = 'block'; this.selectedPlanDetails.style.display = 'block';
if (this.noMatchFound) this.noMatchFound.style.display = 'none'; if (this.noMatchFound) this.noMatchFound.style.display = 'none';
// Get current service level
const serviceLevel = document.querySelector('input[name="serviceLevel"]:checked')?.value || 'Best Effort';
// Update plan information // Update plan information
if (this.planGroup) this.planGroup.textContent = plan.groupName; if (this.planGroup) this.planGroup.textContent = plan.groupName;
if (this.planName) this.planName.textContent = plan.compute_plan; if (this.planName) this.planName.textContent = plan.compute_plan;
if (this.planDescription) this.planDescription.textContent = plan.compute_plan_group_description || ''; if (this.planDescription) this.planDescription.textContent = plan.compute_plan_group_description || '';
if (this.planCpus) this.planCpus.textContent = plan.vcpus; if (this.planCpus) this.planCpus.textContent = plan.vcpus;
if (this.planMemory) this.planMemory.textContent = plan.ram + ' GB'; if (this.planMemory) this.planMemory.textContent = plan.ram + ' GB';
if (this.planServiceLevel) this.planServiceLevel.textContent = serviceLevel;
// Calculate pricing // Calculate pricing
const computePriceValue = parseFloat(plan.compute_plan_price); const computePriceValue = parseFloat(plan.compute_plan_price);

View file

@ -256,14 +256,20 @@
</div> </div>
<div class="row mb-3"> <div class="row mb-3">
<div class="col-6"> <div class="col-4">
<small class="text-muted">vCPUs</small> <small class="text-muted">vCPUs</small>
<div class="fw-bold" id="planCpus"></div> <div class="fw-bold" id="planCpus"></div>
</div> </div>
<div class="col-6"> <div class="col-4">
<small class="text-muted">Memory</small> <small class="text-muted">Memory</small>
<div class="fw-bold" id="planMemory"></div> <div class="fw-bold" id="planMemory"></div>
</div> </div>
<div class="col-4">
<small class="text-muted">Service Level</small>
<div class="fw-bold">
<a href="https://products.vshn.ch/service_levels.html" target="_blank" class="text-decoration-none" id="planServiceLevel"></a>
</div>
</div>
</div> </div>
<!-- Pricing Breakdown --> <!-- Pricing Breakdown -->
@ -281,6 +287,10 @@
<span class="fs-5 fw-bold">Total Monthly Price</span> <span class="fs-5 fw-bold">Total Monthly Price</span>
<span class="fs-4 fw-bold text-primary">CHF <span id="totalPrice">0.00</span></span> <span class="fs-4 fw-bold text-primary">CHF <span id="totalPrice">0.00</span></span>
</div> </div>
<small class="text-muted mt-2 d-block">
<i class="bi bi-info-circle me-1"></i>
Monthly pricing based on 30 days (720 hours). Billing is conducted per hour.
</small>
</div> </div>
</div> </div>