version 1.252, 2014/10/04 02:41:44
|
version 1.253, 2014/10/05 13:34:01
|
Line 3661 sub print_loadbalancing {
|
Line 3661 sub print_loadbalancing {
|
$disabled = ' disabled="disabled"'; |
$disabled = ' disabled="disabled"'; |
} |
} |
$targettable .= |
$targettable .= |
'<td><label><input type="checkbox" name="loadbalancing_target_'.$balnum.'_'.$sparetype.'"'. |
'<td><span class="LC_nobreak"><label>'. |
|
'<input type="checkbox" name="loadbalancing_target_'.$balnum.'_'.$sparetype.'"'. |
$checked.$disabled.' value="'.$chkboxval.'" id="loadbalancing_target_'.$balnum.'_'.$sparetype.'_'.$i.'" onclick="checkOffloads('."this,'$balnum','$sparetype'".');" /><span id="loadbalancing_targettxt_'.$balnum.'_'.$sparetype.'_'.$i.'"> '.$chkboxval. |
$checked.$disabled.' value="'.$chkboxval.'" id="loadbalancing_target_'.$balnum.'_'.$sparetype.'_'.$i.'" onclick="checkOffloads('."this,'$balnum','$sparetype'".');" /><span id="loadbalancing_targettxt_'.$balnum.'_'.$sparetype.'_'.$i.'"> '.$chkboxval. |
'</span></label></td>'; |
'</span></label></span></td>'; |
my $rem = $i%($numinrow); |
my $rem = $i%($numinrow); |
if ($rem == 0) { |
if ($rem == 0) { |
if (($i > 0) && ($i < $numspares-1)) { |
if (($i > 0) && ($i < $numspares-1)) { |
Line 3753 sub loadbalancing_rules {
|
Line 3754 sub loadbalancing_rules {
|
if (ref($currrules) eq 'HASH') { |
if (ref($currrules) eq 'HASH') { |
$current = $currrules->{$type}; |
$current = $currrules->{$type}; |
} |
} |
if (($type eq '_LC_external') || ($type eq '_LC_internetdom') || ($type eq '_LC_ipchange')) { |
if (($type eq '_LC_external') || ($type eq '_LC_internetdom')) { |
if ($dom ne &Apache::lonnet::host_domain($lonhost)) { |
if ($dom ne &Apache::lonnet::host_domain($lonhost)) { |
$current = ''; |
$current = ''; |
} |
} |
Line 3816 sub loadbalance_rule_row {
|
Line 3817 sub loadbalance_rule_row {
|
push(@rulenames,'none'); |
push(@rulenames,'none'); |
} |
} |
my $style = $targets_div_style; |
my $style = $targets_div_style; |
if (($type eq '_LC_external') || ($type eq '_LC_internetdom') || ($type eq '_LC_ipchange')) { |
if (($type eq '_LC_external') || ($type eq '_LC_internetdom')) { |
$style = $homedom_div_style; |
$style = $homedom_div_style; |
} |
} |
my $space; |
my $space; |
Line 10680 sub modify_loadbalancing {
|
Line 10681 sub modify_loadbalancing {
|
my ($othertitle,$usertypes,$types) = |
my ($othertitle,$usertypes,$types) = |
&Apache::loncommon::sorted_inst_types($dom); |
&Apache::loncommon::sorted_inst_types($dom); |
my %servers = &Apache::lonnet::internet_dom_servers($dom); |
my %servers = &Apache::lonnet::internet_dom_servers($dom); |
|
my %libraryservers = &Apache::lonnet::get_servers($dom,'library'); |
my @sparestypes = ('primary','default'); |
my @sparestypes = ('primary','default'); |
my %typetitles = &sparestype_titles(); |
my %typetitles = &sparestype_titles(); |
my $resulttext; |
my $resulttext; |
Line 10808 sub modify_loadbalancing {
|
Line 10810 sub modify_loadbalancing {
|
} |
} |
if (ref($changes{'curr'}) eq 'HASH') { |
if (ref($changes{'curr'}) eq 'HASH') { |
foreach my $balancer (sort(keys(%{$changes{'curr'}}))) { |
foreach my $balancer (sort(keys(%{$changes{'curr'}}))) { |
|
$toupdate{$balancer} = 1; |
if (ref($changes{'curr'}{$balancer}) eq 'HASH') { |
if (ref($changes{'curr'}{$balancer}) eq 'HASH') { |
if ($changes{'curr'}{$balancer}{'targets'}) { |
if ($changes{'curr'}{$balancer}{'targets'}) { |
my %offloadstr; |
my %offloadstr; |
Line 10852 sub modify_loadbalancing {
|
Line 10855 sub modify_loadbalancing {
|
map { $toupdate{$_} = 1; } (@{$defaultshash{'loadbalancing'}{$balancer}{'targets'}{$sparetype}}); |
map { $toupdate{$_} = 1; } (@{$defaultshash{'loadbalancing'}{$balancer}{'targets'}{$sparetype}}); |
} |
} |
} |
} |
|
foreach my $item (@{$alltypes}) { |
|
next if ($item =~ /^_LC_ipchange/); |
|
my $hasrule = $defaultshash{'loadbalancing'}{$balancer}{'rules'}{$item}; |
|
if ($hasrule eq 'homeserver') { |
|
map { $toupdate{$_} = 1; } (keys(%libraryservers)); |
|
} else { |
|
unless (($hasrule eq 'default') || ($hasrule eq 'none') || ($hasrule eq 'externalbalancer')) { |
|
if ($servers{$hasrule}) { |
|
$toupdate{$hasrule} = 1; |
|
} |
|
} |
|
} |
|
} |
} |
} |
} else { |
} else { |
$balancetext = &mt('offload to [_1]',$defaultshash{'loadbalancing'}{$balancer}{'rules'}{$type}); |
$balancetext = &mt('offload to [_1]',$defaultshash{'loadbalancing'}{$balancer}{'rules'}{$type}); |