From 82b7a3913f5de1b510ab1d600ead422897ac9674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Mon, 22 Jun 2015 12:44:35 +0200 Subject: [PATCH] Feature #3748: vCenter import in host wizard --- .../app/tabs/hosts-tab/form-panels/create.js | 952 +++++++++++------- .../hosts-tab/form-panels/create/wizard.hbs | 27 +- 2 files changed, 627 insertions(+), 352 deletions(-) diff --git a/src/sunstone/public/app/tabs/hosts-tab/form-panels/create.js b/src/sunstone/public/app/tabs/hosts-tab/form-panels/create.js index 1a2e771fd7..ad7cc9a4fe 100644 --- a/src/sunstone/public/app/tabs/hosts-tab/form-panels/create.js +++ b/src/sunstone/public/app/tabs/hosts-tab/form-panels/create.js @@ -8,7 +8,12 @@ define(function(require) { var Locale = require('utils/locale'); var Tips = require('utils/tips'); var Notifier = require('utils/notifier'); - var ResourceSelect = require('utils/resource-select') + var ResourceSelect = require('utils/resource-select'); + var OpenNebulaError = require('opennebula/error'); + var OpenNebulaHost = require('opennebula/host'); + var OpenNebulaTemplate = require('opennebula/template'); + var OpenNebulaVM = require('opennebula/vm'); + var OpenNebulaNetwork = require('opennebula/network'); /* TEMPLATES @@ -71,396 +76,381 @@ define(function(require) { $(".vcenter_credentials", context).hide(); $("#vnm_mads", context).show(); $("#name_container", context).show(); - $("#create_host_submit", context).show(); + $("#"+TAB_ID+"submit_button", "#"+TAB_ID).show(); $(".drivers", context).show(); } else if (this.value == "vcenter") { $("#vnm_mads", context).hide(); $("#name_container", context).hide(); $(".vcenter_credentials", context).show(); - $("#create_host_submit", context).hide(); + $("#"+TAB_ID+"submit_button", "#"+TAB_ID).hide(); $(".drivers", context).hide(); } else { $(".vcenter_credentials", context).hide(); $("#vnm_mads", context).show(); $("#name_container", context).show(); - $("#create_host_submit", context).show(); + $("#"+TAB_ID+"submit_button", "#"+TAB_ID).show(); $(".drivers", context).hide(); } - }) + }); - /* TODO $("#get_vcenter_clusters", context).on("click", function() { - // TODO notify if credentials empty - var container = $(".vcenter_clusters", context); + // TODO notify if credentials empty + var container = $(".vcenter_clusters", context); - container.html(generateAdvancedSection({ - html_id: "/vcenter", - title: Locale.tr("Clusters"), - content: '' + - '' + - '' + - '' - })) + container.show(); - $('a', container).trigger("click") + $(".accordion_advanced_toggle", container).trigger("click"); - $.ajax({ - url: 'vcenter', - type: "GET", - data: {timeout: false}, - dataType: "json", - headers: { - "X_VCENTER_USER": $("#vcenter_user", context).val(), - "X_VCENTER_PASSWORD": $("#vcenter_password", context).val(), - "X_VCENTER_HOST": $("#vcenter_host", context).val() - }, - success: function(response) { - $("#vcenter_user", context).atLocale.tr("disabled", "disabled") - $("#vcenter_password", context).atLocale.tr("disabled", "disabled") - $("#vcenter_host", context).atLocale.tr("disabled", "disabled") - $("#get_vcenter_clusters", context).hide(); - $(".import_vcenter_clusters_div", context).show(); + $.ajax({ + url: 'vcenter', + type: "GET", + data: {timeout: false}, + dataType: "json", + headers: { + "X_VCENTER_USER": $("#vcenter_user", context).val(), + "X_VCENTER_PASSWORD": $("#vcenter_password", context).val(), + "X_VCENTER_HOST": $("#vcenter_host", context).val() + }, + success: function(response) { + $("#vcenter_user", context).attr("disabled", "disabled"); + $("#vcenter_password", context).attr("disabled", "disabled"); + $("#vcenter_host", context).attr("disabled", "disabled"); + $("#get_vcenter_clusters", context).hide(); + $(".import_vcenter_clusters_div", context).show(); - $(".content", container).html(""); + $(".content", container).html(""); + $('
' + + '
' + + '

' + Locale.tr("Please select the vCenter Clusters to be imported to OpenNebula. Each vCenter Cluster will be included as a new OpenNebula Host") + '

