Commit 01b9cbe0 authored by Nigel Kukard's avatar Nigel Kukard

Fixed display of overridden pool icon in list

parent 0796a91f
...@@ -93,6 +93,7 @@ our (@ISA,@EXPORT,@EXPORT_OK); ...@@ -93,6 +93,7 @@ our (@ISA,@EXPORT,@EXPORT_OK);
setPoolShaperState setPoolShaperState
unsetPoolShaperState unsetPoolShaperState
isPoolIDValid isPoolIDValid
isPoolOverridden
isPoolReady isPoolReady
getEffectivePool getEffectivePool
...@@ -2805,6 +2806,26 @@ sub isPoolReady ...@@ -2805,6 +2806,26 @@ sub isPoolReady
# Function to check if pool is being overridden or not
sub isPoolOverridden
{
my $pid = shift;
if (!isPoolIDValid($pid)) {
return;
}
# Set a property based on if this pool is overridden or not
if (defined($globals->{'Pools'}->{$pid}->{'.applied_overrides'}) &&
(keys %{$globals->{'Pools'}->{$pid}->{'.applied_overrides'}}) > 0) {
return 1;
}
return 0;
}
# Function to return a pool with any items changed as per pool overrides # Function to return a pool with any items changed as per pool overrides
sub getEffectivePool sub getEffectivePool
{ {
......
...@@ -59,6 +59,7 @@ use opentrafficshaper::plugins::configmanager qw( ...@@ -59,6 +59,7 @@ use opentrafficshaper::plugins::configmanager qw(
getPool getPool
getPoolByName getPoolByName
getPoolShaperState getPoolShaperState
isPoolOverridden
isPoolReady isPoolReady
getPoolMembers getPoolMembers
...@@ -213,9 +214,9 @@ EOF ...@@ -213,9 +214,9 @@ EOF
# if ($pool->{'Status'} eq 'conflict') { # if ($pool->{'Status'} eq 'conflict') {
# $icons .= '<span class="glyphicon glyphicon-random" />'; # $icons .= '<span class="glyphicon glyphicon-random" />';
# } # }
# if ($pool->{'Status'} eq 'conflict') { if (isPoolOverridden($pool->{'ID'})) {
# $icons .= '<span class="glyphicon glyphicon-edit" />'; $icons .= '<span class="glyphicon glyphicon-edit" />';
# } }
my $urlStatsPool = sprintf('/statistics/by-pool?pool=%s',uri_escape("$pool->{'InterfaceGroupID'}:$pool->{'Name'}")); my $urlStatsPool = sprintf('/statistics/by-pool?pool=%s',uri_escape("$pool->{'InterfaceGroupID'}:$pool->{'Name'}"));
my $urlPoolEdit = sprintf('/limits/pool-edit?pid=%s',uri_escape($pool->{'ID'})); my $urlPoolEdit = sprintf('/limits/pool-edit?pid=%s',uri_escape($pool->{'ID'}));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment