CS-16493: cloudstack UI - IP Address page - hide VLAN for 
regular-user/domain-admin.


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

Branch: refs/heads/junit-tests
Commit: a23bdab7d0c8f1d321d32d7f312b27602728971f
Parents: 11c7746
Author: Jessica Wang <[email protected]>
Authored: Fri Oct 12 14:49:34 2012 -0700
Committer: Chip Childers <[email protected]>
Committed: Mon Oct 15 16:19:21 2012 -0400

----------------------------------------------------------------------
 ui/scripts/network.js |   40 +++++++++++++++++++++-------------------
 1 files changed, 21 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a23bdab7/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index fff70be..3ff35b4 100644
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -1727,25 +1727,27 @@
             tabs: {
               details: {
                 title: 'label.details',
-                                                               
-                                                               preFilter: 
function(args) {
-                                                                 var 
hiddenFields = [];                                                              
  
-                                                                       var 
zoneObj;
-                                                                       $.ajax({
-                                                                         url: 
createURL("listZones&id=" + args.context.ipAddresses[0].zoneid),
-                                                                               
dataType: "json",
-                                                                               
async: false,
-                                                                               
success: function(json) {                                                       
                          
-                                                                               
        zoneObj = json.listzonesresponse.zone[0];                               
                                                        
-                                                                               
}
-                                                                       });     
                                                
-                                                                       
if(zoneObj.networktype == "Advanced") {
-                                                                         
hiddenFields.push("issystem");
-                                                                               
hiddenFields.push("purpose");
-                                                                       }       
                                                                                
                                                
-                                                                       return 
hiddenFields;                                                            
-                                                               },
-                                                               
+                preFilter: function(args) {
+                  var hiddenFields = [];
+                  var zoneObj;
+                  $.ajax({
+                    url: createURL("listZones&id=" + 
args.context.ipAddresses[0].zoneid),
+                    dataType: "json",
+                    async: false,
+                    success: function(json) {
+                      zoneObj = json.listzonesresponse.zone[0];
+                    }
+                  });
+                  if(zoneObj.networktype == "Advanced") {
+                    hiddenFields.push("issystem");
+                    hiddenFields.push("purpose");
+                  }
+                                                                       
+                                                                       
if(!isAdmin()) {                   
+                    hiddenFields.push("vlanname");
+                  }                                                            
        
+                  return hiddenFields;
+                },
                 fields: [
                   {
                     ipaddress: { label: 'label.ip' }

Reply via email to