' + + '
' + + '
').appendTo($(".content", container)); + + $.each(response, function(datacenter_name, clusters) { + $('
' + + '
' + + '
' + + datacenter_name + ' ' + Locale.tr("Datacenter") + + '
' + + '
' + + '
').appendTo($(".content", container)); + + if (clusters.length == 0) { $('
' + '
' + - '

' + Locale.tr("Please select the vCenter Clusters to be imported to OpenNebula. Each vCenter Cluster will be included as a new OpenNebula Host") + '

' + + '' + '
' + - '
').appendTo($(".content", container)) - - $.each(response, function(datacenter_name, clusters) { - $('
' + - '
' + - '
' + - datacenter_name + ' ' + Locale.tr("Datacenter") + - '
' + + '
').appendTo($(".content", container)); + } else { + $.each(clusters, function(id, cluster_name) { + var row = $('
' + + '
' + + '
' + + '' + + '
' + '
' + - '
').appendTo($(".content", container)) + '
' + + '
' + + '
' + + '
' + + '
').appendTo($(".content", container)); - if (clusters.length == 0) { - $('
' + - '
' + - '' + - '
' + - '
').appendTo($(".content", container)) - } else { - $.each(clusters, function(id, cluster_name) { - var row = $('
' + - '
' + - '
' + - '' + - '
' + - '
' + - '
' + - '
' + - '
' + - '
' + - '
').appendTo($(".content", container)) - - $(".cluster_name", row).data("cluster_name", cluster_name) - $(".cluster_name", row).data("datacenter_name", datacenter_name) - }); - } - }); - - var templates_container = $(".vcenter_templates", context); - var vms_container = $(".vcenter_vms", context); - var networks_container = $(".vcenter_networks", context); - - var vcenter_user = $("#vcenter_user", context).val(); - var vcenter_password = $("#vcenter_password", context).val(); - var vcenter_host = $("#vcenter_host", context).val(); - - fillVCenterTemplates({ - container: templates_container, - vcenter_user: vcenter_user, - vcenter_password: vcenter_password, - vcenter_host: vcenter_host - }); - - fillVCenterNetworks({ - container: networks_container, - vcenter_user: vcenter_user, - vcenter_password: vcenter_password, - vcenter_host: vcenter_host - }); - }, - error: function(response) { - $(".vcenter_clusters", context).html('') - onError({}, OpenNebula.Error(response)); - } + $(".cluster_name", row).data("cluster_name", cluster_name); + //$(".cluster_name", row).data("datacenter_name", datacenter_name); + }); + } }); - return false; - }) + var templates_container = $(".vcenter_templates", context); + var vms_container = $(".vcenter_vms", context); + var networks_container = $(".vcenter_networks", context); + + var vcenter_user = $("#vcenter_user", context).val(); + var vcenter_password = $("#vcenter_password", context).val(); + var vcenter_host = $("#vcenter_host", context).val(); + + fillVCenterTemplates({ + container: templates_container, + vcenter_user: vcenter_user, + vcenter_password: vcenter_password, + vcenter_host: vcenter_host + }); + + fillVCenterNetworks({ + container: networks_container, + vcenter_user: vcenter_user, + vcenter_password: vcenter_password, + vcenter_host: vcenter_host + }); + }, + error: function(response) { + $(".vcenter_clusters", context).hide(); + Notifier.onError({}, OpenNebulaError(response)); + } + }); + + return false; + }); $("#import_vcenter_clusters", context).on("click", function() { - $(this).hide(); + $(this).hide(); - var cluster_id = $('#host_cluster_id .resource_list_select', context).val(); - if (!cluster_id) cluster_id = "-1"; + var cluster_id = $('#host_cluster_id .resource_list_select', context).val(); + if (!cluster_id) cluster_id = "-1"; - $.each($(".cluster_name:checked", context), function() { - var cluster_context = $(this).closest(".vcenter_cluster"); - $(".vcenter_host_result:not(.success)", cluster_context).html('' + - '' + - '' + - ''); + $.each($(".cluster_name:checked", context), function() { + var cluster_context = $(this).closest(".vcenter_cluster"); + $(".vcenter_host_result:not(.success)", cluster_context).html('' + + '' + + '' + + ''); - var host_json = { - "host": { - "name": $(this).data("cluster_name"), - "vm_mad": "vcenter", - "vnm_mad": "dummy", - "im_mad": "vcenter", - "cluster_id": cluster_id - } - }; + var host_json = { + "host": { + "name": $(this).data("cluster_name"), + "vm_mad": "vcenter", + "vnm_mad": "dummy", + "im_mad": "vcenter", + "cluster_id": cluster_id + } + }; - OpenNebula.Host.create({ - timeout: true, - data: host_json, - success: function(request, response) { - OpenNebula.Helper.clear_cache("HOST"); - - $(".vcenter_host_result", cluster_context).addClass("success").html( - '' + - '' + - '' + - ''); - - $(".vcenter_host_response", cluster_context).html('

