2017-07-13 19:46:51 -04:00
|
|
|
{% extends "base.html" %}
|
|
|
|
|
2017-07-20 19:30:09 -04:00
|
|
|
{% block head %}
|
|
|
|
{{ super() }}
|
|
|
|
<script type="text/javascript">
|
2017-09-09 02:32:04 -04:00
|
|
|
function getPeriod()
|
2017-07-20 19:30:09 -04:00
|
|
|
{
|
|
|
|
var period = 0;
|
|
|
|
var periodselect = document.getElementById('period');
|
|
|
|
period = periodselect.value;
|
|
|
|
return period;
|
|
|
|
}
|
|
|
|
|
|
|
|
function calculateTotal()
|
|
|
|
{
|
2017-09-09 02:32:04 -04:00
|
|
|
var period = getPeriod();
|
2018-01-09 06:05:45 -05:00
|
|
|
var tpm = {{ tpm }};
|
2017-09-09 02:32:04 -04:00
|
|
|
var discount = {{ discount }};
|
2018-01-09 06:05:45 -05:00
|
|
|
var ppm = {{ ppm }};
|
|
|
|
|
2017-09-09 02:32:04 -04:00
|
|
|
var pricetotal = 0;
|
|
|
|
pricetotal = period * ppm;
|
|
|
|
var priceselect = document.getElementById('totalPrice');
|
2018-01-09 06:05:45 -05:00
|
|
|
priceselect.innerHTML = "Total: " + period + " x " + ppm + " = " + pricetotal +" {{ currency }}";
|
2017-09-09 02:32:04 -04:00
|
|
|
|
|
|
|
var discounttotal = 0;
|
|
|
|
discounttotal = period * discount;
|
|
|
|
var discountselect = document.getElementById('totalDiscount');
|
|
|
|
discountselect.innerHTML = "Discount <font color=#ff0000>-{{ deploy.discount }}%</font>: "+discounttotal+" {{ currency }}";
|
|
|
|
|
2017-07-20 19:30:09 -04:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block title %}Activate deployment{% endblock %}
|
2017-07-13 19:46:51 -04:00
|
|
|
|
|
|
|
{% block page_content %}
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
|
|
<div class="col-md-12">
|
|
|
|
<div class="panel panel-info">
|
2017-07-20 19:30:09 -04:00
|
|
|
<div class="panel-heading">Activate deployment {{ deploy.machine_alias }}</div>
|
2017-07-13 19:46:51 -04:00
|
|
|
<div class="panel-body">
|
|
|
|
|
2017-09-09 02:32:04 -04:00
|
|
|
<form method="POST" action="{{ url_for('vmanager.activate', itemid=deploy.machine_id) }}">
|
2017-07-15 00:13:57 -04:00
|
|
|
<h3>
|
2017-07-20 19:30:09 -04:00
|
|
|
CPU: {{ deploy.machine_cpu }} cores<br />
|
|
|
|
Memory: {{ deploy.machine_mem }} MB<br />
|
|
|
|
Storage: {{ deploy.machine_hdd }} GB<br />
|
|
|
|
{{ form.period.label }} {{ form.period(**{"onchange":"calculateTotal()"}) }}<br />
|
2017-07-13 19:46:51 -04:00
|
|
|
{% for error in form.period.errors %}
|
|
|
|
{{ error }}<br />
|
|
|
|
{% endfor %}
|
2017-07-15 00:13:57 -04:00
|
|
|
---<br />
|
2017-09-09 02:32:04 -04:00
|
|
|
{% if deploy.discount != 0 %}
|
2018-01-09 06:05:45 -05:00
|
|
|
<div id="totalDiscount">Discount <font color=#ff0000>-{{ deploy.discount }}%</font>: {{ deploy.period * discount }} {{ currency }}</div>
|
2017-09-09 02:32:04 -04:00
|
|
|
{% endif %}
|
2018-01-09 06:05:45 -05:00
|
|
|
<div id="totalPrice">Total: {{ deploy.period }} x {{ ppm }} = {{ total }} {{ currency }}</div>
|
|
|
|
|
2017-07-15 00:13:57 -04:00
|
|
|
</h3>
|
|
|
|
|
2017-07-13 19:46:51 -04:00
|
|
|
<p>
|
|
|
|
{{ form.csrf_token() }}
|
|
|
|
{{ form.submit }}
|
|
|
|
</p>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2017-09-09 02:32:04 -04:00
|
|
|
</div>
|
|
|
|
|
2017-07-13 19:46:51 -04:00
|
|
|
{% endblock %}
|
|
|
|
|