You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ap...@apache.org on 2013/12/13 10:38:34 UTC
git commit: updated refs/heads/4.2 to e0b87cf
Updated Branches:
refs/heads/4.2 2bdd28860 -> e0b87cfb7
CLOUDSTACK-5481: fix ui bug when regular user add isolated network
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e0b87cfb
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e0b87cfb
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e0b87cfb
Branch: refs/heads/4.2
Commit: e0b87cfb75239f1f241057a96d5949e94cf4dee9
Parents: 2bdd288
Author: Wei Zhou <w....@leaseweb.com>
Authored: Fri Dec 13 10:28:00 2013 +0100
Committer: Abhinandan Prateek <ap...@apache.org>
Committed: Fri Dec 13 15:08:02 2013 +0530
----------------------------------------------------------------------
ui/scripts/network.js | 70 +++++++++++++++++++++++++++++-----------------
1 file changed, 44 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e0b87cfb/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index 54c380c..02c32a8 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -545,35 +545,47 @@
},
domain: {
label: 'label.domain',
+ isHidden: function(args) {
+ if (isAdmin() || isDomainAdmin())
+ return false;
+ else
+ return true;
+ },
select: function(args) {
- $.ajax({
- url: createURL("listDomains&listAll=true"),
- success: function(json) {
- var items = [];
- items.push({
- id: "",
- description: ""
- });
- var domainObjs = json.listdomainsresponse.domain;
- $(domainObjs).each(function() {
+ if (isAdmin() || isDomainAdmin()) {
+ $.ajax({
+ url: createURL("listDomains&listAll=true"),
+ success: function(json) {
+ var items = [];
items.push({
- id: this.id,
- description: this.path
+ id: "",
+ description: ""
});
- });
- args.response.success({
- data: items
- });
- }
- });
- args.$select.change(function() {
- var $form = $(this).closest('form');
- if ($(this).val() == "") {
- $form.find('.form-item[rel=account]').hide();
- } else {
- $form.find('.form-item[rel=account]').css('display', 'inline-block');
- }
- });
+ var domainObjs = json.listdomainsresponse.domain;
+ $(domainObjs).each(function() {
+ items.push({
+ id: this.id,
+ description: this.path
+ });
+ });
+ args.response.success({
+ data: items
+ });
+ }
+ });
+ args.$select.change(function() {
+ var $form = $(this).closest('form');
+ if ($(this).val() == "") {
+ $form.find('.form-item[rel=account]').hide();
+ } else {
+ $form.find('.form-item[rel=account]').css('display', 'inline-block');
+ }
+ });
+ } else {
+ args.response.success({
+ data: null
+ });
+ }
},
},
account: {
@@ -581,6 +593,12 @@
validation: {
required: true
},
+ isHidden: function(args) {
+ if (isAdmin() || isDomainAdmin())
+ return false;
+ else
+ return true;
+ }
}
}
},