mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-25 06:03:36 +03:00
M #~: fix memory input GB (#138)
Signed-off-by: Jorge Lobo <jlobo@opennebula.io>
This commit is contained in:
parent
72dc61013d
commit
0b7723ff7f
@ -718,26 +718,30 @@ define(function(require) {
|
|||||||
if (attr.type == "range"){
|
if (attr.type == "range"){
|
||||||
attr.tick_size = 1024;
|
attr.tick_size = 1024;
|
||||||
}
|
}
|
||||||
|
var select = '';
|
||||||
var selectInput = inputUnit
|
var selectInput = inputUnit? '': 'disabled';
|
||||||
? "<div class=\"input-group-button\">"+
|
if(attr && attr.visor){
|
||||||
"<select class=\"mb_input_unit\">" +
|
var select = "<select class=\"mb_input_unit\" "+selectInput+">" +
|
||||||
"<option value=\"MB\">"+Locale.tr("MB")+"</option>" +
|
"<option value=\"MB\">"+Locale.tr("MB")+"</option>" +
|
||||||
"<option value=\"GB\">"+Locale.tr("GB")+"</option>" +
|
"<option value=\"GB\">"+Locale.tr("GB")+"</option>" +
|
||||||
"<option value=\"TB\">"+Locale.tr("TB")+"</option>" +
|
"<option value=\"TB\">"+Locale.tr("TB")+"</option>" +
|
||||||
"</select>" +
|
"</select>";
|
||||||
"</div>" : "<span style='margin-left:0.5rem'>MB</span>";
|
}
|
||||||
|
|
||||||
|
|
||||||
div.html(
|
div.html(
|
||||||
"<div class=\"input-group mb_input_wrapper\"" +
|
"<div class=\"input-group mb_input_wrapper\" style=\"display:flex;align-items:center;\"" + ">"+
|
||||||
(!inputUnit && " style='display:flex;align-items:center;'") + ">"+
|
|
||||||
"<div class=\"mb_input input-group-field\">" +
|
"<div class=\"mb_input input-group-field\">" +
|
||||||
_attributeInput(attr) +
|
_attributeInput(attr) +
|
||||||
"</div>" + selectInput + "</div>");
|
"</div>"+
|
||||||
_setupAttributeInputMB(div, inputUnit);
|
"<div class=\"input-group-button\">"+
|
||||||
|
select+
|
||||||
|
"</div>"+
|
||||||
|
"</div>");
|
||||||
|
_setupAttributeInputMB(div);
|
||||||
}
|
}
|
||||||
|
|
||||||
function _setupAttributeInputMB(context, inputUnit) {
|
function _setupAttributeInputMB(context) {
|
||||||
var base = 1024;
|
var base = 1024;
|
||||||
var baseCal = 1;
|
var baseCal = 1;
|
||||||
var unit = "MB";
|
var unit = "MB";
|
||||||
@ -769,7 +773,7 @@ define(function(require) {
|
|||||||
$("input, select", contextElement).val(valueInMB);
|
$("input, select", contextElement).val(valueInMB);
|
||||||
valueInUnit = valueInMB / baseCal;
|
valueInUnit = valueInMB / baseCal;
|
||||||
}
|
}
|
||||||
$("input.visor", contextElement).val(inputUnit ? valueInUnit : valueInMB);
|
$("input.visor", contextElement).val(valueInUnit);
|
||||||
var contextUnit = contextElement.siblings(".input-group-button");
|
var contextUnit = contextElement.siblings(".input-group-button");
|
||||||
$(".mb_input_unit", contextUnit).val(unit).trigger("change");
|
$(".mb_input_unit", contextUnit).val(unit).trigger("change");
|
||||||
}
|
}
|
||||||
|
@ -247,9 +247,8 @@ meter {
|
|||||||
width: 4em;
|
width: 4em;
|
||||||
}
|
}
|
||||||
|
|
||||||
span.mb_input_unit {
|
select.mb_input_unit {
|
||||||
width: auto;
|
margin-bottom: 0px;
|
||||||
margin-left: 0.5em;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.superHide{
|
.superHide{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user