diff --git a/src/cloud/ec2/lib/econe-server.rb b/src/cloud/ec2/lib/econe-server.rb index 541508efc9..2cb40f6b1a 100644 --- a/src/cloud/ec2/lib/econe-server.rb +++ b/src/cloud/ec2/lib/econe-server.rb @@ -90,7 +90,7 @@ if CloudServer.is_port_open?(settings.config[:host], settings.config[:port]) settings.logger.error { "Port #{settings.config[:port]} busy, please shutdown " << - "the service or move occi server port." + "the service or move econe server port." } exit -1 end diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index 71be858436..9b00c04cb0 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -679,7 +679,7 @@ function setupCreateTemplateDialog(){ '
'+tr("Name that the VM will get for description purposes. If NAME is not supplied a name generated by one will be in the form of one-<VID>.")+'
'+ ''+ ''+ - '
'+ + '
'+ '
'+ '
'+ '
'+ @@ -878,10 +878,16 @@ function setupCreateTemplateDialog(){ '
'+ ' Volatile Disk '+ '
'+ - '
'+ + '
'+ + '
'+ '
'+ - '
'+ - ''+tr("Please select an image from the list")+''+ + '
'+ + ''+tr("Please select an image from the list")+''+ + ''+ + ''+ + ''+ + '
'+ ''+ ''+ ''+ @@ -903,13 +909,7 @@ function setupCreateTemplateDialog(){ ''+ ''+ '
'+ - '
'+ - '

You selected the following image: '+ - ''+ - '

'+ - ''+ - '
'+ - '
'+ + '
'+ '
'+ '

'+tr("Advanced options")+'

'+ '
'+ @@ -1094,7 +1094,7 @@ function setupCreateTemplateDialog(){ "bSortClasses": false, "bAutoWidth":false, "iDisplayLength": 4, - "sDom" : '<"H"frC>t<"F"ip>', + "sDom" : '<"H"fr>t<"F"ip>', "oColVis": { "aiExclude": [ 0 ] }, @@ -1147,8 +1147,14 @@ function setupCreateTemplateDialog(){ var aData = dataTable_template_images.fnGetData(this); - if (previous_row) + if (previous_row) { $("td:first", previous_row).parent().children().each(function(){$(this).removeClass('markrow');}); + } + else { + $('#image_selected', disk_section).toggle(); + $('#select_image', disk_section).hide(); + } + previous_row = this; $("td:first", this).parent().children().each(function(){$(this).addClass('markrow');}); @@ -1849,13 +1855,16 @@ function setupCreateTemplateDialog(){ '
'+ '
'+ ''+tr("Graphics")+''+ - '
'+ - ' VNC '+ - ' SDL'+ - ' SPICE'+ + '
'+ + '
'+ + ' VNC '+ + ' SDL'+ + ' SPICE'+ + '
'+ '
'+ - '
'+ + '
'+ '
'+ + ''+ '
'+ ''+ '
'+ @@ -1906,39 +1915,25 @@ function setupCreateTemplateDialog(){ ''+tr("Inputs")+''+ '
'+ '
'+ - ''+ - '
'+ - '
'+ ''+ '
'+ - '
'+ - '
'+ - '
'+ - '
'+ - '
'+ '
'+ - ''+ - '
'+ - '
'+ ''+ '
'+ - '
'+ - '
'+ + '
'+ + ''+ '
'+ '
'+ + '
'+ '
'+ - ''+ - '
'+ - '
'+ - '
'+ - ''+ + '
'+ ''+ ''+ ''+ @@ -1947,6 +1942,10 @@ function setupCreateTemplateDialog(){ ''+ ''+ ''+ + ''+ + ''+ + ''+ + ''+ ''+ '
'+tr("TYPE")+'
'+ '
'+ @@ -1961,6 +1960,8 @@ function setupCreateTemplateDialog(){ tabs.append(html_tab_content).tabs('add', '#io_tab', 'Input/Output'); $("input[name='graphics_type']").change(function(){ + console.log(this) + $("#TYPE", $('div#io_tab .graphics')).val($(this).attr("value")) $("#LISTEN", $('div#io_tab')).val("0.0.0.0") }); @@ -1968,7 +1969,7 @@ function setupCreateTemplateDialog(){ var table = $('#input_table', $('div#io_tab'))[0]; console.log(table) var rowCount = table.rows.length; - var row = table.insertRow(rowCount); + var row = table.insertRow(-1); $(row).addClass("vm_param"); var cell1 = row.insertCell(0); @@ -1994,6 +1995,7 @@ function setupCreateTemplateDialog(){ $(this).closest("tr").remove() }); + setupTips($('div#io_tab')); } @@ -2034,49 +2036,73 @@ function setupCreateTemplateDialog(){ '
'+ '
'+ '
'+ - ''+tr("Custom CONTEXT")+''+ + ''+tr("Context Files")+''+ '
'+ - '
'+ - ''+ - '
'+ - '
'+ - ''+ - '
'+ - '
'+ - '
'+ - '
'+ - '
'+ - '
'+ - '
'+ - ''+ - '
'+ - '
'+ - ''+ - '
'+ - '
'+ - '
'+ - '
'+ - '
'+ - '
'+ - ''+ - '
'+ - '
'+ - '
'+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - ''+ - '
'+tr("KEY")+''+tr("VALUE")+'
'+ - '
'+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + '
'+tr("ID")+''+tr("Owner")+''+tr("Group")+''+tr("Name")+''+tr("Datastore")+''+tr("Size")+''+tr("Type")+''+tr("Registration time")+''+tr("Persistent")+''+tr("Status")+''+tr("#VMS")+''+tr("Target")+'
'+ + '
'+ + '

You selected the following FILES: '+ + ''+ + '

'+ + ''+ + '
'+ '
'+ '
'+ - '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + ''+tr("Custom CONTEXT")+''+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '
'+ + '
'+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + '
'+tr("KEY")+''+tr("VALUE")+'
'+ + '
'+ + '
'+ + '
'+ '
'+ ''+ '
' @@ -2113,6 +2139,72 @@ function setupCreateTemplateDialog(){ $( "#context_tab span.ui-icon-close" ).live( "click", function() { $(this).closest("tr").remove() }); + + + var datTable_template_context = $('#datatable_context', dialog).dataTable({ + "bJQueryUI": true, + "bSortClasses": false, + "bAutoWidth":false, + "iDisplayLength": 4, + "sDom" : '<"H"fr>t<"F"p>', + "oColVis": { + "aiExclude": [ 0 ] + }, + "sPaginationType": "full_numbers", + "aoColumnDefs": [ + { "bSortable": false, "aTargets": ["check"] }, + { "sWidth": "60px", "aTargets": [0,2,3,9,10] }, + { "sWidth": "35px", "aTargets": [1,6,11,12] }, + { "sWidth": "100px", "aTargets": [5,7] }, + { "sWidth": "150px", "aTargets": [8] }, + { "bVisible": false, "aTargets": [0,2,3,5,6,7,9,8,10,11,12]} + ], + "oLanguage": (datatable_lang != "") ? + { + sUrl: "locale/"+lang+"/"+datatable_lang + } : "" + }); + + datTable_template_context.fnClearTable(); + addElement([spinner,'','','','','','','','','','','',''],datTable_template_context); + + // Retrieve the images to fill the datatable + OpenNebula.Image.list({ + timeout: true, + success: function (request, images_list){ + var image_list_array = []; + $.each(images_list,function(){ + image_list_array.push(imageElementArray(this)); + }); + updateView(image_list_array, datTable_template_context); + datTable_template_context.fnFilter("CONTEXT", 6) + }, + error: onError + }); + + // TBD More than one file + + // TBD Add refresh button for the datatable + // When a row is selected the background color is updated. If a previous row + // was selected (previous_row) the background color is removed. + // #IMAGE and #IMAGE_ID inputs are updated using the row information + if (typeof previous_context_row === 'undefined') { + var previous_context_row = 0; + } + + $('#datatable_context tbody', dialog).delegate("tr", "click", function(e){ + if ($(e.target).is('input') || + $(e.target).is('select') || + $(e.target).is('option')) return true; + var aData = datTable_template_context.fnGetData(this); + if (previous_context_row) + $("td:first", previous_context_row).parent().children().each(function(){$(this).removeClass('markrow');}); + previous_context_row = this; + $("td:first", this).parent().children().each(function(){$(this).addClass('markrow');}); + $('#FILES', $('div#context_tab')).text(aData[4]); + $('#FILES_DS', $('div#context_tab')).val("$FILE[IMAGE_ID="+ aData[1] +"]"); + return false; + }); } @@ -2134,7 +2226,8 @@ function setupCreateTemplateDialog(){ '
'+ ' Select Clusters '+ '
'+ - '
'+ + '
'+ + '
'+ '
'+ ''+ ''+ @@ -2568,7 +2661,10 @@ function setupCreateTemplateDialog(){ hash["ICMP"] = "drop" } - vm_json["NIC"].push(hash); + console.log(hash) + if (!$.isEmptyObject(hash)) { + vm_json["NIC"].push(hash); + } }); // @@ -2614,18 +2710,20 @@ function setupCreateTemplateDialog(){ }; if ($("#network_context", $('div#context_tab')).is(":checked")) { - var nic_id = 1; + var nic_id = 0; + console.log("nic") + console.log(vm_json["NIC"]) $.each(vm_json["NIC"], function(){ var vnet_id = this["NETWORK_ID"] var eth_str = "ETH"+nic_id+"_" var net_str = 'NETWORK_ID=\\"'+ vnet_id +'\\"' vm_json["CONTEXT"][eth_str+"IP"] = "$NIC[IP,"+ net_str +"]"; - vm_json["CONTEXT"][eth_str+"NETWORK"] = "$NIC[NETWORK,"+ net_str +"]"; - vm_json["CONTEXT"][eth_str+"MASK"] = "$NIC[MASK,"+ net_str +"]"; - vm_json["CONTEXT"][eth_str+"GATEWAY"] = "$NIC[GATEWAY,"+ net_str +"]"; - vm_json["CONTEXT"][eth_str+"DNS"] = "$NIC[DNS,"+ net_str +"]"; + vm_json["CONTEXT"][eth_str+"NETWORK"] = "$NETWORK[NETWORK_ADDRESS,"+ net_str +"]"; + vm_json["CONTEXT"][eth_str+"MASK"] = "$NETWORK[NETWORK_MASK,"+ net_str +"]"; + vm_json["CONTEXT"][eth_str+"GATEWAY"] = "$NETWORK[GATEWAY,"+ net_str +"]"; + vm_json["CONTEXT"][eth_str+"DNS"] = "$NETWORK[DNS,"+ net_str +"]"; nic_id++; }); @@ -3045,9 +3143,22 @@ function fillTemplatePopUp(request, response){ autoFillInputs(os, os_section); } - + // + // INPUT/OUTPUT + // + var graphics = template.GRAPHICS; + var graphics_section = $('div#io_tab .graphics', $create_template_dialog); + + if (graphics) { + var type = graphics.TYPE; + if (graphics.TYPE) { + $("input[value='"+ type + "']").click(); + + autoFillInputs(graphics, graphics_section); + } + } popUpCreateTemplateDialog(); } diff --git a/src/sunstone/views/index.erb b/src/sunstone/views/index.erb index fe6a4512d2..e984a64d1f 100644 --- a/src/sunstone/views/index.erb +++ b/src/sunstone/views/index.erb @@ -76,7 +76,7 @@ *, *:before, *:after { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } -html { font-size: 62.5%; } +html { font-size: 62.5%; } body { background: white; font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif; font-weight: normal; font-style: normal; font-size: 14px; line-height: 1; color: #222222; position: relative; -webkit-font-smoothing: antialiased; } @@ -267,6 +267,35 @@ img { -ms-interpolation-mode: bicubic; } .ui-slider-range { background: #4d4d4d; } +/* Tables ---------------------- */ +.table { background: #fff; -webkit-border-radius: 3px; -moz-border-radius: 3px; -ms-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; margin: 0 0 18px; border: 1px solid #ddd; } + +.table thead, .table tfoot { background: #f5f5f5; } + +.table thead tr th, .table tfoot tr th, .table tbody tr td, .table tr td, .table tfoot tr td { display: table-cell; font-size: 12; line-height: 10px; text-align: left; } + +.table thead tr th, .table tfoot tr td { padding: 8px 10px 9px; font-size: 12px; font-weight: bold; color: #222; } + +.table thead tr th:first-child, .table tfoot tr td:first-child { border-left: none; } + +.table thead tr th:last-child, .table tfoot tr td:last-child { border-right: none; } + +.table tbody tr.even, .table tbody tr.alt { background: #f9f9f9; } + +.table tbody tr:nth-child(even) { background: #f9f9f9; } + +.table tbody tr td { color: #333; padding: 9px 10px; vertical-align: top; border: none; } + +hr{margin:18px 0;border:0;border-top:1px solid #eee;border-bottom:1px solid #fff} + +/* Labels ---------------------- */ +.label { padding: 1px 4px 2px; font-size: 12px; font-weight: bold; text-align: center; text-decoration: none; line-height: 1; white-space: nowrap; display: inline; position: relative; bottom: 1px; color: #fff; background: #2ba6cb; } +.label.radius { -webkit-border-radius: 3px; -moz-border-radius: 3px; -ms-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; } +.label.round { padding: 1px 7px 2px; -webkit-border-radius: 1000px; -moz-border-radius: 1000px; -ms-border-radius: 1000px; -o-border-radius: 1000px; border-radius: 1000px; } +.label.alert { background-color: #c60f13; } +.label.success { background-color: #5da423; } +.label.secondary { background-color: #e9e9e9; color: #505050; } + .markrow { background-color:#ffbba9 !important; }