Skip to content

Commit

Permalink
feat: add aws 32vCPU pricing (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliwenwenwen authored Aug 16, 2024
1 parent 071fe05 commit 5cf3e5f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pingcap-jp/js/components/pricing-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
};

Expand All @@ -20,14 +20,16 @@ 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 = '<option>選択する</option>';
this.selectEl.innerHTML += Object.keys(pricing[this.provider]).map(v => `<option value="${v}">${v} vCPU</option>">`);
this.selectEl.selectedIndex = 0;
this.resultEl.innerHTML = '<span class="pricing-search__tip">Price / month</span>';
});
});

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 {
Expand Down

0 comments on commit 5cf3e5f

Please sign in to comment.