Skip to content

Commit 5c6017e

Browse files
committed
CLOUDSTACK-2844: VPC UI: Disable LB links if not supported on tier
1 parent bea3f44 commit 5c6017e

3 files changed

Lines changed: 45 additions & 2 deletions

File tree

ui/modules/vpc/vpc.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,15 @@
154154
cursor: pointer;
155155
}
156156

157+
.vpc-network-chart .tier-item .content .dashboard-item.disabled {
158+
/*+opacity:50%;*/
159+
filter: alpha(opacity=50);
160+
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50);
161+
-moz-opacity: 0.5;
162+
opacity: 0.5;
163+
cursor: not-allowed;
164+
}
165+
157166
.vpc-network-chart .tier-item .content .dashboard-item:hover {
158167
background-color: #DBEDFE;
159168
/*+box-shadow:inset 0px 1px 2px #000000;*/
@@ -271,6 +280,8 @@
271280
float: left;
272281
/*+placement:shift 10px 176px;*/
273282
position: relative;
283+
left: 10px;
284+
top: 176px;
274285
left: 0px;
275286
top: 237px;
276287
}

ui/modules/vpc/vpc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,15 @@
231231
$dashboardItem.append($total, $name);
232232
$dashboardItem.appendTo($dashboard);
233233

234+
if (dashboardItem._disabled) {
235+
$dashboardItem.addClass('disabled');
236+
}
237+
234238
$dashboardItem.click(function() {
239+
if ($dashboardItem.is('.disabled')) {
240+
return false;
241+
}
242+
235243
var section = cloudStack.vpc.sections[id];
236244
var $section = $('<div>');
237245
var $loading = $('<div>').addClass('loading-overlay');

ui/scripts/vpc.js

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3482,17 +3482,41 @@
34823482
}
34833483
).length ? tier._highlighted = true : tier._highlighted = false;
34843484

3485+
// Get LB capabilities
3486+
var lbSchemes = $.grep(
3487+
$.grep(
3488+
tier.service,
3489+
function(service) {
3490+
return service.name == 'Lb';
3491+
}
3492+
)[0].capability,
3493+
function(capability) {
3494+
return capability.name == 'LbSchemes';
3495+
}
3496+
);
3497+
3498+
var hasLbScheme = function(schemeVal) {
3499+
return $.grep(
3500+
lbSchemes,
3501+
function(scheme) {
3502+
return scheme.value == schemeVal;
3503+
}
3504+
).length ? true : false;
3505+
};
3506+
34853507
return $.extend(tier, {
34863508
_dashboardItems: [
34873509
{
34883510
id: 'internalLoadBalancers',
34893511
name: 'Internal LB',
3490-
total: internalLoadBalancers.count
3512+
total: internalLoadBalancers.count,
3513+
_disabled: !hasLbScheme('Internal')
34913514
},
34923515
{
34933516
id: 'publicLbIps',
34943517
name: 'Public LB IP',
3495-
total: publicLbIps.count
3518+
total: publicLbIps.count,
3519+
_disabled: !hasLbScheme('Public')
34963520
},
34973521
{
34983522
id: 'tierStaticNATs',

0 commit comments

Comments
 (0)