' + - Locale.tr("Host created successfully") + ' ID:' + response.HOST.ID + - '

'); - - var template_raw = - "VCENTER_USER=\"" + $("#vcenter_user", context).val() + "\"\n" + - "VCENTER_PASSWORD=\"" + $("#vcenter_password", context).val() + "\"\n" + - "VCENTER_HOST=\"" + $("#vcenter_host", context).val() + "\"\n"; - - Sunstone.runAction("Host.update_template", response.HOST.ID, template_raw); - addHostElement(request, response); - }, - error: function (request, error_json) { - $(".vcenter_host_result", context).html('' + - '' + - '' + - ''); - - $(".vcenter_host_response", context).html('

' + - (error_json.error.message || Locale.tr("Cannot contact server: is it running and reachable?")) + - '

'); - } - }); - }) - - $.each($(".template_name:checked", context), function() { - var template_context = $(this).closest(".vcenter_template"); - - $(".vcenter_template_result:not(.success)", template_context).html( + OpenNebulaHost.create({ + timeout: true, + data: host_json, + success: function(request, response) { + $(".vcenter_host_result", cluster_context).addClass("success").html( '' + '' + - '' + + '' + ''); - var template_json = { - "vmtemplate": { - "template_raw": $(this).data("one_template") - } - }; + $(".vcenter_host_response", cluster_context).html('

' + + Locale.tr("Host created successfully") + ' ID:' + response.HOST.ID + + '

'); - OpenNebula.Template.create({ - timeout: true, - data: template_json, - success: function(request, response) { - OpenNebula.Helper.clear_cache("VMTEMPLATE"); - $(".vcenter_template_result", template_context).addClass("success").html( - '' + - '' + - '' + - ''); + var template_raw = + "VCENTER_USER=\"" + $("#vcenter_user", context).val() + "\"\n" + + "VCENTER_PASSWORD=\"" + $("#vcenter_password", context).val() + "\"\n" + + "VCENTER_HOST=\"" + $("#vcenter_host", context).val() + "\"\n"; - $(".vcenter_template_response", template_context).html('

' + - Locale.tr("Template created successfully") + ' ID:' + response.VMTEMPLATE.ID + - '

'); - }, - error: function (request, error_json) { - $(".vcenter_template_result", template_context).html('' + - '' + - '' + - ''); - - $(".vcenter_template_response", template_context).html('

' + - (error_json.error.message || Locale.tr("Cannot contact server: is it running and reachable?")) + - '

'); - } - }); - }) - - $.each($(".vm_name:checked", context), function() { - var vm_context = $(this).closest(".vcenter_vm"); - - $(".vcenter_vm_result:not(.success)", vm_context).html( - '' + + Sunstone.runAction("Host.update_template", response.HOST.ID, template_raw); + Sunstone.getDataTable(TAB_ID).addElement(request, response); + }, + error: function (request, error_json) { + $(".vcenter_host_result", context).html('' + '' + - '' + + '' + ''); - var vm_json = { - "vm": { - "vm_raw": $(this).data("one_vm") - } - }; - - var host_id_to_deploy = $(this).data("vm_to_host"); - - OpenNebula.VM.create({ - timeout: true, - data: vm_json, - success: function(request, response) { - OpenNebula.Helper.clear_cache("VM"); - - var extra_info = {}; - - extra_info['host_id'] = host_id_to_deploy; - extra_info['ds_id'] = -1; - extra_info['enforce'] = false; - - Sunstone.runAction("VM.deploy_action", response.VM.ID, extra_info); - - $(".vcenter_vm_result", vm_context).addClass("success").html( - '' + - '' + - '' + - ''); - - $(".vcenter_vm_response", vm_context).html('

' + - Locale.tr("VM imported successfully") + ' ID:' + response.VM.ID + - '

'); - }, - error: function (request, error_json) { - $(".vcenter_vm_response", vm_context).html('' + - '' + - '' + - ''); - - $(".vcenter_vm_response", vm_context).html('

