version 1.160.6.75, 2016/10/25 12:54:25
|
version 1.160.6.76, 2017/01/21 21:51:56
|
Line 4019 sub print_loadbalancing {
|
Line 4019 sub print_loadbalancing {
|
my ($numspares,@spares) = &count_servers($lonhost,%servers); |
my ($numspares,@spares) = &count_servers($lonhost,%servers); |
my @sparestypes = ('primary','default'); |
my @sparestypes = ('primary','default'); |
my %typetitles = &sparestype_titles(); |
my %typetitles = &sparestype_titles(); |
|
my %hostherechecked = ( |
|
no => ' checked="checked"', |
|
); |
foreach my $sparetype (@sparestypes) { |
foreach my $sparetype (@sparestypes) { |
my $targettable; |
my $targettable; |
for (my $i=0; $i<$numspares; $i++) { |
for (my $i=0; $i<$numspares; $i++) { |
Line 4064 sub print_loadbalancing {
|
Line 4067 sub print_loadbalancing {
|
$datatable .= '<i>'.$typetitles{$sparetype}.'</i><br />'. |
$datatable .= '<i>'.$typetitles{$sparetype}.'</i><br />'. |
'<table><tr>'.$targettable.'</tr></table><br />'; |
'<table><tr>'.$targettable.'</tr></table><br />'; |
} |
} |
|
$hostherechecked{$sparetype} = ''; |
|
if (ref($currtargets{$lonhost}) eq 'HASH') { |
|
if (ref($currtargets{$lonhost}{$sparetype}) eq 'ARRAY') { |
|
if (grep(/^\Q$lonhost\E$/,@{$currtargets{$lonhost}{$sparetype}})) { |
|
$hostherechecked{$sparetype} = ' checked="checked"'; |
|
$hostherechecked{'no'} = ''; |
|
} |
|
} |
|
} |
|
} |
|
$datatable .= &mt('Hosting on balancer itself').'<br />'. |
|
'<label><input type="radio" name="loadbalancing_target_'.$balnum.'_hosthere" value="no"'. |
|
$hostherechecked{'no'}.' />'.&mt('No').'</label><br />'; |
|
foreach my $sparetype (@sparestypes) { |
|
$datatable .= '<label><input type="radio" name="loadbalancing_target_'.$balnum.'_hosthere" '. |
|
'value="'.$sparetype.'"'.$hostherechecked{$sparetype}.' /><i>'.$typetitles{$sparetype}. |
|
'</i></label><br />'; |
} |
} |
$datatable .= '</div></td></tr>'. |
$datatable .= '</div></td></tr>'. |
&loadbalancing_rules($dom,$intdom,$currrules{$lonhost}, |
&loadbalancing_rules($dom,$intdom,$currrules{$lonhost}, |
Line 11632 sub modify_loadbalancing {
|
Line 11652 sub modify_loadbalancing {
|
push(@offloadto,$target); |
push(@offloadto,$target); |
} |
} |
} |
} |
$defaultshash{'loadbalancing'}{$balancer}{'targets'}{$sparetype} = \@offloadto; |
|
} |
} |
|
if ($env{'form.loadbalancing_target_'.$i.'_hosthere'} eq $sparetype) { |
|
unless(grep(/^\Q$balancer\E$/,@offloadto)) { |
|
push(@offloadto,$balancer); |
|
} |
|
} |
|
$defaultshash{'loadbalancing'}{$balancer}{'targets'}{$sparetype} = \@offloadto; |
} |
} |
if (ref($currtargets{$balancer}) eq 'HASH') { |
if (ref($currtargets{$balancer}) eq 'HASH') { |
foreach my $sparetype (@sparestypes) { |
foreach my $sparetype (@sparestypes) { |