",
- {
- class:"columns small-12",
- id:"placeDatatable_"+index
- }
- ).html(vnetsTable.dataTableHTML))
+ ).add(
+ $("
",
+ {
+ class:"columns small-12",
+ id:"placeDatatable_"+index
+ }
+ ).html(table.dataTableHTML)
+ )
)
)
)
@@ -395,9 +419,30 @@ define(function(require) {
);
}
separator = $("
");
- vnetsTable.initialize();
+ table.initialize();
$("#refresh_button_" + unique_id).click();
- vnetsTable.idInput().attr("wizard_field", vnet_attr.name).attr("required", "");
+ table.idInput().attr("wizard_field", vnet_attr.name).attr("required", "");
+
+ // Fill type, id of vnet/vnet-template and extra
+ $(".changePlaceDatatable[data-id="+index+"]").val(type)
+ table.selectResourceTableSelect({ 'ids': String(id) })
+ if (type === "template_id" || type === "reserve_from") {
+ $("#placeDatatable_"+index).append(
+ $("
",{'class': "row addExtra_"+id}).append(
+ $("
",{'class': "columns small-12"}).append(
+ $("
").text(Locale.tr("Extra")).add(
+ $("
",{
+ 'wizard_field': "extra_"+vnet_attr.name,
+ 'type': "text",
+ 'name': "extra",
+ 'id': "extra",
+ 'placeholder': Locale.tr("Extra")
+ }).val(extra)
+ )
+ )
+ )
+ )
+ }
});
if(opts && opts.select_networks){
$(".changePlaceDatatable").change(function(e){
@@ -408,21 +453,18 @@ define(function(require) {
var nametable = element.attr("data-nametable");
var value = element.val();
var place = $("#placeDatatable_"+id);
- if(value === "reserve" || value === "existing"){
- var vnetsTable = new VNetsTable(idtable, {"select": true});
- place.empty().append(vnetsTable.dataTableHTML);
- vnetsTable.initialize();
- $("#refresh_button_"+idtable).click();
- vnetsTable.idInput().attr("wizard_field", nametable).attr("required", "");
+ if(value === "reserve_from" || value === "id"){
+ var table = new VNetsTable(idtable, {"select": true});
}else{
- var vnetsTemplateTable = new VNetsTemplateTable(idtable, {"select": true});
- place.empty().append(vnetsTemplateTable.dataTableHTML);
- vnetsTemplateTable.initialize();
- $("#refresh_button_"+idtable).click();
- vnetsTemplateTable.idInput().attr("wizard_field", nametable).attr("required", "");
+ var table = new VNetsTemplateTable(idtable, {"select": true});
}
+ place.empty().append(table.dataTableHTML);
+ table.initialize();
+ $("#refresh_button_"+idtable).click();
+ table.idInput().attr("wizard_field", nametable).attr("required", "");
+
// create input extra
- if(value === "create" || value === "reserve"){
+ if(value === "template_id" || value === "reserve_from"){
// falta colocar el render de las diferentes tablas!!!
if(!place.find(".addExtra_"+id).length){
place.append(
@@ -520,6 +562,8 @@ define(function(require) {
(attr.type != undefined ? attr.type : "text") + "|" +
(attr.description != undefined ? attr.description : "");
switch (attr.type) {
+ case "text":
+ case "text64":
case "number":
case "number-float":
case "boolean":
@@ -548,12 +592,12 @@ define(function(require) {
* ["initial":] "3"
* }
*/
- function _unmarshall(value, notype) {
+ function _unmarshall(value) {
var parts = value.split("|");
var attr = {
"mandatory": (parts[0] == "M"),
- "type": notype? parts[2]: parts[1],
- "description": notype? parts[1] : parts[2],
+ "type": parts[1],
+ "description": parts[2],
"initial": ""
};
if (parts[3] != undefined){
@@ -584,8 +628,8 @@ define(function(require) {
starting from 0, not min
}
*/
- function _parse(name, value, notype) {
- var attr = _unmarshall(value, notype);
+ function _parse(name, value) {
+ var attr = _unmarshall(value);
attr.name = name;
// TODO: error management (params undefined)
switch (attr.type) {
diff --git a/src/sunstone/public/app/utils/user-inputs/row.hbs b/src/sunstone/public/app/utils/user-inputs/row.hbs
index 5b26b3a89f..628268e8b5 100644
--- a/src/sunstone/public/app/utils/user-inputs/row.hbs
+++ b/src/sunstone/public/app/utils/user-inputs/row.hbs
@@ -25,6 +25,16 @@
+
+
+
+
+
+