' + - (error_json.error.message || Locale.tr("Cannot contact server: is it running and reachable?")) + - '

'); - } - }); - }) - - $.each($(".network_name:checked", context), function() { - var network_context = $(this).closest(".vcenter_network"); - - $(".vcenter_network_result:not(.success)", network_context).html( - '' + - '' + - '' + - ''); - - var network_size = $(".netsize", network_context).val(); - var network_tmpl = $(this).data("one_network"); - var netname = $(this).data("network_name"); - var type = $('.type_select', network_context).val(); - - var ar_array = []; - ar_array.push("TYPE=" + type); - ar_array.push("SIZE=" + network_size); - - switch (type) { - case 'ETHER': - var mac = $('.eth_mac_net', network_context).val(); - - if (mac) { - ar_array.push("MAC=" + mac); - } - - break; - case 'IP4': - var mac = $('.four_mac_net', network_context).val(); - var ip = $('.four_ip_net', network_context).val(); - - if (mac) { - ar_array.push("MAC=" + mac); - } - if (ip) { - ar_array.push("IP=" + ip); - } - - break; - case 'IP6': - var mac = $('.six_mac_net', network_context).val(); - var gp = $('.six_global_net', network_context).val(); - var ula = $('.six_mac_net', network_context).val(); - - if (mac) { - ar_array.push("MAC=" + mac); - } - if (gp) { - ar_array.push("GLOBAL_PREFIX=" + gp); - } - if (ula) { - ar_array.push("ULA_PREFIX=" + ula); - } - - break; - } - - network_tmpl += "\nAR=[" - network_tmpl += ar_array.join(",\n") - network_tmpl += "]" - - if ($(".vlaninfo", network_context)) { - network_tmpl += "VLAN=\"YES\"\n"; - network_tmpl += "VLAN_ID=" + $(".vlaninfo", network_context).val() + "\n"; - } - - var vnet_json = { - "vnet": { - "vnet_raw": network_tmpl - } - }; - - OpenNebula.Network.create({ - timeout: true, - data: vnet_json, - success: function(request, response) { - OpenNebula.Helper.clear_cache("VNET"); - $(".vcenter_network_result", network_context).addClass("success").html( - '' + - '' + - '' + - ''); - - $(".vcenter_network_response", network_context).html('

' + - Locale.tr("Virtual Network created successfully") + ' ID:' + response.VNET.ID + - '

'); - }, - error: function (request, error_json) { - $(".vcenter_network_result", network_context).html('' + - '' + - '' + - ''); - - $(".vcenter_network_response", network_context).html('

' + - (error_json.error.message || Locale.tr("Cannot contact server: is it running and reachable?")) + - '

'); - } - }); - }); - - return false + $(".vcenter_host_response", context).html('

' + + (error_json.error.message || Locale.tr("Cannot contact server: is it running and reachable?")) + + '

'); + } }); - */ - + }); + + $.each($(".template_name:checked", context), function() { + var template_context = $(this).closest(".vcenter_template"); + + $(".vcenter_template_result:not(.success)", template_context).html( + '' + + '' + + '' + + ''); + + var template_json = { + "vmtemplate": { + "template_raw": $(this).data("one_template") + } + }; + + OpenNebulaTemplate.create({ + timeout: true, + data: template_json, + success: function(request, response) { + $(".vcenter_template_result", template_context).addClass("success").html( + '' + + '' + + '' + + ''); + + $(".vcenter_template_response", template_context).html('

' + + Locale.tr("Template created successfully") + ' ID:' + response.VMTEMPLATE.ID + + '

'); + }, + error: function (request, error_json) { + $(".vcenter_template_result", template_context).html('' + + '' + + '' + + ''); + + $(".vcenter_template_response", template_context).html('

' + + (error_json.error.message || Locale.tr("Cannot contact server: is it running and reachable?")) + + '

'); + } + }); + }); + + $.each($(".vm_name:checked", context), function() { + var vm_context = $(this).closest(".vcenter_vm"); + + $(".vcenter_vm_result:not(.success)", vm_context).html( + '' + + '' + + '' + + ''); + + var vm_json = { + "vm": { + "vm_raw": $(this).data("one_vm") + } + }; + + var host_id_to_deploy = $(this).data("vm_to_host"); + + OpenNebulaVM.create({ + timeout: true, + data: vm_json, + success: function(request, response) { + var extra_info = {}; + + extra_info['host_id'] = host_id_to_deploy; + extra_info['ds_id'] = -1; + extra_info['enforce'] = false; + + Sunstone.runAction("VM.deploy_action", response.VM.ID, extra_info); + + $(".vcenter_vm_result", vm_context).addClass("success").html( + '' + + '' + + '' + + ''); + + $(".vcenter_vm_response", vm_context).html('

