cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From weiz...@apache.org
Subject [5/5] git commit: updated refs/heads/4.2 to 622f076
Date Wed, 23 Oct 2013 12:45:55 GMT
CLOUDSTAC.K-4923: add missing Network limits in Accounts details page
(cherry picked from commit 0f976fd328ed5632201553ddeb69d9fa9ab500a4)


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

Branch: refs/heads/4.2
Commit: 622f0762defcc63f443a07329ef8c5b53c2159f5
Parents: 87c897f
Author: Wei Zhou <w.zhou@leaseweb.com>
Authored: Tue Oct 22 15:58:17 2013 +0200
Committer: Wei Zhou <w.zhou@leaseweb.com>
Committed: Wed Oct 23 14:30:48 2013 +0200

----------------------------------------------------------------------
 .../classes/resources/messages.properties       |  1 +
 ui/dictionary.jsp                               |  1 +
 ui/scripts/accounts.js                          | 30 ++++++++++++++++++++
 3 files changed, 32 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/622f0762/client/WEB-INF/classes/resources/messages.properties
----------------------------------------------------------------------
diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties
index 50f7a65..eb11fe4 100644
--- a/client/WEB-INF/classes/resources/messages.properties
+++ b/client/WEB-INF/classes/resources/messages.properties
@@ -800,6 +800,7 @@ label.network.domain.text=Network domain
 label.network.domain=Network Domain
 label.network.id=Network ID
 label.network.label.display.for.blank.value=Use default gateway
+label.network.limits=Network limits
 label.network.name=Network Name
 label.network.offering.display.text=Network Offering Display Text
 label.network.offering.id=Network Offering ID

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/622f0762/ui/dictionary.jsp
----------------------------------------------------------------------
diff --git a/ui/dictionary.jsp b/ui/dictionary.jsp
index 8d6a716..ab37781 100644
--- a/ui/dictionary.jsp
+++ b/ui/dictionary.jsp
@@ -794,6 +794,7 @@ dictionary = {
 'label.network.id': '<fmt:message key="label.network.id" />',
 'label.networking.and.security': '<fmt:message key="label.networking.and.security" />',
 'label.network.label.display.for.blank.value': '<fmt:message key="label.network.label.display.for.blank.value"
/>',
+'label.network.limits': '<fmt:message key="label.network.limits" />',
 'label.network.name': '<fmt:message key="label.network.name" />',
 'label.network.offering.display.text': '<fmt:message key="label.network.offering.display.text"
/>',
 'label.network.offering': '<fmt:message key="label.network.offering" />',

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/622f0762/ui/scripts/accounts.js
----------------------------------------------------------------------
diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js
index dcf2885..9ba3ebf 100644
--- a/ui/scripts/accounts.js
+++ b/ui/scripts/accounts.js
@@ -493,6 +493,24 @@
                                         });
                                     }
 
+                                    if (args.data.networkLimit != null) {
+                                        var data = {
+                                            resourceType: 6,
+                                            max: args.data.networkLimit,
+                                            domainid: accountObj.domainid,
+                                            account: accountObj.name
+                                        };
+
+                                        $.ajax({
+                                            url: createURL('updateResourceLimit'),
+                                            data: data,
+                                            async: false,
+                                            success: function(json) {
+                                                accountObj["networkLimit"] = args.data.networkLimit;
+                                            }
+                                        });
+                                    }
+
                                     if (args.data.primaryStorageLimit != null) {
                                         var data = {
                                             resourceType: 10,
@@ -853,6 +871,15 @@
                                                 return false;
                                         }
                                     },
+                                    networkLimit: {
+                                        label: 'label.network.limits',
+                                        isEditable: function(context) {
+                                            if (context.accounts[0].accounttype == roleTypeUser
|| context.accounts[0].accounttype == roleTypeDomainAdmin) //updateResourceLimits is only
allowed on account whose type is user or domain-admin
+                                                return true;
+                                            else
+                                                return false;
+                                        }
+                                    },
                                     primaryStorageLimit: {
                                         label: 'label.primary.storage.limits',
                                         isEditable: function(context) {
@@ -935,6 +962,9 @@
                                                                 case "4":
                                                                     accountObj["templateLimit"]
= limit.max;
                                                                     break;
+                                                                case "6":
+                                                                    accountObj["networkLimit"]
= limit.max;
+                                                                    break;
                                                                 case "7":
                                                                     accountObj["vpcLimit"]
= limit.max;
                                                                     break;


Mime
View raw message