From 9435524219974b230a1076555e12075e865141cf Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Wed, 4 Jan 2012 13:32:00 +0100 Subject: [PATCH 01/12] Feature #992: Allow customization of login, top-left logos. Update translations. (cherry picked from commit 588d4a5a5e1f8c5d2682c34ed38a840c3c0a8cd3) --- src/cloud/occi/lib/ui/public/css/login.css | 2 +- src/cloud/occi/lib/ui/public/customize/custom.js | 4 ++-- src/cloud/occi/lib/ui/public/js/login.js | 4 +++- src/cloud/occi/lib/ui/public/js/plugins/configuration.js | 2 ++ src/cloud/occi/lib/ui/public/locale/en_US/en_US.js | 3 +-- src/cloud/occi/lib/ui/public/locale/es_ES/es_ES.js | 5 ++--- src/cloud/occi/lib/ui/templates/login.html | 4 +++- 7 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/cloud/occi/lib/ui/public/css/login.css b/src/cloud/occi/lib/ui/public/css/login.css index e086897b3f..c57dfe230e 100644 --- a/src/cloud/occi/lib/ui/public/css/login.css +++ b/src/cloud/occi/lib/ui/public/css/login.css @@ -45,7 +45,7 @@ body { } -div#logo_sunstone { +div#logo_selfservice { position: relative; height: 100px; width: 600px; diff --git a/src/cloud/occi/lib/ui/public/customize/custom.js b/src/cloud/occi/lib/ui/public/customize/custom.js index e26e24fecc..18d40c72fa 100644 --- a/src/cloud/occi/lib/ui/public/customize/custom.js +++ b/src/cloud/occi/lib/ui/public/customize/custom.js @@ -23,9 +23,9 @@ var $network_count = ''; -//Login logo 591x43px - not implemented +//Login logo 591x43px var logo_big = "images/opennebula-selfservice-big.png"; -//Top left logo 179x14px - not implemented +//Top left logo 179x14px var logo_small = "images/opennebula-selfservice-small.png"; diff --git a/src/cloud/occi/lib/ui/public/js/login.js b/src/cloud/occi/lib/ui/public/js/login.js index 13eff1f619..36b1e5b057 100644 --- a/src/cloud/occi/lib/ui/public/js/login.js +++ b/src/cloud/occi/lib/ui/public/js/login.js @@ -55,6 +55,8 @@ function authenticate(){ } $(document).ready(function(){ + $('div#logo_selfservice').css("background","url("+logo_big+") no-repeat center"); + $("#login_form").submit(function (){ authenticate(); return false; @@ -62,7 +64,7 @@ $(document).ready(function(){ //compact login elements according to screen height if (screen.height <= 600){ - $('div#logo_sunstone').css("top","15px"); + $('div#logo_selfservice').css("top","15px"); $('div#login').css("top","10px"); $('.error_message').css("top","10px"); }; diff --git a/src/cloud/occi/lib/ui/public/js/plugins/configuration.js b/src/cloud/occi/lib/ui/public/js/plugins/configuration.js index 97c5803b1c..d3ea0b1cc8 100644 --- a/src/cloud/occi/lib/ui/public/js/plugins/configuration.js +++ b/src/cloud/occi/lib/ui/public/js/plugins/configuration.js @@ -59,4 +59,6 @@ $(document).ready(function(){ hideDialog(); }); + $('div#logo img').attr('src',logo_small); + }); \ No newline at end of file diff --git a/src/cloud/occi/lib/ui/public/locale/en_US/en_US.js b/src/cloud/occi/lib/ui/public/locale/en_US/en_US.js index 1d13154a89..1ff5bf84e4 100644 --- a/src/cloud/occi/lib/ui/public/locale/en_US/en_US.js +++ b/src/cloud/occi/lib/ui/public/locale/en_US/en_US.js @@ -98,6 +98,7 @@ locale={ "See more":"", "Select a template":"", "Select disk":"", + "Select image to upload":"", "Self-Service UI Configuration":"", "Shutdown":"", "Sign out":"", @@ -132,8 +133,6 @@ locale={ "Unpublish":"", "Update":"", "Update template":"", - "Upload image":"", - "Upload progress":"", "Useful links":"", "Virtual Machine information":"", "virtual machines":"", diff --git a/src/cloud/occi/lib/ui/public/locale/es_ES/es_ES.js b/src/cloud/occi/lib/ui/public/locale/es_ES/es_ES.js index 96d30e7769..8a10534706 100644 --- a/src/cloud/occi/lib/ui/public/locale/es_ES/es_ES.js +++ b/src/cloud/occi/lib/ui/public/locale/es_ES/es_ES.js @@ -1,4 +1,4 @@ -//Translated by +//Translated by Hector Sanjuan lang="es_ES" datatable_lang="es_datatable.txt" locale={ @@ -98,6 +98,7 @@ locale={ "See more":"Ver más", "Select a template":"Seleccione una plantilla", "Select disk":"Seleccione un disco", + "Select image to upload":"Seleccione una imagen para subir", "Self-Service UI Configuration":"Configuración de la interfaz Self-Service", "Shutdown":"Apagar", "Sign out":"Desconectar", @@ -132,8 +133,6 @@ locale={ "Unpublish":"Despublicar", "Update":"Actualizar", "Update template":"Actualizar plantilla", - "Upload image":"Subir imagen", - "Upload progress":"Progreso se subida", "Useful links":"Enlances útiles", "Virtual Machine information":"Información de máquina virtual", "virtual machines":"máquinas virtuales", diff --git a/src/cloud/occi/lib/ui/templates/login.html b/src/cloud/occi/lib/ui/templates/login.html index a0bf676c1a..82b80c0785 100644 --- a/src/cloud/occi/lib/ui/templates/login.html +++ b/src/cloud/occi/lib/ui/templates/login.html @@ -9,7 +9,9 @@ + + @@ -23,7 +25,7 @@
-
+
From 7becd47d60e8aef703c6615e372134e5e694e071 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Wed, 4 Jan 2012 13:10:44 +0100 Subject: [PATCH 02/12] Feature #992: File input style fixes (cherry picked from commit 73ab3a7889c950a4be8b8ccc64020cca733f1eb2) --- src/cloud/occi/lib/ui/public/js/plugins/storage.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cloud/occi/lib/ui/public/js/plugins/storage.js b/src/cloud/occi/lib/ui/public/js/plugins/storage.js index 131c824f24..502d320fd9 100644 --- a/src/cloud/occi/lib/ui/public/js/plugins/storage.js +++ b/src/cloud/occi/lib/ui/public/js/plugins/storage.js @@ -73,11 +73,10 @@ var create_image_tmpl =
'+tr("Type of file system to be built. This can be any value understood by mkfs unix command.")+'
\
\
\ - \ -
\ +
\ +
\
\ - \ -
\ +
\
\ \
\
\ '; @@ -666,19 +666,21 @@ function popUpCreateVMDialog(){ icons: { primary: "ui-icon-check" }, - text: false + text: true }); +/* $('#reset_vm',dialog).button({ icons: { primary: "ui-icon-scissors" }, - text: false + text: true }); +*/ $('.vm_close_dialog_link',dialog).button({ icons: { primary: "ui-icon-closethick" }, - text: false + text: true }); var net_select = makeSelectOptions(dataTable_vNetworks, @@ -706,7 +708,7 @@ function popUpCreateVMDialog(){ }); $('#network_box option,#disk_box option',dialog).click(function(){ - var clicked = $(this).attr("clicked"); + var clicked = $(this).attr('clicked'); if (clicked){//unbold, unmark $(this).text($(this).text().replace(/\*/g,'')); $(this).removeAttr('clicked'); diff --git a/src/cloud/occi/lib/ui/public/js/plugins/network.js b/src/cloud/occi/lib/ui/public/js/plugins/network.js index 6668ec386d..d66d45d1f8 100644 --- a/src/cloud/occi/lib/ui/public/js/plugins/network.js +++ b/src/cloud/occi/lib/ui/public/js/plugins/network.js @@ -53,9 +53,9 @@ var create_vn_tmpl =
\ \
\ - \ + \ + \
\ \
\ @@ -342,19 +342,21 @@ function popUpCreateVnetDialog() { icons: { primary: "ui-icon-check" }, - text: false + text: true }); +/* $('#reset_vn',dialog).button({ icons: { primary: "ui-icon-scissors" }, text: false }); +*/ $('.vnet_close_dialog_link',dialog).button({ icons: { primary: "ui-icon-closethick" }, - text: false + text: true }); $('#create_vn_form_easy',dialog).submit(function(){ diff --git a/src/cloud/occi/lib/ui/public/js/plugins/storage.js b/src/cloud/occi/lib/ui/public/js/plugins/storage.js index 891414a42f..7a4b3be704 100644 --- a/src/cloud/occi/lib/ui/public/js/plugins/storage.js +++ b/src/cloud/occi/lib/ui/public/js/plugins/storage.js @@ -92,9 +92,9 @@ var create_image_tmpl =
\ -->\
\ - \ + \ + \
\ \
\ @@ -413,19 +413,21 @@ function popUpCreateImageDialog(){ icons: { primary: "ui-icon-check" }, - text: false + text: true }); +/* $('#reset_image',dialog).button({ icons: { primary: "ui-icon-scissors" }, text: false }); +*/ $('.image_close_dialog_link',dialog).button({ icons: { primary: "ui-icon-closethick" }, - text: false + text: true }); setupTips(dialog); diff --git a/src/cloud/occi/lib/ui/public/locale/en_US/en_US.js b/src/cloud/occi/lib/ui/public/locale/en_US/en_US.js index 1ff5bf84e4..d36fd78cb4 100644 --- a/src/cloud/occi/lib/ui/public/locale/en_US/en_US.js +++ b/src/cloud/occi/lib/ui/public/locale/en_US/en_US.js @@ -13,6 +13,7 @@ locale={ "Canvas not supported.":"", "CD-ROM":"", "Changing language":"", + "Close":"", "Community":"", "Compute":"", "Compute resource":"", @@ -21,6 +22,7 @@ locale={ "Configuration":"", "Confirmation of action":"", "CPU":"", + "Create":"", "Create network":"", "Create new compute resource":"", "Create new network resource":"", diff --git a/src/cloud/occi/lib/ui/public/locale/es_ES/es_ES.js b/src/cloud/occi/lib/ui/public/locale/es_ES/es_ES.js index 8a10534706..49d91652f2 100644 --- a/src/cloud/occi/lib/ui/public/locale/es_ES/es_ES.js +++ b/src/cloud/occi/lib/ui/public/locale/es_ES/es_ES.js @@ -13,6 +13,7 @@ locale={ "Canvas not supported.":"Canvas no soportado", "CD-ROM":"CD-ROM", "Changing language":"Cambiando el lenguaje", + "Close":"Cerrar", "Community":"Comunidad", "Compute":"Máquinas Virtuales", "Compute resource":"máquina virtual", @@ -21,6 +22,7 @@ locale={ "Configuration":"Configuración", "Confirmation of action":"Confirmar operación", "CPU":"CPU", + "Create":"Crear", "Create network":"Crear red", "Create new compute resource":"Crear nueva máquina virtual", "Create new network resource":"Crear nueva red", @@ -89,7 +91,7 @@ locale={ "Please select":"Por favor escoja", "Previous action":"Acción anterior", "Public":"Público", - "Public scope of the image":"", + "Public scope of the image":"Imagen pública", "Publish":"Publicar", "Refresh list":"Refrescar lista", "Resume":"Reanudar", diff --git a/src/cloud/occi/lib/ui/public/locale/generate_translation_template.rb b/src/cloud/occi/lib/ui/public/locale/generate_translation_template.rb index e6adde7429..b3719bd4fa 100755 --- a/src/cloud/occi/lib/ui/public/locale/generate_translation_template.rb +++ b/src/cloud/occi/lib/ui/public/locale/generate_translation_template.rb @@ -17,7 +17,7 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -tr_strings = `grep -h -o -R -e 'tr("[[:print:]]*")' ../js/* ../customize/* | cut -d'"' -f 2 | sort -u` +tr_strings = `grep -h -o -R -e 'tr("[[:print:]]*")' ../js/* ../customize/* ../../../../../../sunstone/public/js/sunstone.js ../../../../../../sunstone/public/js/sunstone-util.js | cut -d'"' -f 2 | sort -u` puts "//Translated by" puts 'lang="en_US"' From 773d5ed82a8f57eb5b7ddc959efe975d413fafc6 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Tue, 3 Jan 2012 18:12:31 +0100 Subject: [PATCH 09/12] Feature #992: Improve multiple select for compute creation. (cherry picked from commit cd87c6819ad05414d622d00474d7636434f9a495) --- src/cloud/occi/lib/ui/public/js/plugins/compute.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cloud/occi/lib/ui/public/js/plugins/compute.js b/src/cloud/occi/lib/ui/public/js/plugins/compute.js index 6d032fc947..09ee6c434e 100644 --- a/src/cloud/occi/lib/ui/public/js/plugins/compute.js +++ b/src/cloud/occi/lib/ui/public/js/plugins/compute.js @@ -710,11 +710,11 @@ function popUpCreateVMDialog(){ $('#network_box option,#disk_box option',dialog).click(function(){ var clicked = $(this).attr('clicked'); if (clicked){//unbold, unmark - $(this).text($(this).text().replace(/\*/g,'')); + $(this).text($(this).text().replace(/✓/g,'')); $(this).removeAttr('clicked'); } else {//bold,mark - $(this).text("*"+$(this).text()+"*"); + $(this).text("✓"+$(this).text()); $(this).attr('clicked','clicked'); } return false; From 47760e6401e43779c6560427f5a7e58c954a7bbc Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Thu, 5 Jan 2012 15:54:04 +0100 Subject: [PATCH 10/12] Generate a dynamic bridge for the vmware deployment file --- src/vmm/LibVirtDriverVMware.cc | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/src/vmm/LibVirtDriverVMware.cc b/src/vmm/LibVirtDriverVMware.cc index b4662e8d41..ad415ee4bf 100644 --- a/src/vmm/LibVirtDriverVMware.cc +++ b/src/vmm/LibVirtDriverVMware.cc @@ -52,6 +52,7 @@ int LibVirtDriver::deployment_description_vmware( const VectorAttribute * nic; + string network_id = ""; string mac = ""; string bridge = ""; string script = ""; @@ -163,7 +164,7 @@ int LibVirtDriver::deployment_description_vmware( // ------------------------------------------------------------------------ file << "\t" << endl; - + get_default("DISK","DRIVER",default_driver); num = vm->get_template_attribute("DISK",attrs); @@ -221,7 +222,7 @@ int LibVirtDriver::deployment_description_vmware( { file << "\t\t" << endl; file << "\t\t\tget_oid() - << "/images/disk." << i << ".iso'/>" << endl; + << "/images/disk." << i << ".iso'/>" << endl; } else { @@ -249,8 +250,8 @@ int LibVirtDriver::deployment_description_vmware( { if (!default_driver.empty()) { - file << "\t\t\t" << endl; + file << "\t\t\t" << endl; } } @@ -306,21 +307,17 @@ int LibVirtDriver::deployment_description_vmware( continue; } - bridge = nic->vector_value("BRIDGE"); - mac = nic->vector_value("MAC"); - target = nic->vector_value("TARGET"); - script = nic->vector_value("SCRIPT"); - model = nic->vector_value("MODEL"); + network_id = nic->vector_value("NETWORK_ID"); + mac = nic->vector_value("MAC"); + target = nic->vector_value("TARGET"); + script = nic->vector_value("SCRIPT"); + model = nic->vector_value("MODEL"); - if ( bridge.empty() ) - { - file << "\t\t" << endl; - } - else - { - file << "\t\t" << endl; - file << "\t\t\t" << endl; - } + bridge = "one-pg-"; + bridge.append(network_id); + + file << "\t\t" << endl; + file << "\t\t\t" << endl; if( !mac.empty() ) { From 61ad2c0c08a03807263188b6e05002f3690ec582 Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Thu, 5 Jan 2012 15:59:30 +0100 Subject: [PATCH 11/12] Adjust dynamically generated portgroup --- src/vnm_mad/remotes/vmware/VMware.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/vnm_mad/remotes/vmware/VMware.rb b/src/vnm_mad/remotes/vmware/VMware.rb index e7facb6ac5..e03cda8320 100644 --- a/src/vnm_mad/remotes/vmware/VMware.rb +++ b/src/vnm_mad/remotes/vmware/VMware.rb @@ -56,10 +56,9 @@ class OpenNebulaVMware < OpenNebulaNetwork vm_id = @vm['ID'] hostname = @vm['HISTORY_RECORDS/HISTORY/HOSTNAME'] process do |nic| - switch = nic[:bridge] network_id = nic[:network_id] - pg = "one-#{network_id}" + pg = "one-pg-#{network_id}" if nic[:vlan] == "YES" if nic[:vlan_id] From 342380b4c217ef656967a1e346854d4b6384f14e Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Thu, 5 Jan 2012 18:16:46 +0100 Subject: [PATCH 12/12] Sunstone: Fix IP_end parameter when creating VNet (cherry picked from commit f14c08feb41980dd21617d842e42ba198f4f85f9) --- src/sunstone/public/js/plugins/vnets-tab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sunstone/public/js/plugins/vnets-tab.js b/src/sunstone/public/js/plugins/vnets-tab.js index 5b445f32a7..5e3ba99707 100644 --- a/src/sunstone/public/js/plugins/vnets-tab.js +++ b/src/sunstone/public/js/plugins/vnets-tab.js @@ -802,7 +802,7 @@ function setupCreateVNetDialog() { if (ip_start.length) network_json["vnet"]["ip_start"] = ip_start; if (ip_end.length) - network_json["vnet"]["ip_start"] = ip_end; + network_json["vnet"]["ip_end"] = ip_end; }; };