cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject git commit: updated refs/heads/master to 883d7f1
Date Tue, 01 Apr 2014 17:57:41 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 24820d20d -> 883d7f17f


Value of Global parameter "custom.diskoffering.size.min" is not reflected in UI during new
instance creation.

Added fields to /api and /server classes for CustomDiskOfferingMinSize
to be available in CapabilitiesResponse. Fixed UI code in Instance
Wizard to have this config value as the minimum selectable option when
we are in custom disk size mode.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/883d7f17
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/883d7f17
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/883d7f17

Branch: refs/heads/master
Commit: 883d7f17f78433b37e4f20103b532b3b20582014
Parents: 24820d2
Author: Gabor Apati-Nagy <gabor.apati-nagy@citrix.com>
Authored: Fri Mar 28 14:39:02 2014 +0000
Committer: Brian Federle <brian.federle@citrix.com>
Committed: Tue Apr 1 10:57:36 2014 -0700

----------------------------------------------------------------------
 api/src/org/apache/cloudstack/api/ApiConstants.java          | 1 +
 .../api/command/user/config/ListCapabilitiesCmd.java         | 1 +
 .../apache/cloudstack/api/response/CapabilitiesResponse.java | 8 ++++++++
 server/src/com/cloud/server/ManagementServerImpl.java        | 2 ++
 ui/index.jsp                                                 | 2 +-
 ui/scripts/instanceWizard.js                                 | 6 ++++++
 ui/scripts/ui-custom/instanceWizard.js                       | 7 ++++++-
 7 files changed, 25 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/883d7f17/api/src/org/apache/cloudstack/api/ApiConstants.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java
index 87fa8ee..fdb4558 100755
--- a/api/src/org/apache/cloudstack/api/ApiConstants.java
+++ b/api/src/org/apache/cloudstack/api/ApiConstants.java
@@ -419,6 +419,7 @@ public class ApiConstants {
     public static final String INSTANCE_NAME = "instancename";
     public static final String START_VM = "startvm";
     public static final String HA_HOST = "hahost";
+    public static final String CUSTOM_DISK_OFF_MIN_SIZE = "customdiskofferingminsize";
     public static final String CUSTOM_DISK_OFF_MAX_SIZE = "customdiskofferingmaxsize";
     public static final String DEFAULT_ZONE_ID = "defaultzoneid";
     public static final String LIVE_MIGRATE = "livemigrate";

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/883d7f17/api/src/org/apache/cloudstack/api/command/user/config/ListCapabilitiesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/config/ListCapabilitiesCmd.java
b/api/src/org/apache/cloudstack/api/command/user/config/ListCapabilitiesCmd.java
index d47645b..e6696e1 100644
--- a/api/src/org/apache/cloudstack/api/command/user/config/ListCapabilitiesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/config/ListCapabilitiesCmd.java
@@ -53,6 +53,7 @@ public class ListCapabilitiesCmd extends BaseCmd {
         response.setSupportELB((String)capabilities.get("supportELB"));
         response.setProjectInviteRequired((Boolean)capabilities.get("projectInviteRequired"));
         response.setAllowUsersCreateProjects((Boolean)capabilities.get("allowusercreateprojects"));
+        response.setDiskOffMinSize((Long)capabilities.get("customDiskOffMinSize"));
         response.setDiskOffMaxSize((Long)capabilities.get("customDiskOffMaxSize"));
         response.setRegionSecondaryEnabled((Boolean)capabilities.get("regionSecondaryEnabled"));
         response.setKVMSnapshotEnabled((Boolean)capabilities.get("KVMSnapshotEnabled"));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/883d7f17/api/src/org/apache/cloudstack/api/response/CapabilitiesResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/CapabilitiesResponse.java b/api/src/org/apache/cloudstack/api/response/CapabilitiesResponse.java
index c8de587..f7fdb95 100644
--- a/api/src/org/apache/cloudstack/api/response/CapabilitiesResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/CapabilitiesResponse.java
@@ -49,6 +49,10 @@ public class CapabilitiesResponse extends BaseResponse {
     @Param(description = "true if regular user is allowed to create projects")
     private Boolean allowUsersCreateProjects;
 
+    @SerializedName(ApiConstants.CUSTOM_DISK_OFF_MIN_SIZE)
+    @Param(description = "minimum size that can be specified when " + "create disk from disk
offering with custom size")
+    private Long diskOffMinSize;
+
     @SerializedName(ApiConstants.CUSTOM_DISK_OFF_MAX_SIZE)
     @Param(description = "maximum size that can be specified when " + "create disk from disk
offering with custom size")
     private Long diskOffMaxSize;
@@ -93,6 +97,10 @@ public class CapabilitiesResponse extends BaseResponse {
         this.allowUsersCreateProjects = allowUsersCreateProjects;
     }
 
+    public void setDiskOffMinSize(Long diskOffMinSize) {
+        this.diskOffMinSize = diskOffMinSize;
+    }
+
     public void setDiskOffMaxSize(Long diskOffMaxSize) {
         this.diskOffMaxSize = diskOffMaxSize;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/883d7f17/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index 7431891..bce2930 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -3341,6 +3341,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
             }
         }
 
+        long diskOffMinSize = VolumeOrchestrationService.CustomDiskOfferingMinSize.value();
         long diskOffMaxSize = VolumeOrchestrationService.CustomDiskOfferingMaxSize.value();
         KVMSnapshotEnabled = Boolean.parseBoolean(_configDao.getValue("KVM.snapshot.enabled"));
 
@@ -3364,6 +3365,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
         capabilities.put("supportELB", supportELB);
         capabilities.put("projectInviteRequired", _projectMgr.projectInviteRequired());
         capabilities.put("allowusercreateprojects", _projectMgr.allowUserToCreateProject());
+        capabilities.put("customDiskOffMinSize", diskOffMinSize);
         capabilities.put("customDiskOffMaxSize", diskOffMaxSize);
         capabilities.put("regionSecondaryEnabled", regionSecondaryEnabled);
         capabilities.put("KVMSnapshotEnabled", KVMSnapshotEnabled);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/883d7f17/ui/index.jsp
----------------------------------------------------------------------
diff --git a/ui/index.jsp b/ui/index.jsp
index dce2aa8..4910b9f 100644
--- a/ui/index.jsp
+++ b/ui/index.jsp
@@ -254,7 +254,7 @@
                                     <label><fmt:message key="label.disk.size"/></label>
 
                                     <!-- Slider -->
-                                    <label class="size">1 GB</label>
+                                    <label class="size min"><span></span>
GB</label>
                                     <div class="slider custom-size"></div>
                                     <label class="size max"><span></span>
GB</label>
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/883d7f17/ui/scripts/instanceWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instanceWizard.js b/ui/scripts/instanceWizard.js
index 03ee344..c2d3030 100644
--- a/ui/scripts/instanceWizard.js
+++ b/ui/scripts/instanceWizard.js
@@ -22,6 +22,12 @@
     var step6ContainerType = 'nothing-to-select'; //'nothing-to-select', 'select-network',
'select-security-group', 'select-advanced-sg'(advanced sg-enabled zone)
 
     cloudStack.instanceWizard = {
+        //min disk offering  size when custom disk size is used
+        minDiskOfferingSize: function() {
+            return g_capabilities.customdiskofferingminsize;
+        },
+
+        //max disk offering size when custom disk size is used
         maxDiskOfferingSize: function() {
             return g_capabilities.customdiskofferingmaxsize;
         },

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/883d7f17/ui/scripts/ui-custom/instanceWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/instanceWizard.js b/ui/scripts/ui-custom/instanceWizard.js
index c5e0ddb..1a0c323 100644
--- a/ui/scripts/ui-custom/instanceWizard.js
+++ b/ui/scripts/ui-custom/instanceWizard.js
@@ -1105,17 +1105,22 @@
                     $futureSteps.removeClass('loaded');
                 });
 
+                var minCustomDiskSize = args.minDiskOfferingSize ?
+                                    args.minDiskOfferingSize() : 1;
+
                 var maxCustomDiskSize = args.maxDiskOfferingSize ?
                     args.maxDiskOfferingSize() : 100;
 
                 // Setup tabs and slider
+                $wizard.find('.section.custom-size .size.min span').html(minCustomDiskSize);
+                $wizard.find('.section.custom-size input[type=text]').val(minCustomDiskSize);
                 $wizard.find('.section.custom-size .size.max span').html(maxCustomDiskSize);
                 $wizard.find('.tab-view').tabs();
                 $wizard.find('.slider').each(function() {
                    var $slider = $(this);
 
                     $slider.slider({
-                        min: 1,
+                        min: minCustomDiskSize,
                         max: maxCustomDiskSize,
                         start: function(event) {
                             $slider.closest('.section.custom-size').find('input[type=radio]').click();


Mime
View raw message