CS-16493: cloudstack UI - guest network page - hide VLAN ID 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/11c7746a Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/11c7746a Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/11c7746a Branch: refs/heads/junit-tests Commit: 11c7746ac9f8015b95e829eef06794fc7b013b89 Parents: bd849bd Author: Jessica Wang <[email protected]> Authored: Fri Oct 12 14:42:22 2012 -0700 Committer: Chip Childers <[email protected]> Committed: Mon Oct 15 16:19:21 2012 -0400 ---------------------------------------------------------------------- ui/scripts/network.js | 35 ++++++++++++++++------------------- 1 files changed, 16 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/11c7746a/ui/scripts/network.js ---------------------------------------------------------------------- diff --git a/ui/scripts/network.js b/ui/scripts/network.js index d3912a0..fff70be 100644 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -422,22 +422,9 @@ id: 'networks', fields: { name: { label: 'label.name' }, - account: { label: 'label.account' }, - //zonename: { label: 'label.zone' }, - type: { label: 'label.type' }, - vlan: { label: 'label.vlan' }, - cidr: { label: 'label.cidr' } - /* - state: { - label: 'label.state', - indicator: { - 'Implemented': 'on', - 'Setup': 'on', - 'Allocated': 'on', - 'Destroyed': 'off' - } - } - */ + account: { label: 'label.account' }, + type: { label: 'label.type' }, + cidr: { label: 'label.cidr' } }, advSearchFields: { @@ -841,7 +828,19 @@ hiddenFields.push("networkdomain"); } return hiddenFields; + }, + + preFilter: function(args) { + var hiddenFields; + if(isAdmin()) { + hiddenFields = []; + } + else { + hiddenFields = ["vlan"]; + } + return hiddenFields; }, + fields: [ { name: { @@ -871,9 +870,7 @@ return "No"; } }, - vlan: { label: 'label.vlan.id' }, - - networkofferingname: { label: 'label.network.offering' }, + vlan: { label: 'label.vlan.id' }, networkofferingid: { label: 'label.network.offering',
