summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorTobi Oetiker <tobi@oetiker.ch>2008-02-25 11:08:02 +0100
committerTobi Oetiker <tobi@oetiker.ch>2008-02-25 11:08:02 +0100
commitbc22f15ad9322086da631f7bb0854c2a0d2e5424 (patch)
tree3cd5ad582dec6dc53eb8d4ded1844ccc5a0f4765 /lib
parent4ddd6688d16443d84aabd6ce5d0d540f71b9b4b5 (diff)
downloadsmokeping-bc22f15ad9322086da631f7bb0854c2a0d2e5424.tar.gz
smokeping-bc22f15ad9322086da631f7bb0854c2a0d2e5424.tar.xz
do not use key '' for the default hierarchy
Diffstat (limited to 'lib')
-rw-r--r--lib/Smokeping.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm
index 28eca8a..c903822 100644
--- a/lib/Smokeping.pm
+++ b/lib/Smokeping.pm
@@ -1468,9 +1468,9 @@ sub hierarchy_switcher($$){
$print .= "<div id='hierarchy_popup'>";
$print .= $q->popup_menu(-name=>'hierarchy',
-onChange=>'hswitch.submit()',
- -values=>['', sort map {ref $cfg->{Presentation}{hierarchies}{$_} eq 'HASH'
+ -values=>[0, sort map {ref $cfg->{Presentation}{hierarchies}{$_} eq 'HASH'
? $_ : () } keys %{$cfg->{Presentation}{hierarchies}}],
- -labels=>{''=>'Default Hierarchy',
+ -labels=>{0=>'Default Hierarchy',
map {ref $cfg->{Presentation}{hierarchies}{$_} eq 'HASH'
? ($_ => $cfg->{Presentation}{hierarchies}{$_}{title} )
: () } keys %{$cfg->{Presentation}{hierarchies}}
@@ -1495,7 +1495,7 @@ sub display_webpage($$){
my ($path,$slave) = split(/~/,$q->param('target') || '');
my $hierarchy = $q->param('hierarchy');
die "ERROR: unknown hierarchy $hierarchy\n"
- if not $cfg->{Presentation}{hierarchies} and $cfg->{Presentation}{hierarchies}{$hierarchy};
+ if $hierarchy and not $cfg->{Presentation}{hierarchies}{$hierarchy};
my $open = [ (split /\./,$path||'') ];
my $open_orig = [@$open];
$open_orig->[-1] .= '~'.$slave if $slave;
@@ -1521,7 +1521,7 @@ sub display_webpage($$){
};
if (not $charts){
for (@$open) {
- die "ERROR: Section '$_' does not exist (display webpage).\n"
+ die "ERROR: Section '$_' does not exist (display webpage)." # .(join "", map {"$_=$ENV{$_}"} keys %ENV)."\n"
unless exists $tree->{$_};
last unless ref $tree->{$_} eq 'HASH';
$tree = $tree->{$_};