' + + Locale.tr("VM imported successfully") + ' ID:' + response.VM.ID + + '

'); + }, + error: function (request, error_json) { + $(".vcenter_vm_response", vm_context).html('' + + '' + + '' + + ''); + + $(".vcenter_vm_response", vm_context).html('

' + + (error_json.error.message || Locale.tr("Cannot contact server: is it running and reachable?")) + + '

'); + } + }); + }); + + $.each($(".network_name:checked", context), function() { + var network_context = $(this).closest(".vcenter_network"); + + $(".vcenter_network_result:not(.success)", network_context).html( + '' + + '' + + '' + + ''); + + var network_size = $(".netsize", network_context).val(); + var network_tmpl = $(this).data("one_network"); + var netname = $(this).data("network_name"); + var type = $('.type_select', network_context).val(); + + var ar_array = []; + ar_array.push("TYPE=" + type); + ar_array.push("SIZE=" + network_size); + + switch (type) { + case 'ETHER': + var mac = $('.eth_mac_net', network_context).val(); + + if (mac) { + ar_array.push("MAC=" + mac); + } + + break; + case 'IP4': + var mac = $('.four_mac_net', network_context).val(); + var ip = $('.four_ip_net', network_context).val(); + + if (mac) { + ar_array.push("MAC=" + mac); + } + if (ip) { + ar_array.push("IP=" + ip); + } + + break; + case 'IP6': + var mac = $('.six_mac_net', network_context).val(); + var gp = $('.six_global_net', network_context).val(); + var ula = $('.six_mac_net', network_context).val(); + + if (mac) { + ar_array.push("MAC=" + mac); + } + if (gp) { + ar_array.push("GLOBAL_PREFIX=" + gp); + } + if (ula) { + ar_array.push("ULA_PREFIX=" + ula); + } + + break; + } + + network_tmpl += "\nAR=[" + network_tmpl += ar_array.join(",\n") + network_tmpl += "]" + + if ($(".vlaninfo", network_context)) { + network_tmpl += "VLAN=\"YES\"\n"; + network_tmpl += "VLAN_ID=" + $(".vlaninfo", network_context).val() + "\n"; + } + + var vnet_json = { + "vnet": { + "vnet_raw": network_tmpl + } + }; + + OpenNebulaNetwork.create({ + timeout: true, + data: vnet_json, + success: function(request, response) { + $(".vcenter_network_result", network_context).addClass("success").html( + '' + + '' + + '' + + ''); + + $(".vcenter_network_response", network_context).html('

' + + Locale.tr("Virtual Network created successfully") + ' ID:' + response.VNET.ID + + '

'); + }, + error: function (request, error_json) { + $(".vcenter_network_result", network_context).html('' + + '' + + '' + + ''); + + $(".vcenter_network_response", network_context).html('

' + + (error_json.error.message || Locale.tr("Cannot contact server: is it running and reachable?")) + + '

'); + } + }); + }); + + return false; + }); + // Show custom driver input only when custom is selected in selects $('input[name="custom_vmm_mad"],' + 'input[name="custom_im_mad"],' + @@ -542,4 +532,268 @@ define(function(require) { ResourceSelect.insert('#host_cluster_id', context, "Cluster", cluster_id, false); return false; } + + /* + Retrieve the list of templates from vCenter and fill the container with them + + opts = { + datacenter: "Datacenter Name", + cluster: "Cluster Name", + container: Jquery div to inject the html, + vcenter_user: vCenter Username, + vcenter_password: vCenter Password, + vcenter_host: vCenter Host + } + */ + function fillVCenterTemplates(opts) { + var path = '/vcenter/templates'; + + opts.container.show(); + + $(".accordion_advanced_toggle", opts.container).trigger("click"); + + $.ajax({ + url: path, + type: "GET", + data: {timeout: false}, + dataType: "json", + headers: { + "X_VCENTER_USER": opts.vcenter_user, + "X_VCENTER_PASSWORD": opts.vcenter_password, + "X_VCENTER_HOST": opts.vcenter_host + }, + success: function(response){ + $(".content", opts.container).html(""); + + $('
' + + '
' + + '

