From 5cf3e5fe56939fd102e6bda86b3db59ce65e6052 Mon Sep 17 00:00:00 2001 From: xuliwenwenwen <74528885+xuliwenwenwen@users.noreply.github.com> Date: Fri, 16 Aug 2024 16:35:35 +0800 Subject: [PATCH] feat: add aws 32vCPU pricing (#28) --- pingcap-jp/js/components/pricing-search.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pingcap-jp/js/components/pricing-search.js b/pingcap-jp/js/components/pricing-search.js index 64c1485..23768e8 100644 --- a/pingcap-jp/js/components/pricing-search.js +++ b/pingcap-jp/js/components/pricing-search.js @@ -7,7 +7,7 @@ class PricingSearch { this.provider = 'aws'; const pricing = { - aws: { 2: 692, 4: 1339, 8: 2656, 16: 5250 }, + aws: { 2: 692, 4: 1339, 8: 2656, 16: 5250, 32: 10342 }, gcp: { 2: 754, 4: 1405, 8: 2862, 16: 5297 } }; @@ -20,6 +20,8 @@ class PricingSearch { this.tabEls.forEach((el) => el.classList.remove('active')); e.currentTarget.classList.add('active'); this.provider = e.currentTarget.getAttribute('data-provider'); + this.selectEl.innerHTML = ''; + this.selectEl.innerHTML += Object.keys(pricing[this.provider]).map(v => `">`); this.selectEl.selectedIndex = 0; this.resultEl.innerHTML = 'Price / month'; }); @@ -27,7 +29,7 @@ class PricingSearch { this.selectEl.addEventListener('change', (e) => { const value = parseInt(e.currentTarget.value); - console.log(this.provider,value); + if (value) { this.resultEl.innerHTML = `Starts from $${pricing[this.provider][value]} / month`; } else {