diff --git a/share/scripts/context-packages/base_deb/etc/one-context.d/00-network b/share/scripts/context-packages/base_deb/etc/one-context.d/00-network index 7a7398ccba..f3034435ce 100755 --- a/share/scripts/context-packages/base_deb/etc/one-context.d/00-network +++ b/share/scripts/context-packages/base_deb/etc/one-context.d/00-network @@ -166,13 +166,25 @@ EOT configure_network() { gen_network_configuration > /etc/network/interfaces +} - service networking stop - sleep 1 - service networking start +activate_network() +{ + if [[ `lsb_release -c | awk '{print($2)}'` = precise ]]; then + IFACES=`get_interfaces` + + for i in $IFACES; do + DEV=`get_dev $i` + service network-interface restart INTERFACE=$DEV + done + else + service networking stop + sleep 1 + service networking start + fi sleep 2 } configure_network - +activate_network diff --git a/src/sunstone/public/js/plugins/groups-tab.js b/src/sunstone/public/js/plugins/groups-tab.js index 9bc1785a76..1838ca3821 100644 --- a/src/sunstone/public/js/plugins/groups-tab.js +++ b/src/sunstone/public/js/plugins/groups-tab.js @@ -1263,7 +1263,7 @@ function setupCreateGroupDialog(){ separator = "+"; }); - group_json['group']['admin_group_resources'] = resources; + group_json['group']['admin_resources'] = resources; if ( $('#group_admin_res_user', dialog).prop("checked") ){ group_json['group']['admin_manage_users'] = "YES"; diff --git a/src/sunstone/public/js/plugins/images-tab.js b/src/sunstone/public/js/plugins/images-tab.js index c2fff57c2b..782562f0cb 100644 --- a/src/sunstone/public/js/plugins/images-tab.js +++ b/src/sunstone/public/js/plugins/images-tab.js @@ -245,13 +245,15 @@ var image_actions = { type: "create", call: OpenNebula.Image.create, callback: function(request, response){ - // Reset the create wizard + addImageElement(request, response); + if ($appmarket_import_dialog || $marketplace_import_dialog) { + $create_image_dialog.trigger('close'); + } else { $create_image_dialog.foundation('reveal', 'close'); $create_image_dialog.empty(); setupCreateImageDialog(); - - addImageElement(request, response); - notifyCustom(tr("Image created"), " ID: " + response.IMAGE.ID, false); + } + notifyCustom(tr("Image created"), " ID: " + response.IMAGE.ID, false) }, error: onError }, @@ -987,6 +989,8 @@ function initialize_create_image_dialog(dialog) { }; $('#create_image_submit',dialog).click(function(){ + $create_image_dialog = dialog; + var exit = false; var upload = false; $('.img_man',this).each(function(){ diff --git a/src/sunstone/public/js/plugins/marketplace-tab.js b/src/sunstone/public/js/plugins/marketplace-tab.js index 54a23fa8d6..6e9ea6af5c 100644 --- a/src/sunstone/public/js/plugins/marketplace-tab.js +++ b/src/sunstone/public/js/plugins/marketplace-tab.js @@ -60,7 +60,6 @@ var market_actions = { dialogs_context.append(marketplace_import_dialog); $marketplace_import_dialog = $('#marketplace_import_dialog',dialogs_context); $marketplace_import_dialog.addClass("reveal-modal large max-height").attr("data-reveal", ""); - $marketplace_import_dialog.foundation().foundation('reveal', 'open'); var tab_id = 1; @@ -110,8 +109,8 @@ var market_actions = { }) image_dialog.on("close", function(){ - a_image_dialog.html(""); - image_dialog.html(""); + a_image_dialog.remove(); + image_dialog.remove(); if ($('a', $("dl#marketplace_import_dialog_tabs")).size > 0) { $('a', $("dl#marketplace_import_dialog_tabs")).first().click(); } else { @@ -125,7 +124,19 @@ var market_actions = { }) if (response['opennebula_template'] && response['opennebula_template'] !== "CPU=1") { - $create_template_dialog.html(""); + var opennebula_template; + + try { + opennebula_template = JSON.parse(response['opennebula_template']); + } catch (error) { + notifyError("Error parsing OpenNebula template: " + error.message); + return; + } + + if ($create_template_dialog) { + $create_template_dialog.html(""); + } + // Template // Append the new div containing the tab and add the tab to the list var template_dialog = $('