From 285e8213fed8b0d6a8afc73b686b99a4fcfe5b4a Mon Sep 17 00:00:00 2001 From: Min Chen Date: Wed, 23 Jan 2013 12:38:37 -0800 Subject: [PATCH 1/3] Add DB index to Alert.last_sent column to speed up listAlertsCmd. --- setup/db/create-schema.sql | 1 + setup/db/db/schema-40to410.sql | 2 ++ 2 files changed, 3 insertions(+) diff --git a/setup/db/create-schema.sql b/setup/db/create-schema.sql index 174f53cd7ba..ead98a588fd 100755 --- a/setup/db/create-schema.sql +++ b/setup/db/create-schema.sql @@ -1332,6 +1332,7 @@ CREATE TABLE `cloud`.`alert` ( `last_sent` DATETIME NULL COMMENT 'Last time the alert was sent', `resolved` DATETIME NULL COMMENT 'when the alert status was resolved (available memory no longer at critical level, etc.)', PRIMARY KEY (`id`), + INDEX `last_sent` (`last_sent` DESC), CONSTRAINT `uc_alert__uuid` UNIQUE (`uuid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/setup/db/db/schema-40to410.sql b/setup/db/db/schema-40to410.sql index 93949b8e4fa..ed4946e54dd 100644 --- a/setup/db/db/schema-40to410.sql +++ b/setup/db/db/schema-40to410.sql @@ -77,6 +77,8 @@ ALTER TABLE `cloud`.`inline_load_balancer_nic_map` DROP COLUMN load_balancer_id; ALTER TABLE upload ADD uuid VARCHAR(40); ALTER TABLE async_job modify job_cmd VARCHAR(255); +ALTER TABLE `cloud`.`alert` ADD INDEX `last_sent` (`last_sent` DESC) ; + -- populate uuid column with db id if uuid is null UPDATE `cloud`.`account` set uuid=id WHERE uuid is NULL; UPDATE `cloud`.`alert` set uuid=id WHERE uuid is NULL; From 8f11f631a4f1b288dc319aefa2c974a832e212d4 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Thu, 24 Jan 2013 16:11:47 -0800 Subject: [PATCH 2/3] Instance wizard: Fix back button state Fix case where select SG step is shown on back, instead of select guest network. --- ui/scripts/ui-custom/instanceWizard.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ui/scripts/ui-custom/instanceWizard.js b/ui/scripts/ui-custom/instanceWizard.js index 67d2a69c968..6e993843562 100644 --- a/ui/scripts/ui-custom/instanceWizard.js +++ b/ui/scripts/ui-custom/instanceWizard.js @@ -860,8 +860,19 @@ // Previous button if ($target.closest('div.button.previous').size()) { - var index = $steps.filter(':visible').index(); - if (index) showStep(index); + var $step = $steps.filter(':visible'); + var $networkStep = $steps.filter('.network'); + var index = $step.index(); + + $networkStep.removeClass('next-use-security-groups'); + + if (index) { + if (index == $steps.size() - 1 && $networkStep.hasClass('next-use-security-groups')) { + showStep(5); + } else { + showStep(index); + } + } return false; } From 17c419ceb4979ebef0cb756ad6ed15e5c95dfbd4 Mon Sep 17 00:00:00 2001 From: Min Chen Date: Fri, 25 Jan 2013 14:18:25 -0800 Subject: [PATCH 3/3] Fix a bug in listHosts that returns wrong zoneId for host. --- server/src/com/cloud/api/query/dao/HostJoinDaoImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/com/cloud/api/query/dao/HostJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/HostJoinDaoImpl.java index e8423836004..13b777aa4b1 100644 --- a/server/src/com/cloud/api/query/dao/HostJoinDaoImpl.java +++ b/server/src/com/cloud/api/query/dao/HostJoinDaoImpl.java @@ -77,7 +77,7 @@ public class HostJoinDaoImpl extends GenericDaoBase implements hostResponse.setCapabilities(host.getCapabilities()); hostResponse.setClusterId(host.getClusterUuid()); hostResponse.setCpuNumber(host.getCpus()); - hostResponse.setZoneId(host.getUuid()); + hostResponse.setZoneId(host.getZoneUuid()); hostResponse.setDisconnectedOn(host.getDisconnectedOn()); hostResponse.setHypervisor(host.getHypervisorType()); hostResponse.setHostType(host.getType());