sync the vcpu and memory sliders when moving around
This commit is contained in:
parent
a7713b46a2
commit
9a86e023dd
4 changed files with 251 additions and 11 deletions
|
|
@ -150,6 +150,31 @@ class PricingDataManager {
|
|||
return { maxCpus, maxMemory };
|
||||
}
|
||||
|
||||
// Get all unique CPU and memory values from plans
|
||||
getAvailableSliderValues() {
|
||||
if (!this.pricingData) return { cpuValues: [], memoryValues: [] };
|
||||
|
||||
const cpuSet = new Set();
|
||||
const memorySet = new Set();
|
||||
|
||||
// Collect all unique CPU and memory values across all plans
|
||||
Object.keys(this.pricingData).forEach(groupName => {
|
||||
const group = this.pricingData[groupName];
|
||||
Object.keys(group).forEach(serviceLevel => {
|
||||
group[serviceLevel].forEach(plan => {
|
||||
cpuSet.add(parseFloat(plan.vcpus));
|
||||
memorySet.add(parseFloat(plan.ram));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Convert to sorted arrays
|
||||
const cpuValues = Array.from(cpuSet).sort((a, b) => a - b);
|
||||
const memoryValues = Array.from(memorySet).sort((a, b) => a - b);
|
||||
|
||||
return { cpuValues, memoryValues };
|
||||
}
|
||||
|
||||
// Get all plans for a specific service level
|
||||
getPlansForServiceLevel(serviceLevel) {
|
||||
if (!this.pricingData || !serviceLevel) return [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue