cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [01/12] git commit: updated refs/heads/4.3 to 8de4894
Date Wed, 26 Nov 2014 18:37:13 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.3 2b264e6b5 -> 8de489469


CLOUDSTACK-5962: 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.

(cherry picked from commit 883d7f17f78433b37e4f20103b532b3b20582014)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

Conflicts:
	api/src/org/apache/cloudstack/api/response/CapabilitiesResponse.java
	server/src/com/cloud/server/ManagementServerImpl.java


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

Branch: refs/heads/4.3
Commit: 17c3e83cae5e21b9d69cc84216c504766d0ef0a2
Parents: 2b264e6
Author: Gabor Apati-Nagy <gabor.apati-nagy@citrix.com>
Authored: Fri Mar 28 14:39:02 2014 +0000
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Wed Nov 26 21:59:16 2014 +0530

----------------------------------------------------------------------
 api/src/org/apache/cloudstack/api/ApiConstants.java    |  1 +
 .../api/command/user/config/ListCapabilitiesCmd.java   |  1 +
 .../cloudstack/api/response/CapabilitiesResponse.java  | 13 +++++++++++--
 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, 28 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/17c3e83c/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 68abf8d..b7ac97b 100755
--- a/api/src/org/apache/cloudstack/api/ApiConstants.java
+++ b/api/src/org/apache/cloudstack/api/ApiConstants.java
@@ -400,6 +400,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/17c3e83c/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 2176bc0..78d5be9 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
@@ -52,6 +52,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/17c3e83c/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 3ce31b5..b64ebdd 100644
--- a/api/src/org/apache/cloudstack/api/response/CapabilitiesResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/CapabilitiesResponse.java
@@ -43,9 +43,14 @@ public class CapabilitiesResponse extends BaseResponse {
     @SerializedName(ApiConstants.ALLOW_USER_CREATE_PROJECTS) @Param(description="true if
regular user is allowed to create projects")
     private Boolean allowUsersCreateProjects;
 
-    @SerializedName(ApiConstants.CUSTOM_DISK_OFF_MAX_SIZE) @Param(description="maximum size
that can be specified when " +
-            "create disk from disk offering with custom size")
+    @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;
+
     @SerializedName("regionsecondaryenabled") @Param(description = "true if region wide secondary
is enabled, false otherwise")
     private boolean regionSecondaryEnabled;
 
@@ -83,6 +88,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/17c3e83c/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 afa50b0..b2ffa16 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -3318,6 +3318,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
             }
         }
 
+        long diskOffMinSize = _volumeMgr.CustomDiskOfferingMinSize.value();
         long diskOffMaxSize = _volumeMgr.CustomDiskOfferingMaxSize.value();
         KVMSnapshotEnabled = Boolean.parseBoolean(_configDao.getValue("KVM.snapshot.enabled"));
 
@@ -3341,6 +3342,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/17c3e83c/ui/index.jsp
----------------------------------------------------------------------
diff --git a/ui/index.jsp b/ui/index.jsp
index 0cd5dc5a..672e82a 100644
--- a/ui/index.jsp
+++ b/ui/index.jsp
@@ -241,7 +241,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/17c3e83c/ui/scripts/instanceWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instanceWizard.js b/ui/scripts/instanceWizard.js
index 4708866..807f075 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/17c3e83c/ui/scripts/ui-custom/instanceWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/instanceWizard.js b/ui/scripts/ui-custom/instanceWizard.js
index d5203c8..5704278 100644
--- a/ui/scripts/ui-custom/instanceWizard.js
+++ b/ui/scripts/ui-custom/instanceWizard.js
@@ -1046,17 +1046,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