From 93fcd024a58d165ded508ff2dc927b4e8fad82fa Mon Sep 17 00:00:00 2001 From: Naredula Janardhana Reddy Date: Thu, 22 Dec 2011 11:46:14 +0530 Subject: [PATCH 01/38] Bug 12679: Database Upgrade script added for rp_filter from 2.2.12 to 2.2.13 --- setup/db/db/schema-2212to2213.sql | 2 +- setup/db/db/schema-228to229.sql | 1 - setup/db/db/schema-229to2210.sql | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/setup/db/db/schema-2212to2213.sql b/setup/db/db/schema-2212to2213.sql index d0a8b0beb2d..58c6ed9c1af 100644 --- a/setup/db/db/schema-2212to2213.sql +++ b/setup/db/db/schema-2212to2213.sql @@ -61,6 +61,6 @@ update host_details set name='privateip' where host_id in (select id from host w INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'vmware.root.disk.controller', 'ide', 'Specify the default disk controller for root volumes, valid values are scsi, ide'); INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'vm.destory.forcestop', 'false', 'On destory, force-stop takes this value'); - INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.lock.timeout', '600', 'Lock wait timeout (seconds) while implementing network'); +INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.disable.rpfilter','true','disable rp_filter on Domain Router VM public interfaces.'); diff --git a/setup/db/db/schema-228to229.sql b/setup/db/db/schema-228to229.sql index 6cddc62a185..2540e231e99 100644 --- a/setup/db/db/schema-228to229.sql +++ b/setup/db/db/schema-228to229.sql @@ -53,7 +53,6 @@ INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-serve INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.uri','/admin?stats','Load Balancer(haproxy) uri.'); INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.auth','admin1:AdMiN123','Load Balancer(haproxy) authetication string in the format username:password'); INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.port','8081','Load Balancer(haproxy) stats port number.'); -INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.disable.rpfilter','true','disable rp_filter on Domain Router VM public interfaces.'); INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'NetworkManager', 'use.external.dns', 'false', 'Bypass the cloudstack DHCP/DNS server vm name service, use zone external dns1 and dns2'); INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.enabled', 'false', 'Whether the load balancing service is enabled for basic zones'); INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.gc.interval.minutes', '120', 'Garbage collection interval to destroy unused ELB vms in minutes. Minimum of 5'); diff --git a/setup/db/db/schema-229to2210.sql b/setup/db/db/schema-229to2210.sql index 8e7aaec5445..045ce9e980c 100644 --- a/setup/db/db/schema-229to2210.sql +++ b/setup/db/db/schema-229to2210.sql @@ -35,7 +35,6 @@ INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-serve INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.uri','/admin?stats','Load Balancer(haproxy) uri.'); INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.auth','admin1:AdMiN123','Load Balancer(haproxy) authetication string in the format username:password'); INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.port','8081','Load Balancer(haproxy) stats port number.'); -INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.disable.rpfilter','true','disable rp_filter on Domain Router VM public interfaces.'); INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'NetworkManager', 'use.external.dns', 'false', 'Bypass the cloudstack DHCP/DNS server vm name service, use zone external dns1 and dns2'); INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.enabled', 'false', 'Whether the load balancing service is enabled for basic zones'); INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'network.loadbalancer.basiczone.elb.gc.interval.minutes', '120', 'Garbage collection interval to destroy unused ELB vms in minutes. Minimum of 5'); From c60501e950e90b28a50317495a7ad0879a479257 Mon Sep 17 00:00:00 2001 From: bfederle Date: Thu, 22 Dec 2011 08:41:40 -0800 Subject: [PATCH 02/38] UI widgets: support event-based notifications Triggering 'cloudStack.addNotification' adds a new UI notification, to avoid having to specify DOM element containing the jQuery widget every time. This event accepts same args as .notifications('add', ...) Example: $(window).trigger('cloudStack.addNotification', { desc: 'Description', interval: 1000, poll: function(args) { ... args.complete(); } }); --- ui/scripts/ui/widgets/notifications.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/scripts/ui/widgets/notifications.js b/ui/scripts/ui/widgets/notifications.js index 08b5dc48aba..e6f44750b2a 100644 --- a/ui/scripts/ui/widgets/notifications.js +++ b/ui/scripts/ui/widgets/notifications.js @@ -230,7 +230,11 @@ return this; }; - // Events + // Setup notification listener -- accepts same args as + $(window).bind('cloudStack.addNotification', function(event, data) { + $('.notifications').notifications('add', data); + }); + $(document).click(function(event) { var $target = $(event.target); var $attachTo, $popup; From 577d0e698216b6ff9aa17435afc8f946c37d6eee Mon Sep 17 00:00:00 2001 From: bfederle Date: Thu, 22 Dec 2011 08:41:47 -0800 Subject: [PATCH 03/38] Code cleanup --- ui/scripts/ui/events.js | 60 ++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/ui/scripts/ui/events.js b/ui/scripts/ui/events.js index 69f85a13ddb..cce9268e817 100644 --- a/ui/scripts/ui/events.js +++ b/ui/scripts/ui/events.js @@ -1,39 +1,39 @@ (function($, cloudStack) { - var event = cloudStack.ui.event = {}; - - // Attach element to a specific event type - event.elem = function(widget, elem, $elem, extraData) { - // Setup DOM metadata - var data = { cloudStack: {} }; - data.cloudStack[widget] = { - elem: elem - }; - if (extraData) $.extend(data.cloudStack[widget], extraData); + cloudStack.ui.event = { + // Attach element to specific event type + elem: function(widget, elem, $elem, extraData) { + // Setup DOM metadata + var data = { cloudStack: {} }; + data.cloudStack[widget] = { + elem: elem + }; + if (extraData) $.extend(data.cloudStack[widget], extraData); - return $elem - .addClass('cloudStack-elem') - .addClass(widget) - .data(data); - }; + return $elem + .addClass('cloudStack-elem') + .addClass(widget) + .data(data); + }, - // Create widget-based event - event.bind = function(widget, events) { - return function(event) { - var $target = $(event.target); - var $widget, $elem; - var data, elem; + // Create widget-based event + bind: function(widget, events) { + return function(event) { + var $target = $(event.target); + var $widget, $elem; + var data, elem; - $elem = $target.closest('.cloudStack-elem.' + widget); - if (!$elem.size()) - return true; + $elem = $target.closest('.cloudStack-elem.' + widget); + if (!$elem.size()) + return true; - $widget = $('.cloudStack-widget.' + widget); - data = $elem.data('cloudStack')[widget]; - elem = data.elem; + $widget = $('.cloudStack-widget.' + widget); + data = $elem.data('cloudStack')[widget]; + elem = data.elem; - events[elem]($elem, $widget, data); + events[elem]($elem, $widget, data); - return false; - }; + return false; + }; + } }; })(jQuery, cloudStack); From 3650861cb1fa7feec2359ad70a180a3f98197f2d Mon Sep 17 00:00:00 2001 From: bfederle Date: Thu, 22 Dec 2011 09:00:28 -0800 Subject: [PATCH 04/38] Refactor notification handling -Move 'addNotification' function from list view and detail view widgets to a central location, cloudStack.ui.notifications.add, in notifications.js, to avoid redundant code. -Add helper method for triggering CloudStack-specific UI events --- ui/scripts/ui/events.js | 5 +++ ui/scripts/ui/widgets/detailView.js | 57 ++---------------------- ui/scripts/ui/widgets/listView.js | 60 +++----------------------- ui/scripts/ui/widgets/notifications.js | 53 +++++++++++++++++++++++ 4 files changed, 68 insertions(+), 107 deletions(-) diff --git a/ui/scripts/ui/events.js b/ui/scripts/ui/events.js index cce9268e817..71e9578841f 100644 --- a/ui/scripts/ui/events.js +++ b/ui/scripts/ui/events.js @@ -34,6 +34,11 @@ return false; }; + }, + + // Trigger CloudStack UI event (cloudStack.*) + call: function(eventName, data) { + $(window).trigger('cloudStack.' + eventName, data); } }; })(jQuery, cloudStack); diff --git a/ui/scripts/ui/widgets/detailView.js b/ui/scripts/ui/widgets/detailView.js index 3aebd5b146c..8726e851e92 100644 --- a/ui/scripts/ui/widgets/detailView.js +++ b/ui/scripts/ui/widgets/detailView.js @@ -1,53 +1,4 @@ (function($, cloudStack) { - /** - * Add 'pending' notification - */ - var addNotification = function(notification, success, successArgs, error, errorArgs) { - if (!notification) { - success(successArgs); - - return false; - }; - - var $notifications = $('div.notifications'); - - if (!notification.poll) { - $notifications.notifications('add', { - section: notification.section, - desc: notification.desc, - interval: 0, - poll: function(args) { success(successArgs); args.complete(); } - }); - } else { - $notifications.notifications('add', { - section: notification.section, - desc: notification.desc, - interval: 2000, - _custom: notification._custom, - poll: function(args) { - var complete = args.complete; - var notificationError = args.error; - - notification.poll({ - _custom: args._custom, - complete: function(args) { - success($.extend(successArgs, args)); - complete(args); - }, - error: function(args) { - error($.extend(errorArgs, args)); - notificationError(args); - - return cloudStack.dialog.error; - } - }); - } - }); - } - - return true; - }; - var replaceListViewItem = function($detailView, newData) { var $row = $detailView.data('list-view-row'); @@ -141,7 +92,7 @@ notification.desc = messages.notification(args.messageArgs); notification._custom = args._custom; - addNotification( + cloudStack.ui.notifications.add( notification, // Success @@ -181,7 +132,7 @@ if (additional && additional.success) additional.success(args); // Setup notification - addNotification( + cloudStack.ui.notifications.add( notification, function(args) { if ($detailView.is(':visible')) { @@ -368,13 +319,13 @@ if (!action.notification) { convertInputs($inputs); - addNotification( + cloudStack.ui.notifications.add( notificationArgs, function() {}, [] ); replaceListViewItem($detailView, data); } else { $loading.appendTo($detailView); - addNotification( + cloudStack.ui.notifications.add( $.extend(true, {}, action.notification, notificationArgs), function(args) { replaceListViewItem($detailView, data); diff --git a/ui/scripts/ui/widgets/listView.js b/ui/scripts/ui/widgets/listView.js index c1f27ae2ed0..c41a3f3f907 100644 --- a/ui/scripts/ui/widgets/listView.js +++ b/ui/scripts/ui/widgets/listView.js @@ -2,53 +2,6 @@ * Create dynamic list view based on data callbacks */ (function($, cloudStack) { - /** - * Add 'pending' notification - */ - var addNotification = function(notification, success, successArgs, error, errorArgs) { - if (!notification) { - success(successArgs); - - return false; - }; - - var $notifications = $('div.notifications'); - - if (!notification.poll) { - $notifications.notifications('add', { - section: notification.section, - desc: notification.desc, - interval: 0, - poll: function(args) { success(successArgs); args.complete(); } - }); - } else { - $notifications.notifications('add', { - section: notification.section, - desc: notification.desc, - interval: 5000, - _custom: notification._custom, - poll: function(args) { - var complete = args.complete; - var notificationError = args.error; - - notification.poll({ - _custom: args._custom, - complete: function(args) { - success($.extend(successArgs, args)); - complete(args); - }, - error: function(args) { - error($.extend(errorArgs, args)); - notificationError(args); - } - }); - } - }); - } - - return true; - }; - var uiActions = { standard: function($instanceRow, args, additional) { var listViewArgs = $instanceRow.closest('div.list-view').data('view-args'); @@ -110,7 +63,7 @@ notification.desc = messages.notification(args.messageArgs); notification._custom = args._custom; - addNotification( + cloudStack.ui.notifications.add( notification, function(args) { if ($item.is(':visible')) { @@ -174,7 +127,7 @@ if (additional && additional.success) additional.success(args); - addNotification( + cloudStack.ui.notifications.add( notification, // Success @@ -428,15 +381,14 @@ var newName = $editInput.val(); showLabel(newName, { success: function() { - addNotification( + cloudStack.ui.notifications.add( { section: $instanceRow.closest('div.view').data('view-args').id, - desc: newName ? 'Set value of ' + $instanceRow.find('td.name span').html() + ' to ' + newName : + desc: newName ? + 'Set value of ' + $instanceRow.find('td.name span').html() + ' to ' + newName : 'Unset value for ' + $instanceRow.find('td.name span').html() }, - function(args) { - - }, + function(args) {}, [{ name: newName }] ); } diff --git a/ui/scripts/ui/widgets/notifications.js b/ui/scripts/ui/widgets/notifications.js index e6f44750b2a..45761abf76f 100644 --- a/ui/scripts/ui/widgets/notifications.js +++ b/ui/scripts/ui/widgets/notifications.js @@ -213,6 +213,10 @@ } }; + /** + * Define notification widget -- this is basically represented in a + * notifications icon, that contains a pop-up list of notifications + */ $.fn.notifications = function(method, args) { var $attachTo = this; var $total = $attachTo.find('div.total span'); @@ -230,6 +234,55 @@ return this; }; + /** + * Notifications UI helpers + */ + cloudStack.ui.notifications = { + add: function(notification, success, successArgs, error, errorArgs) { + if (!notification) { + success(successArgs); + + return false; + }; + + var $notifications = $('div.notifications'); + + if (!notification.poll) { + cloudStack.ui.event.call('addNotification', { + section: notification.section, + desc: notification.desc, + interval: 0, + poll: function(args) { success(successArgs); args.complete(); } + }); + } else { + cloudStack.ui.event.call('addNotification', { + section: notification.section, + desc: notification.desc, + interval: 5000, + _custom: notification._custom, + poll: function(args) { + var complete = args.complete; + var notificationError = args.error; + + notification.poll({ + _custom: args._custom, + complete: function(args) { + success($.extend(successArgs, args)); + complete(args); + }, + error: function(args) { + error($.extend(errorArgs, args)); + notificationError(args); + } + }); + } + }); + } + + return true; + } + }; + // Setup notification listener -- accepts same args as $(window).bind('cloudStack.addNotification', function(event, data) { $('.notifications').notifications('add', data); From 25c25acd212efdc1b411cb43ad4c3a77b2f8ddca Mon Sep 17 00:00:00 2001 From: bfederle Date: Thu, 22 Dec 2011 10:10:05 -0800 Subject: [PATCH 05/38] Fix blank number if zero LB/PF rules present --- ui/scripts/projects.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/scripts/projects.js b/ui/scripts/projects.js index 2df71a753b4..d33374914ae 100644 --- a/ui/scripts/projects.js +++ b/ui/scripts/projects.js @@ -154,7 +154,7 @@ url: createURL('listLoadBalancerRules'), success: function(json) { dataFns.portForwardingRules($.extend(data, { - totalLoadBalancers: json.listloadbalancerrulesresponse ? + totalLoadBalancers: json.listloadbalancerrulesresponse.count ? json.listloadbalancerrulesresponse.count : 0 })); } @@ -166,7 +166,7 @@ url: createURL('listPortForwardingRules'), success: function(json) { dataFns.users($.extend(data, { - totalPortForwards: json.listportforwardingrulesresponse ? + totalPortForwards: json.listportforwardingrulesresponse.count ? json.listportforwardingrulesresponse.count : 0 })); } From 0d013cfd3a7ae3af530471617d3716f6e02efa6b Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Thu, 22 Dec 2011 10:30:39 -0800 Subject: [PATCH 06/38] cloudstack 3.0 new UI - template page - detailView - clicking refresh button will make listTemplates API call to refresh data. --- ui/scripts/templates.js | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js index 3d2bfc091fc..ce19e317838 100644 --- a/ui/scripts/templates.js +++ b/ui/scripts/templates.js @@ -804,13 +804,23 @@ } ], - dataProvider: function(args) { - args.response.success( - { - actionFilter: templateActionfilter, - data:args.context.templates[0] - } - ); + dataProvider: function(args) { + var jsonObj = args.context.templates[0]; + var apiCmd = "listTemplates&templatefilter=self&id=" + jsonObj.id; + if(jsonObj.zoneid != null) + apiCmd = apiCmd + "&zoneid=" + jsonObj.zoneid; + + $.ajax({ + url: createURL(apiCmd), + dataType: "json", + success: function(json) { + args.response.success({ + actionFilter: templateActionfilter, + data: json.listtemplatesresponse.template[0] + }); + } + }); + } } } From 8c242b7e88d3cd76c9d576dcf39e1c2492bb423f Mon Sep 17 00:00:00 2001 From: bfederle Date: Thu, 22 Dec 2011 10:31:22 -0800 Subject: [PATCH 07/38] Projects dashboard fixes and cleanup -Fix dashboard calling API twice per item -Only show 8 latest events, to shortern load time -Whitespace/code cleanup --- ui/scripts/projects.js | 34 +++++++++++++++++++------------- ui/scripts/ui-custom/projects.js | 23 ++++++++++----------- 2 files changed, 32 insertions(+), 25 deletions(-) diff --git a/ui/scripts/projects.js b/ui/scripts/projects.js index d33374914ae..44c15ddbbaf 100644 --- a/ui/scripts/projects.js +++ b/ui/scripts/projects.js @@ -18,13 +18,13 @@ success: function(json) { updatedResources++; if (updatedResources == totalResources) { - args.response.success(); + args.response.success(); } } }); }); }, - + dataProvider: function(args) { $.ajax({ url: createURL('listResourceLimits'), @@ -70,7 +70,7 @@ }); } }); - + } }, @@ -80,9 +80,9 @@ $.ajax({ url: createURL('listVirtualMachines'), success: function(json) { - var instances = json.listvirtualmachinesresponse.virtualmachine ? + var instances = json.listvirtualmachinesresponse.virtualmachine ? json.listvirtualmachinesresponse.virtualmachine : []; - + dataFns.storage($.extend(data, { runningInstances: $.grep(instances, function(instance) { return instance.state == 'Running'; @@ -124,7 +124,7 @@ id: network.networkofferingid }, success: function(json) { - totalBandwidth += + totalBandwidth += json.listnetworkofferingsresponse.networkoffering[0].networkrate; } }); @@ -193,13 +193,19 @@ events: function(data) { $.ajax({ url: createURL('listEvents', { ignoreProject: true }), + data: { + page: 1, + pageSize: 8 + }, success: function(json) { var events = json.listeventsresponse.event; complete($.extend(data, { events: $.map(events, function(event) { return { - date: event.created.substr(5, 2) + '/' + event.created.substr(8, 2) + '/' + event.created.substr(2, 2), + date: event.created.substr(5, 2) + + '/' + event.created.substr(8, 2) + + '/' + event.created.substr(2, 2), desc: event.description }; }) @@ -381,7 +387,7 @@ actionPreFilter: function(args) { if (!cloudStack.context.projects && args.context.multiRule[0].role != 'Admin') { // This is for the new project wizard - return ['destroy']; + return ['destroy']; } if (args.context.multiRule[0].role != 'Admin') { @@ -489,10 +495,10 @@ data.listprojectsresponse.project ? data.listprojectsresponse.project : [], function(elem) { - return $.extend(elem, { - displayText: elem.displaytext - }); - }) + return $.extend(elem, { + displayText: elem.displaytext + }); + }) }); } }); @@ -812,14 +818,14 @@ var projectsActionFilter = function(args) { var allowedActions = ['destroy']; - + if (args.context.item.account == cloudStack.context.users[0].account || args.context.users[0].role == '1') { if (args.context.item.state == 'Suspended') { allowedActions.push('enable'); } else if (args.context.item.state == 'Active') { allowedActions.push('disable'); } - + return allowedActions; } diff --git a/ui/scripts/ui-custom/projects.js b/ui/scripts/ui-custom/projects.js index 72afa1685f6..c362e918bbc 100644 --- a/ui/scripts/ui-custom/projects.js +++ b/ui/scripts/ui-custom/projects.js @@ -4,7 +4,7 @@ * User management multi-edit */ userManagement: function(args) { - var multiEdit = !args.useInvites ? + var multiEdit = !args.useInvites ? cloudStack.projects.addUserForm : cloudStack.projects.inviteForm; @@ -62,7 +62,7 @@ } else { $item.hide().html(value).fadeIn(); } - }); + }); } }); } @@ -94,14 +94,14 @@ if (g_capabilities.projectinviterequired) { tabs.invitations = function() { return $('
').addClass('management-invite').data('tab-title', 'Invitations'); - }; + }; } tabs.resources = function() { var $resources = $('
').addClass('resources').data('tab-title', 'Resources'); var $form = $('
'); var $submit = $('').attr({ - type: 'submit' + type: 'submit' }).val('Apply'); cloudStack.projects.resourceManagement.dataProvider({ @@ -118,7 +118,7 @@ name: resource.type, value: resource.value }).addClass('required'); - + $field.append($label, $input); $field.appendTo($form); }); @@ -147,7 +147,7 @@ } } }); - + return false; }); @@ -156,7 +156,7 @@ } } }); - + return $resources; }; } @@ -167,14 +167,15 @@ // Make UI tabs $.each(tabs, function(tabName, tab) { var $tab = $('
  • ').appendTo($tabs.find('ul:first')); + var $tabContent = tab(); var $tabLink = $('') .attr({ href: '#project-view-dashboard-' + tabName }) - .html(tab().data('tab-title')) + .html($tabContent.data('tab-title')) .appendTo($tab); var $content = $('
    ') .appendTo($tabs) .attr({ id: 'project-view-dashboard-' + tabName }) - .append(tab); + .append($tabContent); }); $tabs.find('ul li:first').addClass('first'); @@ -252,7 +253,7 @@ var project = args.data; $(window).trigger('cloudStack.fullRefresh'); - + $loading.remove(); // Confirmation @@ -346,7 +347,7 @@ var $instanceRow = args.$instanceRow; $instanceRow.animate({ opacity: 0.5 }); - + cloudStack.projects.addUserForm.actions.destroy.action({ context: $.extend(true, {}, cloudStack.context, { projects: [project], From 483119ec0f4a1301d45d256222cf79b8d3676eb8 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Thu, 22 Dec 2011 10:38:08 -0800 Subject: [PATCH 08/38] cloudstack 3.0 new UI - ISO page - detailView - clicking refresh button will make listIsos API call to refresh data. --- ui/scripts/templates.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js index ce19e317838..ad5311d8ea5 100644 --- a/ui/scripts/templates.js +++ b/ui/scripts/templates.js @@ -1503,12 +1503,22 @@ ], dataProvider: function(args) { - args.response.success( - { - actionFilter: isoActionfilter, - data:args.context.isos[0] - } - ); + var jsonObj = args.context.isos[0]; + var apiCmd = "listIsos&isofilter=self&id="+jsonObj.id; + if(jsonObj.zoneid != null) + apiCmd = apiCmd + "&zoneid="+jsonObj.zoneid; + + $.ajax({ + url: createURL(apiCmd), + dataType: "json", + success: function(json) { + args.response.success({ + actionFilter: isoActionfilter, + data: json.listisosresponse.iso[0] + }); + } + }); + } } } From e348b25ad68631561b01d01aef3dd915790f63d6 Mon Sep 17 00:00:00 2001 From: bfederle Date: Thu, 22 Dec 2011 11:04:10 -0800 Subject: [PATCH 09/38] bug 12698 Fix detail view error handling for async actions status 12698: resolved fixed --- ui/scripts/ui/widgets/detailView.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ui/scripts/ui/widgets/detailView.js b/ui/scripts/ui/widgets/detailView.js index 8726e851e92..312d6fecd17 100644 --- a/ui/scripts/ui/widgets/detailView.js +++ b/ui/scripts/ui/widgets/detailView.js @@ -109,7 +109,9 @@ {}, // Error - function(args) {} + function(args) { + $loading.remove(); + } ); } }); @@ -159,13 +161,12 @@ // Error function(args) { - + $loading.remove(); } ); }, error: function(args) { - // if (args.message) - // cloudStack.dialog.notice({ message: args.message }); + $loading.remove(); } } }); From 51f7872ec97c1fef854e1db0bdf29cafd44cc707 Mon Sep 17 00:00:00 2001 From: bfederle Date: Thu, 22 Dec 2011 11:04:35 -0800 Subject: [PATCH 10/38] bug 12698: Add error fn to delete NetScaler action --- ui/scripts/system.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 28270773421..716ed36fafa 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -4322,6 +4322,10 @@ {jobId: jid} } ); + }, + + error: function(json) { + args.response.error(parseXMLHttpResponse(json)); } }); }, From b57e2b9e9de8b0521cbd9a26e9b47557fcc0a57e Mon Sep 17 00:00:00 2001 From: bfederle Date: Thu, 22 Dec 2011 11:28:23 -0800 Subject: [PATCH 11/38] Fix missing pod intro in install wizard --- ui/scripts/ui-custom/installWizard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/scripts/ui-custom/installWizard.js b/ui/scripts/ui-custom/installWizard.js index 3abe57fba71..27f9e3d3085 100644 --- a/ui/scripts/ui-custom/installWizard.js +++ b/ui/scripts/ui-custom/installWizard.js @@ -379,7 +379,7 @@ tooltipID: 'addZone', diagram: '.part.zone', prevStepID: 'addZoneIntro', - nextStepID: 'addPod', + nextStepID: 'addPodIntro', form: { name: { label: 'Name', validation: { required: true } }, dns1: { label: 'DNS 1', validation: { required: true } }, From dfbb125e30be6b22c40cbd0f9b5c27a9a3fda4a7 Mon Sep 17 00:00:00 2001 From: bfederle Date: Thu, 22 Dec 2011 11:38:56 -0800 Subject: [PATCH 12/38] New install wizard styling --- ui/css/cloudstack3.css | 22 ++++++++------------ ui/images/bg-gradient-white-transparent.png | Bin 0 -> 4052 bytes 2 files changed, 9 insertions(+), 13 deletions(-) create mode 100644 ui/images/bg-gradient-white-transparent.png diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css index 3a7450a4b5e..7ef05518292 100644 --- a/ui/css/cloudstack3.css +++ b/ui/css/cloudstack3.css @@ -29,6 +29,7 @@ body { font-family: sans-serif; height: 769px !important; overflow: auto; + background: url(../images/bg-login.png); } #container { @@ -354,7 +355,7 @@ body.login { color: #4A4A4A; font-size: 15px; line-height: 23px; - background: url(../images/bg-transparent-white.png); + /*[empty]background:;*/ } .install-wizard .step ul li { @@ -383,15 +384,10 @@ body.login { .install-wizard .body { width: 1012px; - height: 626px; + height: 762px; margin: -352px auto auto; z-index: 10; - background: #FFFFFF -114px -141px; - /*+box-shadow:0px -7px 10px #C6C6C6;*/ - -moz-box-shadow: 0px -7px 10px #C6C6C6; - -webkit-box-shadow: 0px -7px 10px #C6C6C6; - -o-box-shadow: 0px -7px 10px #C6C6C6; - box-shadow: 0px -7px 10px #C6C6C6; + background: url(../images/bg-gradient-white-transparent.png) repeat-x -114px -141px; } .install-wizard h2 { @@ -602,11 +598,11 @@ body.login { -webkit-text-shadow: 0px 1px 0px #FFFFFF; -o-text-shadow: 0px 1px 0px #FFFFFF; text-shadow: 0px 1px 0px #FFFFFF; - /*+box-shadow:inset 0px 1px 5px #FFFFFF;*/ - -moz-box-shadow: inset 0px 1px 5px #FFFFFF; - -webkit-box-shadow: inset 0px 1px 5px #FFFFFF; - -o-box-shadow: inset 0px 1px 5px #FFFFFF; - box-shadow: inset 0px 1px 5px #FFFFFF; + /*+box-shadow:0px 5px 9px #9F9F9F;*/ + -moz-box-shadow: 0px 5px 9px #9F9F9F; + -webkit-box-shadow: 0px 5px 9px #9F9F9F; + -o-box-shadow: 0px 5px 9px #9F9F9F; + box-shadow: 0px 5px 9px #9F9F9F; } .install-wizard .step .setup-form .title { diff --git a/ui/images/bg-gradient-white-transparent.png b/ui/images/bg-gradient-white-transparent.png new file mode 100644 index 0000000000000000000000000000000000000000..9666012576113313216d8446cdbd50e3b716daae GIT binary patch literal 4052 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 literal 0 HcmV?d00001 From 1244cd69858096a6bea338293784240e9c1c141f Mon Sep 17 00:00:00 2001 From: bfederle Date: Thu, 22 Dec 2011 11:39:12 -0800 Subject: [PATCH 13/38] Fix broken pod diagram --- ui/scripts/ui-custom/installWizard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/scripts/ui-custom/installWizard.js b/ui/scripts/ui-custom/installWizard.js index 27f9e3d3085..dd70aa99738 100644 --- a/ui/scripts/ui-custom/installWizard.js +++ b/ui/scripts/ui-custom/installWizard.js @@ -430,7 +430,7 @@ id: 'add-guest-network', stateID: 'guestNetwork', tooltipID: 'addGuestNetwork', - diagram: '.part.zone', + diagram: '.part.zone, .part.pod', prevStepID: 'addPod', nextStepID: 'addClusterIntro', form: { From d623ddad5e3e1b2b001ed41079b0a41bce4fd3e9 Mon Sep 17 00:00:00 2001 From: bfederle Date: Thu, 22 Dec 2011 11:51:41 -0800 Subject: [PATCH 14/38] Fix BG --- ui/css/cloudstack3.css | 9 ++++++++- ui/scripts/ui-custom/installWizard.js | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css index 7ef05518292..5cf174f397d 100644 --- a/ui/css/cloudstack3.css +++ b/ui/css/cloudstack3.css @@ -29,7 +29,14 @@ body { font-family: sans-serif; height: 769px !important; overflow: auto; - background: url(../images/bg-login.png); + background: #FFFFFF; +} + +body.install-wizard { + font-family: sans-serif; + height: 769px !important; + overflow: auto; + background: #FFFFFF url(../images/bg-login.png); } #container { diff --git a/ui/scripts/ui-custom/installWizard.js b/ui/scripts/ui-custom/installWizard.js index dd70aa99738..6eb591156fd 100644 --- a/ui/scripts/ui-custom/installWizard.js +++ b/ui/scripts/ui-custom/installWizard.js @@ -301,6 +301,7 @@ }); $advanced.click(function() { + $('html body').removeClass('install-wizard'); complete(); return false; @@ -718,6 +719,8 @@ .html('You may now continue.'); var $continue = elems.nextButton('Launch'); + $('html body').removeClass('install-wizard'); + showDiagram(''); $continue.click(function() { @@ -734,6 +737,7 @@ var initialStep = steps.intro().addClass('step'); showDiagram(''); + $('html body').addClass('install-wizard'); $installWizard.append( elems.header(), From 4819e24c3aed06d7ef055e93ac1b5a68e655e974 Mon Sep 17 00:00:00 2001 From: bfederle Date: Thu, 22 Dec 2011 12:05:32 -0800 Subject: [PATCH 15/38] Install wizard CSS tweaks --- ui/css/cloudstack3.css | 7 ++++++- ui/scripts/ui-custom/installWizard.js | 4 +--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css index 5cf174f397d..7a9c100003c 100644 --- a/ui/css/cloudstack3.css +++ b/ui/css/cloudstack3.css @@ -362,7 +362,7 @@ body.login { color: #4A4A4A; font-size: 15px; line-height: 23px; - /*[empty]background:;*/ + background: url(../images/bg-gradient-white-transparent.png) repeat-x -114px -270px; } .install-wizard .step ul li { @@ -395,6 +395,11 @@ body.login { margin: -352px auto auto; z-index: 10; background: url(../images/bg-gradient-white-transparent.png) repeat-x -114px -141px; + /*+box-shadow:0px -3px 4px #CFCFCF;*/ + -moz-box-shadow: 0px -3px 4px #CFCFCF; + -webkit-box-shadow: 0px -3px 4px #CFCFCF; + -o-box-shadow: 0px -3px 4px #CFCFCF; + box-shadow: 0px -3px 4px #CFCFCF; } .install-wizard h2 { diff --git a/ui/scripts/ui-custom/installWizard.js b/ui/scripts/ui-custom/installWizard.js index 6eb591156fd..db467ae50da 100644 --- a/ui/scripts/ui-custom/installWizard.js +++ b/ui/scripts/ui-custom/installWizard.js @@ -13,6 +13,7 @@ */ var complete = function() { $installWizard.remove(); + $('html body').removeClass('install-wizard'); args.complete(); }; @@ -301,7 +302,6 @@ }); $advanced.click(function() { - $('html body').removeClass('install-wizard'); complete(); return false; @@ -719,8 +719,6 @@ .html('You may now continue.'); var $continue = elems.nextButton('Launch'); - $('html body').removeClass('install-wizard'); - showDiagram(''); $continue.click(function() { From 27a552278f5fe33316dec0302b2fec7ec65d9013 Mon Sep 17 00:00:00 2001 From: bfederle Date: Thu, 22 Dec 2011 12:27:35 -0800 Subject: [PATCH 16/38] Fix validation for +
  • diff --git a/ui/scripts/ui-custom/instanceWizard.js b/ui/scripts/ui-custom/instanceWizard.js index c5c6491a8be..461a074ffca 100644 --- a/ui/scripts/ui-custom/instanceWizard.js +++ b/ui/scripts/ui-custom/instanceWizard.js @@ -583,7 +583,11 @@ // Next button if ($target.closest('div.button.next').size()) { - if (!$form.valid()) return false; + if (!$form.valid()) { + if ($form.find('input.error:visible, select.error:visible').size()) { + return false; + } + } showStep($steps.filter(':visible').index() + 2); From fa6baa69172e58f1cee02a2fddfbf96f5fcba6e3 Mon Sep 17 00:00:00 2001 From: bfederle Date: Thu, 22 Dec 2011 15:03:27 -0800 Subject: [PATCH 25/38] More consistent appearance of filter-by/section switcher selects --- ui/css/cloudstack3.css | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css index 943510307d1..932692cb6a8 100644 --- a/ui/css/cloudstack3.css +++ b/ui/css/cloudstack3.css @@ -2014,11 +2014,11 @@ div.toolbar div.text-search div.search-bar { z-index: 4; position: relative; border-right: 1px solid #8B8989; - /*+border-radius:3px 0 0 3px;*/ - -moz-border-radius: 3px 0 0 3px; - -webkit-border-radius: 3px 0 0 3px; - -khtml-border-radius: 3px 0 0 3px; - border-radius: 3px 0 0 3px; + /*+border-radius:4px 0 0 4px;*/ + -moz-border-radius: 4px 0 0 4px; + -webkit-border-radius: 4px 0 0 4px; + -khtml-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; } div.toolbar div.text-search div.search-bar input { @@ -2269,7 +2269,15 @@ div.list-view div.toolbar div.section-switcher div.section-select { div.list-view div.toolbar div.section-switcher div.section-select select { width: 142px; + height: 21px; margin-right: 13px; + font-size: 12px; + border: 1px solid #808080; + /*+border-radius:4px;*/ + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + -khtml-border-radius: 4px; + border-radius: 4px 4px 4px 4px; } div.list-view div.toolbar div.section-switcher div.section-select label { @@ -2314,6 +2322,7 @@ div.toolbar div.filters select { -khtml-border-radius: 4px; border-radius: 4px 4px 4px 4px; padding: 0px 0 0; + margin: 1px 0 0; } #breadcrumbs { From 363aea4aee1fc58c270e057c1b30b705ddabf348 Mon Sep 17 00:00:00 2001 From: frank Date: Thu, 22 Dec 2011 14:36:17 -0800 Subject: [PATCH 26/38] Bug 12731 - Ebtable rules are blocking all traffic going out of VMs in basic zone status 12731: resolved fixed reviewed-by: edison --- scripts/vm/hypervisor/xenserver/vmops | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/vm/hypervisor/xenserver/vmops b/scripts/vm/hypervisor/xenserver/vmops index c0d2b6f91d1..44838ad2cbf 100755 --- a/scripts/vm/hypervisor/xenserver/vmops +++ b/scripts/vm/hypervisor/xenserver/vmops @@ -430,8 +430,6 @@ def default_ebtables_rules(): util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv6', '-j', 'DROP']) # deny vlan util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', '802_1Q', '-j', 'DROP']) - # deny all other 802. frames - util.pread2(['ebtables', '-A', 'FORWARD', '-j', 'DROP']) except: util.SMlog('Chain DEFAULT_EBTABLES already exists') From c7ac604c8a7478ce90f99d0316d54db552b02529 Mon Sep 17 00:00:00 2001 From: frank Date: Thu, 22 Dec 2011 15:06:03 -0800 Subject: [PATCH 27/38] Bug 12736 - missing dependency when installing mgt server on rhel 6.1 status 12736: resolved fixed reviewed-by: edison --- cloud.spec | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/cloud.spec b/cloud.spec index 210673adb92..f65f50d6c2f 100644 --- a/cloud.spec +++ b/cloud.spec @@ -24,10 +24,6 @@ BuildRoot: %{_tmppath}/%{name}-%{_ver}-%{release}-build BuildRequires: java-1.6.0-openjdk-devel BuildRequires: tomcat6 BuildRequires: ws-commons-util -#BuildRequires: commons-codec -#BuildRequires: commons-dbcp -#BuildRequires: commons-collections -BuildRequires: commons-httpclient BuildRequires: jpackage-utils BuildRequires: gcc BuildRequires: glibc-devel @@ -148,7 +144,6 @@ Requires: %{name}-python = %{version} # Requires: %{name}-agent Requires: tomcat6 Requires: ws-commons-util -#Requires: commons-codec Requires: jpackage-utils Requires: sudo Requires: /sbin/service @@ -165,12 +160,6 @@ Requires: apache-commons-collections Requires: jakarta-commons-httpclient %endif -%if 0%{?rhel} >= 5 -Requires: commons-dbcp -Requires: commons-collection -Requires: commons-httpclient -%endif - Group: System Environment/Libraries %description client The Cloud.com management server is the central point of coordination, @@ -272,11 +261,7 @@ Requires: java >= 1.6.0 Requires: %{name}-utils = %{version}, %{name}-core = %{version}, %{name}-deps = %{version}, %{name}-agent-libs = %{version} Requires: python Requires: %{name}-python = %{version} -Requires: commons-httpclient #Requires: commons-codec -Requires: commons-collections -Requires: commons-pool -Requires: commons-dbcp Requires: jakarta-commons-logging Requires: jpackage-utils Requires: %{name}-daemonize From 0c3c7d1b34bd008d1dd9c20b3f6373387edeeb03 Mon Sep 17 00:00:00 2001 From: bfederle Date: Thu, 22 Dec 2011 15:10:39 -0800 Subject: [PATCH 28/38] bug 12610 Add close button to user management tab of projects wizard status 12610: resolved fixed --- ui/scripts/ui-custom/projects.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ui/scripts/ui-custom/projects.js b/ui/scripts/ui-custom/projects.js index e992d638ba5..3905a547ce6 100644 --- a/ui/scripts/ui-custom/projects.js +++ b/ui/scripts/ui-custom/projects.js @@ -391,9 +391,16 @@ $('.ui-dialog, .overlay').remove(); }); + $laterButton.click(function() { + $(':ui-dialog, .overlay').remove(); + + return false; + }); + return $review; }); }); + $laterButton.html('Close').appendTo($userManagement); return $userManagement; }); From e66af621f1ffb5092e4ba406c13f624cb579adac Mon Sep 17 00:00:00 2001 From: bfederle Date: Thu, 22 Dec 2011 15:15:12 -0800 Subject: [PATCH 29/38] bug 12595 Only allow change service offering for stopped VMs status 12595: resolved fixed --- ui/scripts/instances.js | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js index 776c77d6f4a..ccc6348a81e 100644 --- a/ui/scripts/instances.js +++ b/ui/scripts/instances.js @@ -1648,7 +1648,6 @@ allowedActions.push("detachISO"); allowedActions.push("resetPassword"); - allowedActions.push("changeService"); if(jsonObj.hypervisor == "BareMetal") { allowedActions.push("createTemplate"); From ec7ace2a2c9a195c379720f740db0fa214e05ce8 Mon Sep 17 00:00:00 2001 From: bfederle Date: Thu, 22 Dec 2011 15:25:55 -0800 Subject: [PATCH 30/38] bug 12573: Correct error handling for add volume status 12573: resolved fixed --- ui/scripts/storage.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js index 68cf55e0dcb..4d852c2866b 100644 --- a/ui/scripts/storage.js +++ b/ui/scripts/storage.js @@ -142,6 +142,9 @@ } } ); + }, + error: function(json) { + args.response.error(parseXMLHttpResponse(json)); } }); }, From 6b60341ea43ad080690e2e7165e37be07388aafa Mon Sep 17 00:00:00 2001 From: bfederle Date: Thu, 22 Dec 2011 15:30:27 -0800 Subject: [PATCH 31/38] Add correct error handling to VM wizard --- ui/scripts/instances.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js index ccc6348a81e..3bf0f01dc34 100644 --- a/ui/scripts/instances.js +++ b/ui/scripts/instances.js @@ -392,7 +392,7 @@ error: function(XMLHttpResponse) { isCreateNetworkSuccessful = false; var errorMsg = "Failed to create new network, unable to proceed to deploy VM. Error: " + parseXMLHttpResponse(XMLHttpResponse); - alert(errorMsg); + //alert(errorMsg); args.response.error(errorMsg); //args.response.error(errorMsg) here doesn't show errorMsg. Waiting for Brian to fix it. use alert(errorMsg) to show errorMsg for now. } }); @@ -460,8 +460,7 @@ ); }, error: function(XMLHttpResponse) { - //args.response.error(); //wait for Brian to implement - alert("Failed to deploy VM."); + args.response.error(parseXMLHttpResponse(XMLHttpResponse)); //wait for Brian to implement } }); } From 46ebc1e032a37d17d3a1fe3450b0d41346473450 Mon Sep 17 00:00:00 2001 From: bfederle Date: Thu, 22 Dec 2011 15:35:55 -0800 Subject: [PATCH 32/38] List view, error handling Fix list view error handling, where addRow == 'true' but no createForm is present -- properly remove row --- ui/scripts/ui/widgets/listView.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/scripts/ui/widgets/listView.js b/ui/scripts/ui/widgets/listView.js index c41a3f3f907..b5c029f3a3f 100644 --- a/ui/scripts/ui/widgets/listView.js +++ b/ui/scripts/ui/widgets/listView.js @@ -186,8 +186,8 @@ ); }, error: function(message) { - if ($.isPlainObject(args.action.createForm) - && args.action.addRow != 'false') { + if (($.isPlainObject(args.action.createForm) && args.action.addRow != 'false') || + (!args.action.createForm && args.action.addRow == 'true')) { $instanceRow.remove(); } From c429a663061c9740febb61e32a5385a89c26d8ba Mon Sep 17 00:00:00 2001 From: bfederle Date: Thu, 22 Dec 2011 15:36:18 -0800 Subject: [PATCH 33/38] bug 12569: Correct error handling for acquire IP address status 12569: resolved fixed --- 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 1b9d5cf78b3..bd7d476ac49 100644 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -530,8 +530,8 @@ }); }, - error: function(data) { - args.response.error(parseXMLHttpResponse(data)); + error: function(json) { + args.response.error(parseXMLHttpResponse(json)); } }); }, From deef431cc708c4ada32e80258512774356e30237 Mon Sep 17 00:00:00 2001 From: bfederle Date: Thu, 22 Dec 2011 15:39:11 -0800 Subject: [PATCH 34/38] bug 12569 Disable system navigation item when in project mode --- ui/scripts/ui/core.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/scripts/ui/core.js b/ui/scripts/ui/core.js index f9be4e10ca9..961cd50cb7f 100644 --- a/ui/scripts/ui/core.js +++ b/ui/scripts/ui/core.js @@ -123,6 +123,7 @@ var $target = $(event.target); var $projectSwitcher = $(this); var $container = $('html body'); + var $navDisabled = $('#navigation li.projects, #navigation li.system'); if ($target.closest('.select.project-view').size()) { $('#cloudStack3-container').addClass('project-view'); @@ -131,14 +132,14 @@ .siblings().removeClass('active'); // Activate project view - $('#navigation li.projects').addClass('disabled').attr({ - title: 'Projects can only be edited outside of project view.' + $navDisabled.addClass('disabled').attr({ + title: 'Projects and system resources can only be edited outside of project view.' }); cloudStack.uiCustom.projects({ $projectSelect: $projectSelect.hide().find('select') }); } else { - $('#navigation li.projects').removeClass('disabled').attr('title', ''); + $navDisabled.removeClass('disabled').attr('title', ''); $('#cloudStack3-container').removeClass('project-view'); $projectSwitcher.removeClass('alt'); $projectSelect.hide(); From aac2ce7cd94f0e5033983cac5d24c09e3c11f405 Mon Sep 17 00:00:00 2001 From: bfederle Date: Thu, 22 Dec 2011 15:47:37 -0800 Subject: [PATCH 35/38] bug 12520 Hide specific sections when in project view: -Projects (list view) -Accounts -Domains -System -Global Settings -Configuration status 12520: resolved fixed --- ui/scripts/cloudStack.js | 6 +++--- ui/scripts/ui/core.js | 19 ++++++++++++++----- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js index 100973cac4f..465485e2c3b 100644 --- a/ui/scripts/cloudStack.js +++ b/ui/scripts/cloudStack.js @@ -23,9 +23,9 @@ storage: {}, network: {}, templates: {}, + events: {}, accounts: {}, domains: {}, - events: {}, system: {}, projects: {}, 'global-settings': {}, @@ -92,9 +92,9 @@ dataType: "json", async: false, success: function(json) { - /* g_supportELB: "guest" เฅ†เค†ˆ€” ips are allocated on guest network (so use 'forvirtualnetwork' = false) + /* g_supportELB: "guest" เฅ†เค††เฅ†เค…†ˆ€” ips are allocated on guest network (so use 'forvirtualnetwork' = false) * g_supportELB: "public" - ips are allocated on public network (so use 'forvirtualnetwork' = true) - * g_supportELB: "false" เฅ†เค†ˆ€“ no ELB support + * g_supportELB: "false" เฅ†เค††เฅ†เค…†ˆ€“ no ELB support */ g_capabilities = json.listcapabilitiesresponse.capability; g_supportELB = json.listcapabilitiesresponse.capability.supportELB.toString(); //convert boolean to string if it's boolean diff --git a/ui/scripts/ui/core.js b/ui/scripts/ui/core.js index 961cd50cb7f..ba3efa2c7e5 100644 --- a/ui/scripts/ui/core.js +++ b/ui/scripts/ui/core.js @@ -123,7 +123,18 @@ var $target = $(event.target); var $projectSwitcher = $(this); var $container = $('html body'); - var $navDisabled = $('#navigation li.projects, #navigation li.system'); + var $navDisabled = $( + $.map([ + 'projects', + 'accounts', + 'domains', + 'system', + 'global-settings', + 'configuration' + ], function(id) { + return '#navigation li.' + id; + }).join(',') + ); if ($target.closest('.select.project-view').size()) { $('#cloudStack3-container').addClass('project-view'); @@ -132,14 +143,12 @@ .siblings().removeClass('active'); // Activate project view - $navDisabled.addClass('disabled').attr({ - title: 'Projects and system resources can only be edited outside of project view.' - }); + $navDisabled.hide(); cloudStack.uiCustom.projects({ $projectSelect: $projectSelect.hide().find('select') }); } else { - $navDisabled.removeClass('disabled').attr('title', ''); + $navDisabled.show(); $('#cloudStack3-container').removeClass('project-view'); $projectSwitcher.removeClass('alt'); $projectSelect.hide(); From 0a8606f47c0f3fea59cae58679395d51296f7f0b Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Thu, 22 Dec 2011 16:33:54 -0800 Subject: [PATCH 36/38] cloudstack 3.0 new UI - Add Network Offering - add new checkbox "Redundant router capability" --- ui/scripts/configuration.js | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js index 354ccef682c..8d3f8776494 100644 --- a/ui/scripts/configuration.js +++ b/ui/scripts/configuration.js @@ -969,18 +969,24 @@ action: function(args) { var formData = args.data; var inputData = {}; - var services = {}; + var serviceProviderMap = {}; + var serviceCapabilityMap = {}; $.each(formData, function(key, value) { var serviceData = key.split('.'); - if (serviceData.length > 1) { + if (serviceData.length > 1) { if (serviceData[0] == 'service' && serviceData[2] == 'isEnabled' && value == 'on') { // Services field - services[serviceData[1]] = formData[ + serviceProviderMap[serviceData[1]] = formData[ 'service.' + serviceData[1] + '.provider' ]; + } + else if (serviceData[0] == 'service' && + serviceData[2].indexOf('Capability') != -1 && + value == 'on') { // Services field + serviceCapabilityMap[serviceData[1]] = serviceData[2]; } } else if (value != '') { // Normal data inputData[key] = value; @@ -988,7 +994,7 @@ }); // Make supported services list - inputData['supportedServices'] = $.map(services, function(value, key) { + inputData['supportedServices'] = $.map(serviceProviderMap, function(value, key) { return key; }).join(','); @@ -1000,12 +1006,25 @@ // Make service provider map var serviceProviderIndex = 0; - $.each(services, function(key, value) { + $.each(serviceProviderMap, function(key, value) { inputData['serviceProviderList[' + serviceProviderIndex + '].service'] = key; inputData['serviceProviderList[' + serviceProviderIndex + '].provider'] = value; serviceProviderIndex++; }); - + + var serviceCapabilityIndex = 0; + $.each(serviceCapabilityMap, function(key, value) { + var capabilityType = null; + if(value == "redundantRouterCapability") + capabilityType = "RedundantRouter"; + if(capabilityType != null) { + inputData['serviceCapabilityList[' + serviceCapabilityIndex + '].service'] = key; + inputData['serviceCapabilityList[' + serviceCapabilityIndex + '].capabilitytype'] = capabilityType; + inputData['serviceCapabilityList[' + serviceCapabilityIndex + '].capabilityvalue'] = true; + serviceCapabilityIndex++; + } + }); + $.ajax({ url: createURL('createNetworkOffering'), data: inputData, @@ -1153,6 +1172,11 @@ }); } }, + + "service.SourceNat.redundantRouterCapability" : { + label: "Redundant router capability", + isBoolean: true + }, tags: { label: 'Tags' } } From 14d6c85176a7bca7307f041f96e526173181bcab Mon Sep 17 00:00:00 2001 From: Sheng Yang Date: Wed, 21 Dec 2011 17:31:08 -0800 Subject: [PATCH 37/38] bug 12727: Add arping to update the vSwitch cache We need to broadcast all our public IP address's ARP, not only the gateway one. status 12727: resolved fixed --- .../debian/config/etc/init.d/cloud-early-config | 2 ++ .../root/redundant_router/arping_gateways.sh.templ | 10 ++++++++++ .../config/root/redundant_router/master.sh.templ | 4 +--- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 patches/systemvm/debian/config/root/redundant_router/arping_gateways.sh.templ diff --git a/patches/systemvm/debian/config/etc/init.d/cloud-early-config b/patches/systemvm/debian/config/etc/init.d/cloud-early-config index 32a43dfa76c..580ab149c5e 100755 --- a/patches/systemvm/debian/config/etc/init.d/cloud-early-config +++ b/patches/systemvm/debian/config/etc/init.d/cloud-early-config @@ -418,6 +418,7 @@ setup_redundant_router() { cp /root/redundant_router/primary-backup.sh.templ $rrouter_bin_path/primary-backup.sh cp /root/redundant_router/heartbeat.sh.templ $rrouter_bin_path/heartbeat.sh cp /root/redundant_router/check_heartbeat.sh.templ $rrouter_bin_path/check_heartbeat.sh + cp /root/redundant_router/arping_gateways.sh.templ $rrouter_bin_path/arping_gateways.sh cp /root/redundant_router/check_bumpup.sh $rrouter_bin_path/ cp /root/redundant_router/disable_pubip.sh $rrouter_bin_path/ cp /root/redundant_router/checkrouter.sh.templ /root/checkrouter.sh @@ -446,6 +447,7 @@ setup_redundant_router() { sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" $rrouter_bin_path/fault.sh sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" $rrouter_bin_path/primary-backup.sh sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" $rrouter_bin_path/check_heartbeat.sh + sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" $rrouter_bin_path/arping_gateways.sh sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" /root/checkrouter.sh chmod a+x $rrouter_bin_path/*.sh diff --git a/patches/systemvm/debian/config/root/redundant_router/arping_gateways.sh.templ b/patches/systemvm/debian/config/root/redundant_router/arping_gateways.sh.templ new file mode 100644 index 00000000000..80f7f030dcb --- /dev/null +++ b/patches/systemvm/debian/config/root/redundant_router/arping_gateways.sh.templ @@ -0,0 +1,10 @@ +ip link|grep BROADCAST|grep -v eth0|grep -v eth1|cut -d ":" -f 2 > /tmp/iflist +while read i +do + ip addr show $i|grep "inet " > /tmp/iplist_$i + while read line + do + ip=`echo $line|cut -d " " -f 2|cut -d "/" -f 1` + arping -I $i -A $ip -c 2 >> [RROUTER_LOG] 2>&1 + done < /tmp/iplist_$i +done < /tmp/iflist diff --git a/patches/systemvm/debian/config/root/redundant_router/master.sh.templ b/patches/systemvm/debian/config/root/redundant_router/master.sh.templ index d935ea85b90..3c07f3ef860 100644 --- a/patches/systemvm/debian/config/root/redundant_router/master.sh.templ +++ b/patches/systemvm/debian/config/root/redundant_router/master.sh.templ @@ -31,9 +31,7 @@ if [ $ret -ne 0 ] then echo Fail to switch conntrackd mode, but try to continue working >> [RROUTER_LOG] fi -ping -n -c 3 [GATEWAY] >> [RROUTER_LOG] 2>&1 & -sleep 3 -pkill ping +[RROUTER_BIN_PATH]/arping_gateways.sh echo Status: MASTER >> [RROUTER_LOG] releaseLockFile $lock $locked From d462e14e013874169d94fbad166f96319f8316e1 Mon Sep 17 00:00:00 2001 From: anthony Date: Thu, 22 Dec 2011 17:52:33 -0800 Subject: [PATCH 38/38] SWIFT : remove template_zone_ref when delete template --- .../cloud/storage/dao/VMTemplateZoneDao.java | 2 +- .../storage/dao/VMTemplateZoneDaoImpl.java | 8 +++--- .../cloud/template/TemplateManagerImpl.java | 25 ++++++++++++++++--- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/server/src/com/cloud/storage/dao/VMTemplateZoneDao.java b/server/src/com/cloud/storage/dao/VMTemplateZoneDao.java index a064cbbc421..3b6b7b9bfa6 100755 --- a/server/src/com/cloud/storage/dao/VMTemplateZoneDao.java +++ b/server/src/com/cloud/storage/dao/VMTemplateZoneDao.java @@ -30,6 +30,6 @@ public interface VMTemplateZoneDao extends GenericDao { public VMTemplateZoneVO findByZoneTemplate(long zoneId, long templateId); - public List listByZoneTemplate(long zoneId, long templateId); + public List listByZoneTemplate(Long zoneId, long templateId); } diff --git a/server/src/com/cloud/storage/dao/VMTemplateZoneDaoImpl.java b/server/src/com/cloud/storage/dao/VMTemplateZoneDaoImpl.java index 9e1d323f0ea..b72975ca6a8 100644 --- a/server/src/com/cloud/storage/dao/VMTemplateZoneDaoImpl.java +++ b/server/src/com/cloud/storage/dao/VMTemplateZoneDaoImpl.java @@ -77,9 +77,11 @@ public class VMTemplateZoneDaoImpl extends GenericDaoBase listByZoneTemplate(long zoneId, long templateId) { - SearchCriteria sc = ZoneTemplateSearch.create(); - sc.setParameters("zone_id", zoneId); + public List listByZoneTemplate(Long zoneId, long templateId) { + SearchCriteria sc = ZoneTemplateSearch.create(); + if (zoneId != null) { + sc.setParameters("zone_id", zoneId); + } sc.setParameters("template_id", templateId); return listBy(sc); } diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java b/server/src/com/cloud/template/TemplateManagerImpl.java index bd9cb3cebc6..bea8cc0c321 100755 --- a/server/src/com/cloud/template/TemplateManagerImpl.java +++ b/server/src/com/cloud/template/TemplateManagerImpl.java @@ -95,6 +95,7 @@ import com.cloud.storage.VMTemplateStorageResourceAssoc; import com.cloud.storage.VMTemplateStorageResourceAssoc.Status; import com.cloud.storage.VMTemplateSwiftVO; import com.cloud.storage.VMTemplateVO; +import com.cloud.storage.VMTemplateZoneVO; import com.cloud.storage.VolumeVO; import com.cloud.storage.dao.SnapshotDao; import com.cloud.storage.dao.StoragePoolDao; @@ -1160,6 +1161,14 @@ public class TemplateManagerImpl implements TemplateManager, Manager, TemplateSe boolean result = adapter.delete(profile); if (result){ + if (cmd.getZoneId() == null && _swiftMgr.isSwiftEnabled()) { + List templateZones = _tmpltZoneDao.listByZoneTemplate(null, templateId); + if (templateZones != null) { + for (VMTemplateZoneVO templateZone : templateZones) { + _tmpltZoneDao.remove(templateZone.getId()); + } + } + } return true; }else{ throw new CloudRuntimeException("Failed to delete template"); @@ -1191,10 +1200,18 @@ public class TemplateManagerImpl implements TemplateManager, Manager, TemplateSe } TemplateAdapter adapter = getAdapter(template.getHypervisorType()); TemplateProfile profile = adapter.prepareDelete(cmd); - boolean result = adapter.delete(profile); - if (result){ - return true; - }else{ + boolean result = adapter.delete(profile); + if (result) { + if (cmd.getZoneId() == null && _swiftMgr.isSwiftEnabled()) { + List templateZones = _tmpltZoneDao.listByZoneTemplate(null, templateId); + if (templateZones != null) { + for (VMTemplateZoneVO templateZone : templateZones) { + _tmpltZoneDao.remove(templateZone.getId()); + } + } + } + return true; + } else { throw new CloudRuntimeException("Failed to delete ISO"); } }