' + Locale.tr("Please select the vCenter Templates to be imported to OpenNebula.") + '

' + + '
' + + '
').appendTo($(".content", opts.container)) + + $.each(response, function(datacenter_name, templates){ + $('
' + + '
' + + '
' + + datacenter_name + ' ' + Locale.tr("DataCenter") + + '
' + + '
' + + '
').appendTo($(".content", opts.container)) + + if (templates.length == 0) { + $('
' + + '
' + + '' + + '
' + + '
').appendTo($(".content", opts.container)) + } else { + $.each(templates, function(id, template){ + var trow = $('
' + + '
' + + '
' + + '' + + '
'+ + '
'+ + '
' + + '
'+ + '
'+ + '
'+ + '
').appendTo($(".content", opts.container)) + + $(".template_name", trow).data("template_name", template.name) + $(".template_name", trow).data("one_template", template.one) + }); + }; + }); + }, + error: function(response){ + opts.container.hide(); + Notifier.onError({}, OpenNebulaError(response)); + } + }); + + return false; + } + + /* + Retrieve the list of networks from vCenter and fill the container with them + + opts = { + datacenter: "Datacenter Name", + cluster: "Cluster Name", + container: Jquery div to inject the html, + vcenter_user: vCenter Username, + vcenter_password: vCenter Password, + vcenter_host: vCenter Host + } + */ + function fillVCenterNetworks(opts) { + var path = '/vcenter/networks'; + + opts.container.show(); + + $(".accordion_advanced_toggle", opts.container).trigger("click"); + + $.ajax({ + url: path, + type: "GET", + data: {timeout: false}, + dataType: "json", + headers: { + "X_VCENTER_USER": opts.vcenter_user, + "X_VCENTER_PASSWORD": opts.vcenter_password, + "X_VCENTER_HOST": opts.vcenter_host + }, + success: function(response){ + $(".content", opts.container).html(""); + + $('
' + + '
' + + '

' + Locale.tr("Please select the vCenter Networks to be imported to OpenNebula.") + '

' + + '
' + + '
').appendTo($(".content", opts.container)) + + $.each(response, function(datacenter_name, networks){ + $('
' + + '
' + + '
' + + datacenter_name + ' ' + Locale.tr("DataCenter") + + '
' + + '
' + + '
').appendTo($(".content", opts.container)) + + if (networks.length == 0) { + $('
' + + '
' + + '' + + '
' + + '
').appendTo($(".content", opts.container)) + } else { + $.each(networks, function(id, network){ + var netname = network.name.replace(" ","_"); + var vlan_info = "" + + if (network.vlan) { + var vlan_info = '
' + + '
'+ + ''+ + '
'+ + '
'; + } + + var trow = $('
' + + '
' + + '
' + + '
' + + '' + + '
'+ + '
'+ + '' + + '
'+ + '
'+ + '' + + '
'+ + '
' + + '
'+ + ''+ + '
'+ + '
'+ + vlan_info + + '
'+ + '
'+ + '
' + + '
'+ + '
'+ + '
'+ + '
').appendTo($(".content", opts.container)) + + + $('.type_select', trow).on("change",function(){ + var network_context = $(this).closest(".vcenter_network"); + var type = $(this).val(); + + var net_form_str = '' + + switch(type) { + case 'ETHER': + net_form_str = + '
'+ + ''+ + '
'; + break; + case 'IP4': + net_form_str = + '
'+ + ''+ + '
'+ + '
'+ + ''+ + '
'; + break; + case 'IP6': + net_form_str = + '
'+ + ''+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + ''+ + '
'; + break; + } + + $('.net_options', network_context).html(net_form_str); + }); + + $(".network_name", trow).data("network_name", netname) + $(".network_name", trow).data("one_network", network.one) + }); + }; + }); + }, + error: function(response){ + opts.container.hide(); + Notifier.onError({}, OpenNebulaError(response)); + } + }); + + return false; + } + }); diff --git a/src/sunstone/public/app/tabs/hosts-tab/form-panels/create/wizard.hbs b/src/sunstone/public/app/tabs/hosts-tab/form-panels/create/wizard.hbs index f4333cb4fa..d64c05990b 100644 --- a/src/sunstone/public/app/tabs/hosts-tab/form-panels/create/wizard.hbs +++ b/src/sunstone/public/app/tabs/hosts-tab/form-panels/create/wizard.hbs @@ -120,14 +120,35 @@ {{tr "Get vCenter Clusters"}} -
+
-
+


-
+