Added IPv4 option on VPS

master
Adrien W 3 months ago
parent b9e12dd357
commit 0fca29ec74

@ -43,7 +43,13 @@ const prices = {
vps: {
storage: storage_price.map(x => x * 1.1297),
cpu: [6.146, 7.687, 9.218, 10.749],
ram: [1.646, 2.057, 2.468, 2.879]
ram: [1.646, 2.057, 2.468, 2.879],
options: {
ip4: {
basePrice: 4.393,
factor: 1.097
}
}
}
};
@ -210,7 +216,7 @@ $('#vps_stockage_source')
$('#vps_cpu_source')
.slider({
showThumbTooltip: true,
restrictedLabels: [0, 1, 2, 4, 8, 16, 32, 48, 64],
restrictedLabels: [0, 1, 2, 4, 6, 8, 12, 16, 24, 32, 48, 64],
min: 0,
max: 64,
step: 1,
@ -225,7 +231,7 @@ $('#vps_cpu_source')
$('#vps_ram_source')
.slider({
showThumbTooltip: true,
restrictedLabels: [0, 1, 2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128],
restrictedLabels: [0, 1, 2, 4, 8, 12, 16, 24, 32, 48, 64, 96, 128],
min: 0,
max: 128,
step: 1,
@ -250,6 +256,7 @@ function updatePrice() {
const vpsPriceStorage = $('#vps_stockage_source').slider('get value');
const vpsPriceCpu = $('#vps_cpu_source').slider('get value');
const vpsPriceRam = $('#vps_ram_source').slider('get value');
const cbVpsIp4 = $('.ui.toggle.checkbox.vps_opt_ip4').checkbox('is checked');
const cbNcLxc = $('.ui.toggle.checkbox.nc_opt_lxc').checkbox('is checked');
const cbNcDedicated = $('.ui.toggle.checkbox.nc_opt_decicated').checkbox('is checked');
@ -311,6 +318,7 @@ function updatePrice() {
let vpsPrice = vpsPriceStorage * prices.vps.storage[i]
+ vpsPriceCpu * prices.vps.cpu[i]
+ vpsPriceRam * prices.vps.ram[i];
if (cbVpsIp4) vpsPrice = (vpsPrice + prices.vps.options.ip4.basePrice) * prices.vps.options.ip4.factor;
let totalPrice = ncPrice + whPrice + mailPrice + vpsPrice;

@ -429,6 +429,12 @@ $currentPage = $pages["tarifs"];
<p>Volume de mémoire vive.</p>
<div class="ui labeled ticked slider grey" id="vps_ram_source"></div>
<h5><i class="icon ethernet"></i>Options</h5>
<p></p>
<div class="ui toggle checkbox vps_opt_ip4">
<input type="checkbox" name="vps_opt_ip4" id="vps_opt_ip4">
<label for="vps_opt_ip4"><strong>IPv4</strong>: Une adresse IPv4 publique dédiée (plus sur demande).</label>
</div>
</div>
</div>
</div>

Loading…
Cancel
Save