From db3b75bda06c0ccdf1451df0628c73d18fe22473 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 30 Nov 2010 11:03:58 -0800 Subject: [PATCH 01/17] API has changed to return all if pagesize is not specified. Here is corresponding UI change. --- ui/scripts/cloud.core.dashboard.js | 4 ++-- ui/scripts/cloud.core.domain.js | 4 ++-- ui/scripts/cloud.core.globalsetting.js | 2 +- ui/scripts/cloud.core.host.js | 2 +- ui/scripts/cloud.core.instance.js | 4 ++-- ui/scripts/cloud.core.ipaddress.js | 2 +- ui/scripts/cloud.core.js | 8 ++++---- ui/scripts/cloud.core.resource.js | 10 +++++----- ui/scripts/cloud.core.template.js | 8 ++++---- ui/scripts/cloud.core.volume.js | 6 +++--- ui/scripts/cloud.core.zone.js | 2 +- 11 files changed, 26 insertions(+), 26 deletions(-) diff --git a/ui/scripts/cloud.core.dashboard.js b/ui/scripts/cloud.core.dashboard.js index 04fe8d0ec52..b4f0cd2e4e3 100644 --- a/ui/scripts/cloud.core.dashboard.js +++ b/ui/scripts/cloud.core.dashboard.js @@ -30,7 +30,7 @@ function afterLoadDashboardJSP() { //$("#menutab_dashboard_root, #menutab_vm, #menutab_networking_old, #menutab_networking, #menutab_templates, #menutab_events, #menutab_hosts, #menutab_storage, #menutab_accounts, #menutab_domain").hide(); $.ajax({ - data: createURL("command=listZones&available=true"+maxPageSize), + data: createURL("command=listZones&available=true"), dataType: "json", async: false, success: function(json) { @@ -165,7 +165,7 @@ function afterLoadDashboardJSP() { $thisSection.find("#capacity_zone_select").bind("change", function(event) { var zoneId = $(this).val(); $.ajax({ - data: createURL("command=listPods&zoneId="+zoneId+maxPageSize), + data: createURL("command=listPods&zoneId="+zoneId), dataType: "json", async: false, success: function(json) { diff --git a/ui/scripts/cloud.core.domain.js b/ui/scripts/cloud.core.domain.js index 7803e233d82..e90a2d972c8 100644 --- a/ui/scripts/cloud.core.domain.js +++ b/ui/scripts/cloud.core.domain.js @@ -142,7 +142,7 @@ function domainToRightPanel2($leftmenuItem1) { $.ajax({ cache: false, - data: createURL("command=listAccounts&domainid="+domainId+maxPageSize), + data: createURL("command=listAccounts&domainid="+domainId), dataType: "json", success: function(json) { var accounts = json.listaccountsresponse.account; @@ -298,7 +298,7 @@ function listAdminAccounts(domainId) { var accountType = (domainId==1)? 1: 2; $.ajax({ cache: false, - data: createURL("command=listAccounts&domainid="+domainId+"&accounttype="+accountType+maxPageSize), + data: createURL("command=listAccounts&domainid="+domainId+"&accounttype="+accountType), dataType: "json", success: function(json) { var items = json.listaccountsresponse.account; diff --git a/ui/scripts/cloud.core.globalsetting.js b/ui/scripts/cloud.core.globalsetting.js index 11a887cc47e..81de6446ad1 100644 --- a/ui/scripts/cloud.core.globalsetting.js +++ b/ui/scripts/cloud.core.globalsetting.js @@ -39,7 +39,7 @@ function populateGlobalSettingGrid() { $thisTab.find("#tab_spinning_wheel").show(); $.ajax({ - data: createURL("command=listConfigurations"+maxPageSize), + data: createURL("command=listConfigurations"), dataType: "json", success: function(json) { var items = json.listconfigurationsresponse.configuration; diff --git a/ui/scripts/cloud.core.host.js b/ui/scripts/cloud.core.host.js index bcec4b42778..13d3c038eb1 100644 --- a/ui/scripts/cloud.core.host.js +++ b/ui/scripts/cloud.core.host.js @@ -370,7 +370,7 @@ function hostClearDetailsTab() { function populateForUpdateOSDialog(oscategoryid) { $.ajax({ - data: createURL("command=listOsCategories"+maxPageSize), + data: createURL("command=listOsCategories"), dataType: "json", success: function(json) { var categories = json.listoscategoriesresponse.oscategory; diff --git a/ui/scripts/cloud.core.instance.js b/ui/scripts/cloud.core.instance.js index 4256b3bee79..8ee469ea77f 100644 --- a/ui/scripts/cloud.core.instance.js +++ b/ui/scripts/cloud.core.instance.js @@ -1422,7 +1422,7 @@ function vmJsonToVolumeTab() { $.ajax({ cache: false, - data: createURL("command=listVolumes&virtualMachineId="+jsonObj.id+maxPageSize), + data: createURL("command=listVolumes&virtualMachineId="+jsonObj.id), dataType: "json", success: function(json) { var items = json.listvolumesresponse.volume; @@ -1487,7 +1487,7 @@ function vmJsonToRouterTab() { $.ajax({ cache: false, - data: createURL("command=listRouters&domainid="+vmObj.domainid+"&account="+vmObj.account+maxPageSize), + data: createURL("command=listRouters&domainid="+vmObj.domainid+"&account="+vmObj.account), dataType: "json", success: function(json) { var items = json.listroutersresponse.router; diff --git a/ui/scripts/cloud.core.ipaddress.js b/ui/scripts/cloud.core.ipaddress.js index 5ed27be564f..77d88766ac5 100644 --- a/ui/scripts/cloud.core.ipaddress.js +++ b/ui/scripts/cloud.core.ipaddress.js @@ -35,7 +35,7 @@ function afterLoadIpJSP() { //*** Acquire New IP (begin) *** $.ajax({ - data: createURL("command=listZones&available=true"+maxPageSize), + data: createURL("command=listZones&available=true"), dataType: "json", success: function(json) { var zones = json.listzonesresponse.zone; diff --git a/ui/scripts/cloud.core.js b/ui/scripts/cloud.core.js index aa0637821d1..1fceeae5a1b 100644 --- a/ui/scripts/cloud.core.js +++ b/ui/scripts/cloud.core.js @@ -1457,7 +1457,7 @@ function submenuContentEventBinder(submenuContent, listFunction) { var zoneSelect = submenuContent.find("#advanced_search #adv_search_zone"); if(zoneSelect.length>0) { //if zone dropdown is found on Advanced Search dialog $.ajax({ - data: createURL("command=listZones&available=true&response=json"+maxPageSize), + data: createURL("command=listZones&available=true&response=json"), dataType: "json", success: function(json) { var zones = json.listzonesresponse.zone; @@ -1484,7 +1484,7 @@ function submenuContentEventBinder(submenuContent, listFunction) { podLabel.css("color", "black"); podSelect.removeAttr("disabled"); $.ajax({ - data: createURL("command=listPods&zoneId="+zoneId+"&response=json"+maxPageSize), + data: createURL("command=listPods&zoneId="+zoneId+"&response=json"), dataType: "json", async: false, success: function(json) { @@ -1509,7 +1509,7 @@ function submenuContentEventBinder(submenuContent, listFunction) { if(domainSelect.length>0 && isAdmin()) { var domainSelect = domainSelect.empty(); $.ajax({ - data: createURL("command=listDomains&available=true&response=json"+maxPageSize), + data: createURL("command=listDomains&available=true&response=json"), dataType: "json", success: function(json) { var domains = json.listdomainsresponse.domain; @@ -1527,7 +1527,7 @@ function submenuContentEventBinder(submenuContent, listFunction) { vmSelect.empty(); vmSelect.append(""); $.ajax({ - data: createURL("command=listVirtualMachines&response=json"+maxPageSize), + data: createURL("command=listVirtualMachines&response=json"), dataType: "json", success: function(json) { var items = json.listvirtualmachinesresponse.virtualmachine; diff --git a/ui/scripts/cloud.core.resource.js b/ui/scripts/cloud.core.resource.js index 92f8017f429..f668874295c 100644 --- a/ui/scripts/cloud.core.resource.js +++ b/ui/scripts/cloud.core.resource.js @@ -22,7 +22,7 @@ function buildZoneTree() { var $zoneTree = $("#leftmenu_zone_tree").find("#tree_container").hide(); $.ajax({ - data: createURL("command=listZones&available=true"+maxPageSize), + data: createURL("command=listZones&available=true"), dataType: "json", success: function(json) { var items = json.listzonesresponse.zone; @@ -55,7 +55,7 @@ function buildZoneTree() { $zoneContent.show(); $.ajax({ - data: createURL("command=listPods&zoneid="+zoneObj.id+maxPageSize), + data: createURL("command=listPods&zoneid="+zoneObj.id), dataType: "json", async: false, success: function(json) { @@ -126,7 +126,7 @@ function buildZoneTree() { function refreshClusterUnderPod($podNode, newClusterName, existingClusterId, noClicking) { var podId = $podNode.data("podId"); $.ajax({ - data: createURL("command=listClusters&podid="+podId+maxPageSize), + data: createURL("command=listClusters&podid="+podId), dataType: "json", async: false, success: function(json) { @@ -176,7 +176,7 @@ function zoneJSONToTreeNode(json, $zoneNode) { zoneName.data("jsonObj", json); $.ajax({ - data: createURL("command=listPods&zoneid="+zoneid+maxPageSize), + data: createURL("command=listPods&zoneid="+zoneid), dataType: "json", async: false, success: function(json) { @@ -624,7 +624,7 @@ function initAddZoneWizard() { var domainDropdown = $addZoneWizard.find("#domain_dropdown").empty(); $.ajax({ - data: createURL("command=listDomains"+maxPageSize), + data: createURL("command=listDomains"), dataType: "json", async: false, success: function(json) { diff --git a/ui/scripts/cloud.core.template.js b/ui/scripts/cloud.core.template.js index 510cba5cdbd..10c3287d983 100644 --- a/ui/scripts/cloud.core.template.js +++ b/ui/scripts/cloud.core.template.js @@ -120,7 +120,7 @@ function afterLoadTemplateJSP() { if (isAdmin()) addTemplateZoneField.append(""); $.ajax({ - data: createURL("command=listZones&available=true"+maxPageSize), + data: createURL("command=listZones&available=true"), dataType: "json", success: function(json) { var zones = json.listzonesresponse.zone; @@ -135,7 +135,7 @@ function afterLoadTemplateJSP() { }); $.ajax({ - data: createURL("command=listOsTypes&response=json"+maxPageSize), + data: createURL("command=listOsTypes&response=json"), dataType: "json", success: function(json) { types = json.listostypesresponse.ostype; @@ -154,7 +154,7 @@ function afterLoadTemplateJSP() { }); $.ajax({ - data: createURL("command=listServiceOfferings&response=json"+maxPageSize), + data: createURL("command=listServiceOfferings&response=json"), dataType: "json", success: function(json) { var items = json.listserviceofferingsresponse.serviceoffering; @@ -167,7 +167,7 @@ function afterLoadTemplateJSP() { }); $.ajax({ - data: createURL("command=listDiskOfferings&response=json"+maxPageSize), + data: createURL("command=listDiskOfferings&response=json"), dataType: "json", success: function(json) { var items = json.listdiskofferingsresponse.diskoffering; diff --git a/ui/scripts/cloud.core.volume.js b/ui/scripts/cloud.core.volume.js index 4cd619c8f09..437b27ac8f6 100644 --- a/ui/scripts/cloud.core.volume.js +++ b/ui/scripts/cloud.core.volume.js @@ -43,7 +43,7 @@ function afterLoadVolumeJSP() { }); $.ajax({ - data: createURL("command=listZones&available=true"+maxPageSize), + data: createURL("command=listZones&available=true"), dataType: "json", success: function(json) { var zones = json.listzonesresponse.zone; @@ -773,7 +773,7 @@ function doRecurringSnapshot($actionLink, $detailsTab, $midmenuItem1) { function populateVirtualMachineField(domainId, account, zoneId) { $.ajax({ cache: false, - data: createURL("command=listVirtualMachines&state=Running&zoneid="+zoneId+"&domainid="+domainId+"&account="+account+maxPageSize), + data: createURL("command=listVirtualMachines&state=Running&zoneid="+zoneId+"&domainid="+domainId+"&account="+account), dataType: "json", success: function(json) { var instances = json.listvirtualmachinesresponse.virtualmachine; @@ -785,7 +785,7 @@ function populateVirtualMachineField(domainId, account, zoneId) { } $.ajax({ cache: false, - data: createURL("command=listVirtualMachines&state=Stopped&zoneid="+zoneId+"&domainid="+domainId+"&account="+account+maxPageSize), + data: createURL("command=listVirtualMachines&state=Stopped&zoneid="+zoneId+"&domainid="+domainId+"&account="+account), dataType: "json", success: function(json) { var instances = json.listvirtualmachinesresponse.virtualmachine; diff --git a/ui/scripts/cloud.core.zone.js b/ui/scripts/cloud.core.zone.js index 99eb1bee2a6..55dd792a50d 100644 --- a/ui/scripts/cloud.core.zone.js +++ b/ui/scripts/cloud.core.zone.js @@ -374,7 +374,7 @@ function initAddVLANButton($button, $leftmenuItem1) { dialogAddVlanForZone.find("#add_publicip_vlan_type_container").show(); var podSelect = dialogAddVlanForZone.find("#add_publicip_vlan_pod").empty(); $.ajax({ - data: createURL("command=listPods&zoneId="+zoneObj.id+maxPageSize), + data: createURL("command=listPods&zoneId="+zoneObj.id), dataType: "json", async: false, success: function(json) { From 17ffde1c17a099c33b983c2318a8c85eeb55aa08 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 30 Nov 2010 11:26:21 -0800 Subject: [PATCH 02/17] API has changed to return all if pagesize is not specified. Here is more corresponding UI change. --- ui/scripts/cloud.core.domain.js | 4 ++-- ui/scripts/cloud.core.instance.js | 2 +- ui/scripts/cloud.core.js | 5 +---- ui/scripts/cloud.core.zone.js | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/ui/scripts/cloud.core.domain.js b/ui/scripts/cloud.core.domain.js index e90a2d972c8..3378bb8fe59 100644 --- a/ui/scripts/cloud.core.domain.js +++ b/ui/scripts/cloud.core.domain.js @@ -34,7 +34,7 @@ function drawRootNode(rootDomainId) { var $domainTree = $("#leftmenu_domain_tree").find("#tree_container").hide(); $.ajax({ - data: createURL("command=listDomains&id="+rootDomainId+"&pageSize=-1"), //pageSize=-1 will return all items (no limitation) + data: createURL("command=listDomains&id="+rootDomainId), dataType: "json", async: false, success: function(json) { @@ -72,7 +72,7 @@ function drawNode(json, level, container) { function drawTree(id, level, container) { $.ajax({ - data: createURL("command=listDomainChildren&id="+id+"&pageSize=-1"), + data: createURL("command=listDomainChildren&id="+id), dataType: "json", async: false, success: function(json) { diff --git a/ui/scripts/cloud.core.instance.js b/ui/scripts/cloud.core.instance.js index 8ee469ea77f..98e3c4fca84 100644 --- a/ui/scripts/cloud.core.instance.js +++ b/ui/scripts/cloud.core.instance.js @@ -1669,7 +1669,7 @@ function appendInstanceGroup(groupId, groupName) { var groupId = $(this).data("groupId"); $.ajax({ cache: false, - data: createURL("command=listVirtualMachines&groupid="+groupId+"&pagesize="+midmenuItemCount), + data: createURL("command=listVirtualMachines&groupid="+groupId+"&pagesize="+midmenuItemCount+"&page=1"), dataType: "json", success: function(json) { var instances = json.listvirtualmachinesresponse.virtualmachine; diff --git a/ui/scripts/cloud.core.js b/ui/scripts/cloud.core.js index 1fceeae5a1b..e62228974e4 100644 --- a/ui/scripts/cloud.core.js +++ b/ui/scripts/cloud.core.js @@ -937,7 +937,7 @@ function listMidMenuItems2(commandString, jsonResponse1, jsonResponse2, toMidmen var count = 0; $.ajax({ cache: false, - data: createURL("command="+commandString+"&pagesize="+midmenuItemCount), + data: createURL("command="+commandString+"&pagesize="+midmenuItemCount+"&page=1"), dataType: "json", async: false, success: function(json) { @@ -1150,9 +1150,6 @@ function getSystemVmUseLocalStorage() { return g_systemVmUseLocalStorage; } //keyboard keycode var keycode_Enter = 13; -//dropdown field size -var maxPageSize = "&pagesize=500"; - //XMLHttpResponse.status var ERROR_ACCESS_DENIED_DUE_TO_UNAUTHORIZED = 401; var ERROR_INTERNET_NAME_NOT_RESOLVED = 12007; diff --git a/ui/scripts/cloud.core.zone.js b/ui/scripts/cloud.core.zone.js index 55dd792a50d..70f9bcb4ceb 100644 --- a/ui/scripts/cloud.core.zone.js +++ b/ui/scripts/cloud.core.zone.js @@ -395,7 +395,7 @@ function initAddVLANButton($button, $leftmenuItem1) { function populateDomainDropdown(id) { $.ajax({ - data: createURL("command=listDomainChildren&id="+id+"&pageSize=-1"), + data: createURL("command=listDomainChildren&id="+id), dataType: "json", async: false, success: function(json) { From 680812f67594304ed235c90146742933f61c9687 Mon Sep 17 00:00:00 2001 From: alena Date: Tue, 30 Nov 2010 10:36:16 -0800 Subject: [PATCH 03/17] bug 7223: page and pagesize parameters must be specified together "list" api commands status 7223: resolved fixed --- server/src/com/cloud/api/ApiDispatcher.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/src/com/cloud/api/ApiDispatcher.java b/server/src/com/cloud/api/ApiDispatcher.java index 1ba61a4d6c4..c55d5642691 100644 --- a/server/src/com/cloud/api/ApiDispatcher.java +++ b/server/src/com/cloud/api/ApiDispatcher.java @@ -143,6 +143,14 @@ public class ApiDispatcher { public static void setupParameters(BaseCmd cmd, Map params){ Map unpackedParams = cmd.unpackParams(params); + if (cmd instanceof BaseListCmd) { + if ((unpackedParams.get(ApiConstants.PAGE) == null) && (unpackedParams.get(ApiConstants.PAGE_SIZE) != null)) { + throw new ServerApiException(BaseCmd.PARAM_ERROR, "\"page\" parameter is required when \"pagesize\" is specified"); + } else if ((unpackedParams.get(ApiConstants.PAGE_SIZE) == null) && (unpackedParams.get(ApiConstants.PAGE) != null)) { + throw new ServerApiException(BaseCmd.PARAM_ERROR, "\"pagesize\" parameter is required when \"page\" is specified"); + } + } + Field[] fields = cmd.getClass().getDeclaredFields(); Class superClass = cmd.getClass().getSuperclass(); while (BaseCmd.class.isAssignableFrom(superClass)) { From 06663d47e29e44fbbce8c4d791c49ad4a609b39e Mon Sep 17 00:00:00 2001 From: edison Date: Tue, 30 Nov 2010 11:52:22 -0800 Subject: [PATCH 04/17] fix missing jar files for centos --- wscript_configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wscript_configure b/wscript_configure index 31198361bbd..d941510c5f0 100644 --- a/wscript_configure +++ b/wscript_configure @@ -38,6 +38,8 @@ systemjars = { 'CentOS': ( "tomcat6-servlet-2.5-api.jar", + "tomcat6-jsp-2.1-api-6.0.24.jar", + "tomcat6-el-1.0-api-6.0.24.jar", #"tomcat6/catalina.jar", # all supported distros put the file there ), 'Ubuntu': From de92288e3b405ba67787c90403a7a2952c4b7e7d Mon Sep 17 00:00:00 2001 From: will Date: Tue, 30 Nov 2010 12:19:38 -0800 Subject: [PATCH 05/17] Adding xenserver-5.6.0-1.jar to eclipse classpath and removing 5.5 --- core/.classpath | 2 +- server/.classpath | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/.classpath b/core/.classpath index 1867836084a..f2fff92d833 100644 --- a/core/.classpath +++ b/core/.classpath @@ -38,6 +38,6 @@ - + diff --git a/server/.classpath b/server/.classpath index fe6302cf152..fddc52a165d 100644 --- a/server/.classpath +++ b/server/.classpath @@ -20,6 +20,6 @@ - + From a57b99d72b02f76a9fa5126f7bf93581dcf1e51e Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 30 Nov 2010 13:53:29 -0800 Subject: [PATCH 06/17] host page - implement refresh button. --- ui/scripts/cloud.core.host.js | 13 +++++++++++++ ui/scripts/cloud.core.resource.js | 6 +++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ui/scripts/cloud.core.host.js b/ui/scripts/cloud.core.host.js index 13d3c038eb1..4a8a8aef46c 100644 --- a/ui/scripts/cloud.core.host.js +++ b/ui/scripts/cloud.core.host.js @@ -69,6 +69,19 @@ function hostJsonToDetailsTab() { if(jsonObj == null) return; + $.ajax({ + data: createURL("command=listHosts&id="+jsonObj.id), + dataType: "json", + async: false, + success: function(json) { + var items = json.listhostsresponse.host; + if(items != null && items.length > 0) { + jsonObj = items[0]; + $midmenuItem1.data("jsonObj", jsonObj); + } + } + }); + var $thisTab = $("#right_panel_content #tab_content_details"); $thisTab.find("#tab_container").hide(); $thisTab.find("#tab_spinning_wheel").show(); diff --git a/ui/scripts/cloud.core.resource.js b/ui/scripts/cloud.core.resource.js index f668874295c..9402943d07b 100644 --- a/ui/scripts/cloud.core.resource.js +++ b/ui/scripts/cloud.core.resource.js @@ -238,7 +238,11 @@ function resourceLoadPage(pageToShow, $midmenuItem1) { //$midmenuItem1 is eith }); } else if(pageToShow == "jsp/host.jsp") { - afterLoadHostJSP($midmenuItem1); + afterLoadHostJSP($midmenuItem1); + $(this).data("onRefreshFn", function() { + hostJsonToDetailsTab(); + }); + copyActionInfoFromMidMenuToRightPanel($midmenuItem1); $("#right_panel_content").data("$midmenuItem1", $midmenuItem1); $("#tab_details").click(); From 718e6b6a0c7878468498e00638c767701c7c451a Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 30 Nov 2010 14:11:54 -0800 Subject: [PATCH 07/17] VM wizard - limit template number to be 6 on each page in VM Wizard. --- ui/scripts/cloud.core.instance.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ui/scripts/cloud.core.instance.js b/ui/scripts/cloud.core.instance.js index 98e3c4fca84..c418aa4ad93 100644 --- a/ui/scripts/cloud.core.instance.js +++ b/ui/scripts/cloud.core.instance.js @@ -507,7 +507,7 @@ function initVMWizard() { return false; //event.preventDefault() + event.stopPropagation() }); - var vmPopupStep2PageSize = 11; //max number of templates each page in step2 of New VM wizard is 11 + var vmPopupTemplatePageSize = 6; //max number of templates in VM wizard function listTemplatesInVmPopup() { var zoneId = $vmPopup.find("#wizard_zone").val(); if(zoneId == null || zoneId.length == 0) @@ -520,18 +520,20 @@ function initVMWizard() { if (selectedTemplateTypeInVmPopup != "blank") { //*** template *** templateType = "template"; if (searchInput != null && searchInput.length > 0) - commandString = "command=listTemplates&templatefilter="+selectedTemplateTypeInVmPopup+"&zoneid="+zoneId+"&keyword="+searchInput+"&page="+currentPageInTemplateGridInVmPopup; + commandString = "command=listTemplates&templatefilter="+selectedTemplateTypeInVmPopup+"&zoneid="+zoneId+"&keyword="+searchInput; else - commandString = "command=listTemplates&templatefilter="+selectedTemplateTypeInVmPopup+"&zoneid="+zoneId+"&page="+currentPageInTemplateGridInVmPopup; + commandString = "command=listTemplates&templatefilter="+selectedTemplateTypeInVmPopup+"&zoneid="+zoneId; } else { //*** ISO *** templateType = "ISO"; if (searchInput != null && searchInput.length > 0) - commandString = "command=listIsos&isReady=true&bootable=true&zoneid="+zoneId+"&keyword="+searchInput+"&page="+currentPageInTemplateGridInVmPopup; + commandString = "command=listIsos&isReady=true&bootable=true&zoneid="+zoneId+"&keyword="+searchInput; else - commandString = "command=listIsos&isReady=true&bootable=true&zoneid="+zoneId+"&page="+currentPageInTemplateGridInVmPopup; + commandString = "command=listIsos&isReady=true&bootable=true&zoneid="+zoneId; } - + + commandString += "&pagesize="+vmPopupTemplatePageSize+"&page="+currentPageInTemplateGridInVmPopup; + var loading = $vmPopup.find("#wiz_template_loading").show(); if(currentPageInTemplateGridInVmPopup==1) $vmPopup.find("#prevPage").hide(); @@ -561,7 +563,7 @@ function initVMWizard() { vmWizardTemplateJsonToTemplate(items[i], $newTemplate, templateType, i); container.append($newTemplate.show()); } - if(items.length < vmPopupStep2PageSize) + if(items.length < vmPopupTemplatePageSize) $vmPopup.find("#nextPage").hide(); else $vmPopup.find("#nextPage").show(); From 6b37ae714993615d812b61060e0e6340890143d1 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 30 Nov 2010 15:19:35 -0800 Subject: [PATCH 08/17] Host page - fix a bug that refresh button was not working in Firefox (but was working in IE). --- ui/scripts/cloud.core.resource.js | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/ui/scripts/cloud.core.resource.js b/ui/scripts/cloud.core.resource.js index 9402943d07b..93f5c077a9e 100644 --- a/ui/scripts/cloud.core.resource.js +++ b/ui/scripts/cloud.core.resource.js @@ -216,32 +216,29 @@ function resourceLoadPage(pageToShow, $midmenuItem1) { //$midmenuItem1 is eith if(pageToShow == "jsp/resource.jsp") { afterLoadResourceJSP($midmenuItem1); } - else if(pageToShow == "jsp/zone.jsp") { - afterLoadZoneJSP($midmenuItem1); - + else if(pageToShow == "jsp/zone.jsp") { $(this).data("onRefreshFn", function() { zoneJsonToDetailsTab(); - }); + }); + afterLoadZoneJSP($midmenuItem1); } - else if(pageToShow == "jsp/pod.jsp") { - afterLoadPodJSP($midmenuItem1); - + else if(pageToShow == "jsp/pod.jsp") { $(this).data("onRefreshFn", function() { podJsonToDetailsTab(); }); + afterLoadPodJSP($midmenuItem1); } else if(pageToShow == "jsp/cluster.jsp") { - afterLoadClusterJSP($midmenuItem1); - $(this).data("onRefreshFn", function() { clusterJsonToDetailsTab(); - }); + }); + afterLoadClusterJSP($midmenuItem1); } - else if(pageToShow == "jsp/host.jsp") { - afterLoadHostJSP($midmenuItem1); + else if(pageToShow == "jsp/host.jsp") { $(this).data("onRefreshFn", function() { hostJsonToDetailsTab(); }); + afterLoadHostJSP($midmenuItem1); copyActionInfoFromMidMenuToRightPanel($midmenuItem1); $("#right_panel_content").data("$midmenuItem1", $midmenuItem1); From 88e47322cc3296a7d05df5b0d63f3dd74d7953de Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 30 Nov 2010 15:24:08 -0800 Subject: [PATCH 09/17] primary storage page - implement refresh button. --- ui/scripts/cloud.core.primarystorage.js | 13 +++++++++++++ ui/scripts/cloud.core.resource.js | 3 +++ 2 files changed, 16 insertions(+) diff --git a/ui/scripts/cloud.core.primarystorage.js b/ui/scripts/cloud.core.primarystorage.js index bfb5946fcb9..2a2001e9056 100644 --- a/ui/scripts/cloud.core.primarystorage.js +++ b/ui/scripts/cloud.core.primarystorage.js @@ -60,6 +60,19 @@ function primarystorageJsonToDetailsTab() { if(jsonObj == null) return; + $.ajax({ + data: createURL("command=listStoragePools&id="+jsonObj.id), + dataType: "json", + async: false, + success: function(json) { + var items = json.liststoragepoolsresponse.storagepool; + if(items != null && items.length > 0) { + jsonObj = items[0]; + $midmenuItem1.data("jsonObj", jsonObj); + } + } + }); + var $thisTab = $("#right_panel_content").find("#tab_content_details"); $thisTab.find("#tab_container").hide(); $thisTab.find("#tab_spinning_wheel").show(); diff --git a/ui/scripts/cloud.core.resource.js b/ui/scripts/cloud.core.resource.js index 93f5c077a9e..7430f799eb3 100644 --- a/ui/scripts/cloud.core.resource.js +++ b/ui/scripts/cloud.core.resource.js @@ -245,6 +245,9 @@ function resourceLoadPage(pageToShow, $midmenuItem1) { //$midmenuItem1 is eith $("#tab_details").click(); } else if(pageToShow == "jsp/primarystorage.jsp") { + $(this).data("onRefreshFn", function() { + primarystorageJsonToDetailsTab(); + }); afterLoadPrimaryStorageJSP($midmenuItem1); } }); From 786c5af88143c60093eb934f09d82f0a7a3a52e7 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 30 Nov 2010 15:35:20 -0800 Subject: [PATCH 10/17] pagination - assign element ID to previous button, next button. --- ui/index.jsp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/index.jsp b/ui/index.jsp index 90a0e573522..c60692ba573 100644 --- a/ui/index.jsp +++ b/ui/index.jsp @@ -423,9 +423,9 @@ "); $midmenuContainer.append($container_primarystorage); var $header2 = $("#midmenu_itemheader_with_margin").clone().show(); //with margin on top $header2.find("#name").text("Primary Storage"); $container_primarystorage.append($header2); - listMidMenuItems2(("listStoragePools&clusterid="+clusterId), "liststoragepoolsresponse", "storagepool", primarystorageToMidmenu, primarystorageToRightPanel, primarystorageGetMidmenuId, false, false, $container_primarystorage); + //listMidMenuItems2(("listStoragePools&clusterid="+clusterId), "liststoragepoolsresponse", "storagepool", primarystorageToMidmenu, primarystorageToRightPanel, primarystorageGetMidmenuId, false, 1); + var count = 0; + $.ajax({ + cache: false, + data: createURL("command=listStoragePools&clusterid="+clusterId), + dataType: "json", + async: false, + success: function(json) { + selectedItemsInMidMenu = {}; + var items = json.liststoragepoolsresponse.storagepool; + if(items != null && items.length > 0) { + for(var i=0; i 0) { for(var i=0; i Date: Tue, 30 Nov 2010 17:10:43 -0800 Subject: [PATCH 15/17] pagination - hide previous button on first page. Show next button if next page is available, hide next button otherwise. --- ui/index.jsp | 4 ++-- ui/scripts/cloud.core.js | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/index.jsp b/ui/index.jsp index c60692ba573..de626da15e2 100644 --- a/ui/index.jsp +++ b/ui/index.jsp @@ -423,9 +423,9 @@