mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-11 05:17:41 +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"){
|
||||
attr.tick_size = 1024;
|
||||
}
|
||||
|
||||
var selectInput = inputUnit
|
||||
? "<div class=\"input-group-button\">"+
|
||||
"<select class=\"mb_input_unit\">" +
|
||||
"<option value=\"MB\">"+Locale.tr("MB")+"</option>" +
|
||||
"<option value=\"GB\">"+Locale.tr("GB")+"</option>" +
|
||||
"<option value=\"TB\">"+Locale.tr("TB")+"</option>" +
|
||||
"</select>" +
|
||||
"</div>" : "<span style='margin-left:0.5rem'>MB</span>";
|
||||
var select = '';
|
||||
var selectInput = inputUnit? '': 'disabled';
|
||||
if(attr && attr.visor){
|
||||
var select = "<select class=\"mb_input_unit\" "+selectInput+">" +
|
||||
"<option value=\"MB\">"+Locale.tr("MB")+"</option>" +
|
||||
"<option value=\"GB\">"+Locale.tr("GB")+"</option>" +
|
||||
"<option value=\"TB\">"+Locale.tr("TB")+"</option>" +
|
||||
"</select>";
|
||||
}
|
||||
|
||||
|
||||
div.html(
|
||||
"<div class=\"input-group mb_input_wrapper\"" +
|
||||
(!inputUnit && " style='display:flex;align-items:center;'") + ">"+
|
||||
"<div class=\"input-group mb_input_wrapper\" style=\"display:flex;align-items:center;\"" + ">"+
|
||||
"<div class=\"mb_input input-group-field\">" +
|
||||
_attributeInput(attr) +
|
||||
"</div>" + selectInput + "</div>");
|
||||
_setupAttributeInputMB(div, inputUnit);
|
||||
"</div>"+
|
||||
"<div class=\"input-group-button\">"+
|
||||
select+
|
||||
"</div>"+
|
||||
"</div>");
|
||||
_setupAttributeInputMB(div);
|
||||
}
|
||||
|
||||
function _setupAttributeInputMB(context, inputUnit) {
|
||||
function _setupAttributeInputMB(context) {
|
||||
var base = 1024;
|
||||
var baseCal = 1;
|
||||
var unit = "MB";
|
||||
@ -769,7 +773,7 @@ define(function(require) {
|
||||
$("input, select", contextElement).val(valueInMB);
|
||||
valueInUnit = valueInMB / baseCal;
|
||||
}
|
||||
$("input.visor", contextElement).val(inputUnit ? valueInUnit : valueInMB);
|
||||
$("input.visor", contextElement).val(valueInUnit);
|
||||
var contextUnit = contextElement.siblings(".input-group-button");
|
||||
$(".mb_input_unit", contextUnit).val(unit).trigger("change");
|
||||
}
|
||||
|
@ -247,9 +247,8 @@ meter {
|
||||
width: 4em;
|
||||
}
|
||||
|
||||
span.mb_input_unit {
|
||||
width: auto;
|
||||
margin-left: 0.5em;
|
||||
select.mb_input_unit {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.superHide{
|
||||
|
Loading…
Reference in New Issue
Block a user