mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
Solved NaN Cost in general panel VM Template (#409)
This commit is contained in:
parent
d436795371
commit
ea84b0b446
@ -84,8 +84,17 @@ define(function(require) {
|
||||
}
|
||||
|
||||
function _totalCost(){
|
||||
var total = document.getElementById('real_memory_cost').value + document.getElementById('real_cpu_cost').value;
|
||||
document.getElementById('total_cost').textContent = "Total: "+ convertCostNumber(total);
|
||||
var memory = document.getElementById('real_memory_cost').value;
|
||||
var cpu = document.getElementById('real_cpu_cost').value;
|
||||
if(memory === undefined && cpu === undefined){
|
||||
document.getElementById('total_cost').textContent = "Total: 0.00";
|
||||
} else if(memory === undefined){
|
||||
document.getElementById('total_cost').textContent = "Total: " + convertCostNumber(cpu);
|
||||
} else if(cpu === undefined){
|
||||
document.getElementById('total_cost').textContent = "Total: " + convertCostNumber(memory);
|
||||
} else {
|
||||
document.getElementById('total_cost').textContent = "Total: " + convertCostNumber(memory + cpu);
|
||||
}
|
||||
}
|
||||
|
||||
function _calculatedRealMemory(){
|
||||
|
@ -119,7 +119,7 @@
|
||||
<legend>
|
||||
{{tr "Cost"}}
|
||||
<span>
|
||||
<span id="total_cost">0.00</span>
|
||||
<span id="total_cost"></span>
|
||||
<small>{{tr "COST"}} / {{tr "MONTH"}}</small>
|
||||
</span>
|
||||
</legend>
|
||||
|
Loading…
x
Reference in New Issue
Block a user