diff --git a/server/src/com/cloud/api/commands/ListCapacityCmd.java b/server/src/com/cloud/api/commands/ListCapacityCmd.java index e2826cbb113..348318ad3ab 100644 --- a/server/src/com/cloud/api/commands/ListCapacityCmd.java +++ b/server/src/com/cloud/api/commands/ListCapacityCmd.java @@ -44,7 +44,7 @@ import com.cloud.storage.StoragePoolVO; public class ListCapacityCmd extends BaseListCmd { public static final Logger s_logger = Logger.getLogger(ListCapacityCmd.class.getName()); - private static final DecimalFormat s_percentFormat = new DecimalFormat("####.##"); + private static final DecimalFormat s_percentFormat = new DecimalFormat("##.##"); private static final String s_name = "listcapacityresponse"; @@ -120,12 +120,15 @@ public class ListCapacityCmd extends BaseListCmd { capacityResponse.setPodId(summedCapacity.getPodId()); if (summedCapacity.getPodId() > 0) { capacityResponse.setPodName(ApiDBUtils.findPodById(summedCapacity.getPodId()).getName()); + } else { + capacityResponse.setPodName("All"); } } capacityResponse.setZoneId(summedCapacity.getDataCenterId()); capacityResponse.setZoneName(ApiDBUtils.findZoneById(summedCapacity.getDataCenterId()).getName()); if (summedCapacity.getTotalCapacity() != 0) { - capacityResponse.setPercentUsed(s_percentFormat.format(summedCapacity.getUsedCapacity() / summedCapacity.getTotalCapacity())); + float computed = ((float)summedCapacity.getUsedCapacity() / (float)summedCapacity.getTotalCapacity() * 100f); + capacityResponse.setPercentUsed(s_percentFormat.format((float)summedCapacity.getUsedCapacity() / (float)summedCapacity.getTotalCapacity() * 100f)); } else { capacityResponse.setPercentUsed(s_percentFormat.format(0L)); } diff --git a/server/src/com/cloud/api/response/CapacityResponse.java b/server/src/com/cloud/api/response/CapacityResponse.java index 560fb88cda1..4cb5ca5f300 100644 --- a/server/src/com/cloud/api/response/CapacityResponse.java +++ b/server/src/com/cloud/api/response/CapacityResponse.java @@ -39,7 +39,7 @@ public class CapacityResponse extends BaseResponse { @SerializedName("capacityused") @Param(description="the capacity currently in use") private Long capacityUsed; - @SerializedName("capacityTotal") @Param(description="the total capacity available") + @SerializedName("capacitytotal") @Param(description="the total capacity available") private Long capacityTotal; @SerializedName("percentused") @Param(description="the percentage of capacity currently in use") diff --git a/ui/new/jsp/dashboard.jsp b/ui/new/jsp/dashboard.jsp index d920723080e..c0269943858 100644 --- a/ui/new/jsp/dashboard.jsp +++ b/ui/new/jsp/dashboard.jsp @@ -47,7 +47,7 @@
-
+
@@ -68,7 +68,7 @@
-
+
@@ -89,7 +89,7 @@
-
+
@@ -110,7 +110,7 @@
-
+
@@ -131,7 +131,7 @@
-
+
@@ -152,7 +152,7 @@
-
+
@@ -173,7 +173,7 @@
-
+