Updated Branches: refs/heads/master bea3f4414 -> 5c6017e2e
CLOUDSTACK-2844: VPC UI: Disable LB links if not supported on tier Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/5c6017e2 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5c6017e2 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5c6017e2 Branch: refs/heads/master Commit: 5c6017e2ec847ce4d3ca9cfc9728fe043186eb72 Parents: bea3f44 Author: Brian Federle <[email protected]> Authored: Wed Jun 5 13:49:44 2013 -0700 Committer: Brian Federle <[email protected]> Committed: Wed Jun 5 13:49:50 2013 -0700 ---------------------------------------------------------------------- ui/modules/vpc/vpc.css | 11 +++++++++++ ui/modules/vpc/vpc.js | 8 ++++++++ ui/scripts/vpc.js | 28 ++++++++++++++++++++++++++-- 3 files changed, 45 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5c6017e2/ui/modules/vpc/vpc.css ---------------------------------------------------------------------- diff --git a/ui/modules/vpc/vpc.css b/ui/modules/vpc/vpc.css index db57d94..0ff99db 100644 --- a/ui/modules/vpc/vpc.css +++ b/ui/modules/vpc/vpc.css @@ -154,6 +154,15 @@ cursor: pointer; } +.vpc-network-chart .tier-item .content .dashboard-item.disabled { + /*+opacity:50%;*/ + filter: alpha(opacity=50); + -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50); + -moz-opacity: 0.5; + opacity: 0.5; + cursor: not-allowed; +} + .vpc-network-chart .tier-item .content .dashboard-item:hover { background-color: #DBEDFE; /*+box-shadow:inset 0px 1px 2px #000000;*/ @@ -271,6 +280,8 @@ float: left; /*+placement:shift 10px 176px;*/ position: relative; + left: 10px; + top: 176px; left: 0px; top: 237px; } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5c6017e2/ui/modules/vpc/vpc.js ---------------------------------------------------------------------- diff --git a/ui/modules/vpc/vpc.js b/ui/modules/vpc/vpc.js index 5e87dbb..981d612 100644 --- a/ui/modules/vpc/vpc.js +++ b/ui/modules/vpc/vpc.js @@ -231,7 +231,15 @@ $dashboardItem.append($total, $name); $dashboardItem.appendTo($dashboard); + if (dashboardItem._disabled) { + $dashboardItem.addClass('disabled'); + } + $dashboardItem.click(function() { + if ($dashboardItem.is('.disabled')) { + return false; + } + var section = cloudStack.vpc.sections[id]; var $section = $('<div>'); var $loading = $('<div>').addClass('loading-overlay'); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5c6017e2/ui/scripts/vpc.js ---------------------------------------------------------------------- diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js index 7ebc3f3..9d7b058 100644 --- a/ui/scripts/vpc.js +++ b/ui/scripts/vpc.js @@ -3482,17 +3482,41 @@ } ).length ? tier._highlighted = true : tier._highlighted = false; + // Get LB capabilities + var lbSchemes = $.grep( + $.grep( + tier.service, + function(service) { + return service.name == 'Lb'; + } + )[0].capability, + function(capability) { + return capability.name == 'LbSchemes'; + } + ); + + var hasLbScheme = function(schemeVal) { + return $.grep( + lbSchemes, + function(scheme) { + return scheme.value == schemeVal; + } + ).length ? true : false; + }; + return $.extend(tier, { _dashboardItems: [ { id: 'internalLoadBalancers', name: 'Internal LB', - total: internalLoadBalancers.count + total: internalLoadBalancers.count, + _disabled: !hasLbScheme('Internal') }, { id: 'publicLbIps', name: 'Public LB IP', - total: publicLbIps.count + total: publicLbIps.count, + _disabled: !hasLbScheme('Public') }, { id: 'tierStaticNATs',
