From 3bbb69441371d939d23fe755b2c95c738bbaa5f3 Mon Sep 17 00:00:00 2001 From: Edison Su Date: Tue, 10 Jul 2012 11:05:19 -0700 Subject: [PATCH 01/13] For devcloudsetup.sh: Added dom0 memory settings to grub config. Added root password reset. Install xen ia32 instead of amd64, to 32bit compability Send-by: chip.childers@sungard.com RB: https://reviews.apache.org/r/5877/ --- tools/devcloud/devcloudsetup.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/devcloud/devcloudsetup.sh b/tools/devcloud/devcloudsetup.sh index 8ae3908c8c9..03169d81f11 100644 --- a/tools/devcloud/devcloudsetup.sh +++ b/tools/devcloud/devcloudsetup.sh @@ -21,13 +21,15 @@ install_xen() { aptitude update echo "install xen" aptitude -y install linux-headers-3.2.0-23-generic-pae - aptitude -y install xen-hypervisor-4.1 xcp-xapi + aptitude -y install xen-hypervisor-4.1-i386 xcp-xapi echo "configure xen" sed -i -e 's/xend_start$/#xend_start/' -e 's/xend_stop$/#xend_stop/' /etc/init.d/xend update-rc.d xendomains disable - sed -i 's/GRUB_DEFAULT=.\+/GRUB_DEFAULT="Xen 4.1-amd64"/' /etc/default/grub + sed -i 's/GRUB_DEFAULT=.\+/GRUB_DEFAULT="Xen 4.1-i386"/' /etc/default/grub + echo 'GRUB_CMDLINE_XEN_DEFAULT="dom0_mem=512M,max:512M"' | cat /etc/default/grub - >> /etc/default/newgrub + mv /etc/default/newgrub /etc/default/grub update-grub mkdir /usr/share/qemu @@ -52,6 +54,9 @@ EOF echo TOOLSTACK=xapi > /etc/default/xen echo bridge > /etc/xcp/network.conf + echo "set root password" + echo "root:password" | chpasswd + echo "reboot" reboot } From b000b8047e33073fb79811daa362be7527034152 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Tue, 10 Jul 2012 11:23:18 -0700 Subject: [PATCH 02/13] CS-15475: Fix missing 'add guest network' action from network list Original patch by: Pranav Saxena Reviewed by: Brian Federle --- ui/scripts/network.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/scripts/network.js b/ui/scripts/network.js index 150ade27846..baeb9722b5a 100644 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -197,7 +197,7 @@ label: 'label.add.guest.network', preFilter: function(args) { - var basicZoneExists = false; + var basicZoneExists = true; //Modifying the logic behind displaying the tabs depending on the networktype $.ajax({ url: createURL("listZones"), dataType: "json", @@ -206,8 +206,8 @@ if(json.listzonesresponse.zone != null && json.listzonesresponse.zone.length > 0) { zoneObjs = json.listzonesresponse.zone; $(zoneObjs).each(function() { - if(this.networktype == "Basic") { - basicZoneExists = true; + if(this.networktype == "Advanced") { + basicZoneExists = false; // For any occurence of an Advanced zone with any combination of basic zone , the add guest network tab will be displayed return false; //break each loop } }); From 081f1e335dadaf1a0c79d79dbf042b3482aad123 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Tue, 10 Jul 2012 13:31:40 -0700 Subject: [PATCH 03/13] Add header fields --- ui/css/cloudstack3.css | 27 ++++++++++++++++++++++++++ ui/scripts/network.js | 31 ++++++++++++++++++++++++++++++ ui/scripts/ui/widgets/multiEdit.js | 18 +++++++++++++++++ 3 files changed, 76 insertions(+) diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css index f2d1a0d1558..2a25a0acfb2 100644 --- a/ui/css/cloudstack3.css +++ b/ui/css/cloudstack3.css @@ -6926,6 +6926,33 @@ div.panel.ui-dialog div.list-view div.fixed-header { margin: 0 22px 0 0; } +/** Header fields*/ +.multi-edit .header-fields { + float: left; + height: 32px; + width: 100%; + margin-left: 8px; +} + +.multi-edit .header-fields .form-item { + margin-bottom: 32px; + float: left; +} + +.multi-edit .header-fields .form-item .name, +.multi-edit .header-fields .form-item .value { + float: left; +} + +.multi-edit .header-fields .form-item .name { + font-size: 14px; + padding: 5px; + color: #55687A; +} + +.multi-edit .header-fields input[type=submit] { +} + /*Security Rules*/ .security-rules .multi-edit input { width: 69px; diff --git a/ui/scripts/network.js b/ui/scripts/network.js index baeb9722b5a..d12fa30831f 100644 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -1949,6 +1949,21 @@ } } }), + headerFields: { + tier: { + label: 'Tier', + select: function(args) { + args.response.success({ + data: [ + { id: '-1', name: '', description: 'None' }, + { id: '1', name: 'tier1', description: 'tier1' }, + { id: '2', name: 'tier2', description: 'tier2' }, + { id: '3', name: 'tier3', description: 'tier3' } + ] + }); + } + } + }, multipleAdd: true, fields: { 'name': { edit: true, label: 'label.name', isEditable: true }, @@ -1967,6 +1982,7 @@ }); } }, + 'sticky': { label: 'label.stickiness', custom: { @@ -2278,6 +2294,21 @@ // Port forwarding rules portForwarding: { + headerFields: { + tier: { + label: 'Tier', + select: function(args) { + args.response.success({ + data: [ + { id: '-1', name: '', description: 'None' }, + { id: '1', name: 'tier1', description: 'tier1' }, + { id: '2', name: 'tier2', description: 'tier2' }, + { id: '3', name: 'tier3', description: 'tier3' } + ] + }); + } + } + }, listView: $.extend(true, {}, cloudStack.sections.instances, { listView: { dataProvider: function(args) { diff --git a/ui/scripts/ui/widgets/multiEdit.js b/ui/scripts/ui/widgets/multiEdit.js index 0481dda7c51..8eac50646df 100644 --- a/ui/scripts/ui/widgets/multiEdit.js +++ b/ui/scripts/ui/widgets/multiEdit.js @@ -755,6 +755,24 @@ } }); + // Setup header fields + var showHeaderFields = args.headerFields ? true : false; + var headerForm = showHeaderFields ? cloudStack.dialog.createForm({ + noDialog: true, + form: { + fields: args.headerFields + }, + after: function(args) { + // Form fields are handled by main 'add' action + } + }) : null; + var $headerFields = $('
').addClass('header-fields'); + + if (headerForm) { + $headerFields.append(headerForm.$formContainer) + .prependTo($multi); + } + if (args.actions && !args.noHeaderActionsColumn) { $thead.append($('').html(_l('label.actions')).addClass('multi-actions')); $inputForm.append($('').addClass('multi-actions')); From 7de02b6d5ce612bb9b119075f6ab90b883d0af67 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Tue, 10 Jul 2012 13:59:51 -0700 Subject: [PATCH 04/13] Update dummy tier data --- ui/scripts/network.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/scripts/network.js b/ui/scripts/network.js index d12fa30831f..005d999f8f4 100644 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -1955,7 +1955,7 @@ select: function(args) { args.response.success({ data: [ - { id: '-1', name: '', description: 'None' }, + { id: '', name: '', description: 'None' }, { id: '1', name: 'tier1', description: 'tier1' }, { id: '2', name: 'tier2', description: 'tier2' }, { id: '3', name: 'tier3', description: 'tier3' } @@ -2300,7 +2300,7 @@ select: function(args) { args.response.success({ data: [ - { id: '-1', name: '', description: 'None' }, + { id: '', name: '', description: 'None' }, { id: '1', name: 'tier1', description: 'tier1' }, { id: '2', name: 'tier2', description: 'tier2' }, { id: '3', name: 'tier3', description: 'tier3' } From 04ac28202fdec381ec8284c7d49c55edea39ad5f Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Tue, 10 Jul 2012 14:01:38 -0700 Subject: [PATCH 05/13] Multi-edit: refactor form serialization To support header-level form items, serialize every form within the multi-edit div (not just the main table form). For reusability, make data serialization handled in separate 'getMultiData' function. --- ui/scripts/ui/widgets/multiEdit.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/scripts/ui/widgets/multiEdit.js b/ui/scripts/ui/widgets/multiEdit.js index 8eac50646df..e5278db9a3a 100644 --- a/ui/scripts/ui/widgets/multiEdit.js +++ b/ui/scripts/ui/widgets/multiEdit.js @@ -15,6 +15,10 @@ // specific language governing permissions and limitations // under the License. (function($, cloudStack) { + var getMultiData = function($multi) { + return cloudStack.serializeForm($multi.find('form')); + }; + var _medit = cloudStack.ui.widgets.multiEdit = { /** * Append item to list @@ -790,7 +794,7 @@ var addItem = function(itemData) { var data = {}; - $.each(cloudStack.serializeForm($multiForm), function(key, value) { + $.each(getMultiData($multi), function(key, value) { if (value != '') { data[key] = value; } From 5fa4f4cf3703c7343e1ca8ea6a6625de4a54a18b Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Tue, 10 Jul 2012 14:01:56 -0700 Subject: [PATCH 06/13] Pass mulit-edit form data to add VM dialogs, as part of context --- ui/scripts/ui/widgets/multiEdit.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/scripts/ui/widgets/multiEdit.js b/ui/scripts/ui/widgets/multiEdit.js index e5278db9a3a..e77901edd19 100644 --- a/ui/scripts/ui/widgets/multiEdit.js +++ b/ui/scripts/ui/widgets/multiEdit.js @@ -366,6 +366,7 @@ var $listView; var instances = $.extend(true, {}, listView, { context: $.extend(true, {}, context, { + multiData: getMultiData($multi), multiRule: options.multiRule ? [options.multiRule] : null }), uiCustom: true From dd52157f0927da18b2eb4fba5173b79fd43f0da9 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Tue, 10 Jul 2012 14:17:38 -0700 Subject: [PATCH 07/13] Add code to show/hide 'tiers' header fields --- ui/scripts/network.js | 26 +++++++++++++++++++++++++- ui/scripts/ui/widgets/multiEdit.js | 1 + 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/ui/scripts/network.js b/ui/scripts/network.js index 005d999f8f4..4e0be67b80f 100644 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -2194,7 +2194,9 @@ } } }, - dataProvider: function(args) { + dataProvider: function(args) { + var $multi = args.$multi; + $.ajax({ url: createURL('listLoadBalancerRules'), data: { @@ -2289,6 +2291,16 @@ }); } }); + + // Check if tiers are present; hide/show header drop-down + var hasTiers = false; + var $headerFields = $multi.find('.header-fields'); + + if (hasTiers) { + $headerFields.hide(); + } else { + $headerFields.show(); + } } }, @@ -2444,6 +2456,8 @@ } }, dataProvider: function(args) { + var $multi = args.$multi; + $.ajax({ url: createURL('listPortForwardingRules'), data: { @@ -2495,6 +2509,16 @@ } }); }); + + // Check if tiers are present; hide/show header drop-down + var hasTiers = false; + var $headerFields = $multi.find('.header-fields'); + + if (hasTiers) { + $headerFields.hide(); + } else { + $headerFields.show(); + } }, error: function(data) { args.response.error(parseXMLHttpResponse(data)); diff --git a/ui/scripts/ui/widgets/multiEdit.js b/ui/scripts/ui/widgets/multiEdit.js index e77901edd19..cc793d3396e 100644 --- a/ui/scripts/ui/widgets/multiEdit.js +++ b/ui/scripts/ui/widgets/multiEdit.js @@ -896,6 +896,7 @@ var getData = function() { dataProvider({ context: context, + $multi: $multi, response: { success: function(args) { $multi.find('.data-item').remove(); From 5b8f5d6ae3c2c04323aefae08d42c025221e94d9 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Tue, 10 Jul 2012 14:54:10 -0700 Subject: [PATCH 08/13] multiEdit: Correctly pass context to header fields --- ui/scripts/ui/widgets/multiEdit.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/scripts/ui/widgets/multiEdit.js b/ui/scripts/ui/widgets/multiEdit.js index cc793d3396e..64d94f6dd90 100644 --- a/ui/scripts/ui/widgets/multiEdit.js +++ b/ui/scripts/ui/widgets/multiEdit.js @@ -763,6 +763,7 @@ // Setup header fields var showHeaderFields = args.headerFields ? true : false; var headerForm = showHeaderFields ? cloudStack.dialog.createForm({ + context: context, noDialog: true, form: { fields: args.headerFields From c87501d8aea2196c082024392b89fdcf18c2a931 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Tue, 10 Jul 2012 13:40:12 -0700 Subject: [PATCH 09/13] Fix placement of header --- ui/css/cloudstack3.css | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css index 2a25a0acfb2..8e924bb08de 100644 --- a/ui/css/cloudstack3.css +++ b/ui/css/cloudstack3.css @@ -6595,6 +6595,11 @@ div.panel.ui-dialog div.list-view div.fixed-header { .multi-edit { } +.multi-edit > form { + position: relative; + clear: both; +} + .multi-edit table.multi-edit { border-top: none; } @@ -6928,10 +6933,11 @@ div.panel.ui-dialog div.list-view div.fixed-header { /** Header fields*/ .multi-edit .header-fields { - float: left; - height: 32px; - width: 100%; - margin-left: 8px; + position: relative; + /*+placement:shift 8px 11px;*/ + position: relative; + left: 8px; + top: 11px; } .multi-edit .header-fields .form-item { From 9f093817f36f3b07883c19528e1144ffa1c52e93 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Tue, 10 Jul 2012 15:31:55 -0700 Subject: [PATCH 10/13] Implement static NAT tier select UI Adds a new drop-down to the enable static NAT dialog to allow selecting a tier to be associated with the VM. This is in the header of the list view. It is defined as follows: enableStaticNAT: { ... action: { noAdd: true, custom: cloudStack.uiCustom.enableStaticNAT({ // VPC tierSelect: function(args) { args.response.success({ data: [ { id: '1', description: 'VPC 1' }, { id: '2', description: 'VPC 2' } ] }); }, ... --- ui/css/cloudstack3.css | 28 +++++++++++++++++++++ ui/scripts/network.js | 11 +++++++++ ui/scripts/ui-custom/enableStaticNAT.js | 33 +++++++++++++++++++++++++ 3 files changed, 72 insertions(+) diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css index 8e924bb08de..8188a01bf7e 100644 --- a/ui/css/cloudstack3.css +++ b/ui/css/cloudstack3.css @@ -9266,6 +9266,34 @@ div.panel.ui-dialog div.list-view div.fixed-header { width: 46px; } +/*VPC: Enable Static NAT fields*/ +.list-view.instances .filters.tier-select { + width: 246px; + /*+border-radius:4px;*/ + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + -khtml-border-radius: 4px; + border-radius: 4px; + background: #8F98A1; + padding: 2px 20px 2px 13px; + margin: 1px 120px 0 19px; + border: 1px solid #000000; +} + +.list-view.instances .filters.tier-select label { + color: #FFFFFF; + /*+text-shadow:0px 1px 3px #000000;*/ + -moz-text-shadow: 0px 1px 3px #000000; + -webkit-text-shadow: 0px 1px 3px #000000; + -o-text-shadow: 0px 1px 3px #000000; + text-shadow: 0px 1px 3px #000000; +} + +.list-view.instances .filters.tier-select select { + width: 166px; + float: left; +} + /*Configure ACL dialog*/ .ui-dialog.configure-acl { } diff --git a/ui/scripts/network.js b/ui/scripts/network.js index 4e0be67b80f..bb9f4f906cc 100644 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -1230,9 +1230,20 @@ }, enableStaticNAT: { label: 'label.action.enable.static.NAT', + action: { noAdd: true, custom: cloudStack.uiCustom.enableStaticNAT({ + // VPC + tierSelect: function(args) { + args.response.success({ + data: [ + { id: '1', description: 'VPC 1' }, + { id: '2', description: 'VPC 2' } + ] + }); + }, + listView: $.extend(true, {}, cloudStack.sections.instances, { listView: { dataProvider: function(args) { diff --git a/ui/scripts/ui-custom/enableStaticNAT.js b/ui/scripts/ui-custom/enableStaticNAT.js index ad4fbc46825..f3fbfadd16a 100644 --- a/ui/scripts/ui-custom/enableStaticNAT.js +++ b/ui/scripts/ui-custom/enableStaticNAT.js @@ -18,6 +18,7 @@ cloudStack.uiCustom.enableStaticNAT = function(args) { var listView = args.listView; var action = args.action; + var tierSelect = args.tierSelect; return function(args) { var context = args.context; @@ -86,6 +87,7 @@ $dataList.fadeOut(function() { action({ + tierID: $dataList.find('.tier-select select').val(), context: $.extend(true, {}, context, { instances: [ $dataList.find('tr.multi-edit-selected').data('json-obj') @@ -124,6 +126,37 @@ } ] }).parent('.ui-dialog').overlay(); + + // Add tier select dialog + if (tierSelect) { + var $toolbar = $dataList.find('.toolbar'); + var $tierSelect = $('
').addClass('filters tier-select').prependTo($toolbar); + var $tierSelectLabel = $('