Revision 51561547
Added by Hamish Coleman over 17 years ago
- ID 515615477f5f1d30b07672bd3bf35a8245a0799b
mrtg.cgi | ||
---|---|---|
return $l;
|
||
}
|
||
|
||
sub print_menu_table($$) {
|
||
my ($lists,$style) = @_;
|
||
|
||
my $target;
|
||
if ($style eq 'wide') {
|
||
$target="_self";
|
||
} else {
|
||
$target="basefrm";
|
||
}
|
||
sub print_menu_table($$$$) {
|
||
my ($lists,$style,$target,$page) = @_;
|
||
|
||
print "\n<table border=2 cellpadding=2 cellspacing=0 style=\"margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse; font-size: 95%;\">\n";
|
||
|
||
... | ... | |
}
|
||
print " <td valign=top>\n";
|
||
for my $j (sort keys %{$lists->{$i}}) {
|
||
print " ".a({-href=>"?page=list&list=$i,$j",-target=>$target},"$j")."<br>\n";
|
||
print " ".a({-href=>"?page=$page&list=$i,$j",-target=>$target},"$j")."<br>\n";
|
||
}
|
||
print " </td>\n";
|
||
|
||
... | ... | |
|
||
print "USETEXTLINKS = 1\n";
|
||
print "STARTALLOPEN = 0\n";
|
||
print "HIGHLIGHT = 1\n";
|
||
print "ICONPATH = ''\n";
|
||
print 'foldersTree = gFld("<i>MRTG Tree</i>", "javascript:parent.op()")',"\n";
|
||
print 'foldersTree.treeID = "Frameset"',"\n";
|
||
... | ... | |
return 1;
|
||
}
|
||
|
||
sub print_graph_chooser($$) {
|
||
my ($this_graph,$selfurl) = @_;
|
||
sub print_graph_chooser($$$$) {
|
||
my ($this_graph,$list,$page,$changepage) = @_;
|
||
|
||
$selfurl .= 'page=list&';
|
||
my $selfurl = "?page=$page&list=$list&";
|
||
|
||
if ($this_graph eq 'day') {
|
||
print 'Daily';
|
||
} else {
|
||
print a({-href=>$selfurl.'graph=day&',-target=>'_self'}, 'Daily');
|
||
print a({-href=>$selfurl.'graph=day',-target=>'_self'}, 'Daily');
|
||
}
|
||
print ' ';
|
||
if ($this_graph eq 'week') {
|
||
print 'Weekly';
|
||
} else {
|
||
print a({-href=>$selfurl.'graph=week&',-target=>'_self'}, 'Weekly')
|
||
print a({-href=>$selfurl.'graph=week',-target=>'_self'}, 'Weekly')
|
||
}
|
||
print ' ';
|
||
if ($this_graph eq 'month') {
|
||
print 'Monthly';
|
||
} else {
|
||
print a({-href=>$selfurl.'graph=month&',-target=>'_self'}, 'Monthly')
|
||
print a({-href=>$selfurl.'graph=month',-target=>'_self'}, 'Monthly')
|
||
}
|
||
print ' ';
|
||
if ($this_graph eq 'year') {
|
||
print 'Yearly';
|
||
} else {
|
||
print a({-href=>$selfurl.'graph=year&',-target=>'_self'}, 'Yearly')
|
||
print a({-href=>$selfurl.'graph=year',-target=>'_self'}, 'Yearly')
|
||
}
|
||
print ' ';
|
||
|
||
print ' ';
|
||
print a({-href=>'?'}, 'Change List'),
|
||
' ',
|
||
'(This List is ',param('list'),")\n";
|
||
if (defined $changepage) {
|
||
print a({-href=>"?page=$changepage"}, 'Change List'), ' ';
|
||
}
|
||
print '(This List is ',param('list'),")\n";
|
||
}
|
||
|
||
my $page = param('page') || 'treeview';
|
||
... | ... | |
print "<html><head><title>$this_host MRTG Index (V$VERSION)</title></head>\n";
|
||
print '<frameset cols="200,*">';
|
||
print '<frame src="?page=menu" name=treeframe>';
|
||
print '<frame src="?page=list&list=OTHER,OTHER" name=basefrm>';
|
||
print '<frame src="?page=list&list=" name=basefrm>';
|
||
print "</frameset>\n";
|
||
print "</html>\n";
|
||
|
||
... | ... | |
$refresh = $interval if $refresh <= $guardband;
|
||
my $expires = gmtime (time + $interval * 2 + $guardband);
|
||
|
||
my $list = param('list');
|
||
my $graph = param('graph') || 'day';
|
||
my $selfurl ='?list='.param('list').'&';
|
||
|
||
print
|
||
"<meta http-equiv=\"expires\" content=\"$expires GMT\">\n",
|
||
"<meta http-equiv=\"refresh\" content=$refresh>\n";
|
||
print_graph_chooser($graph,$selfurl);
|
||
print "<br/>";
|
||
print_list($lists,$graph,param('list')||'none');
|
||
if ($list) {
|
||
print_graph_chooser($graph,$list,$page,'none');
|
||
print "<br/>";
|
||
print_list($lists,$graph,$list);
|
||
}
|
||
print end_html;
|
||
} elsif($page eq 'menu') {
|
||
print header,
|
||
... | ... | |
|
||
@tests = init_tests(@config_files);
|
||
$lists = init_lists(@tests);
|
||
print_menu_table($lists,'high');
|
||
print_menu_table($lists,'high','basefrm','list');
|
||
print end_html;
|
||
} elsif($page eq 'treemenu') {
|
||
print header,
|
||
... | ... | |
print hr;
|
||
print a({-href=>"?page=none",-target=>"_top"}, "Old menu");
|
||
print br;
|
||
print a({-href=>"?page=frame",-target=>"_top"}, "Basic frame");
|
||
print a({-href=>"?page=noframe",-target=>"_top"}, "No frames");
|
||
print br;
|
||
print a({-href=>"?page=frame",-target=>"_top"}, "Basic frames");
|
||
|
||
print end_html;
|
||
} elsif($page eq 'noframe') {
|
||
... | ... | |
$refresh = $interval if $refresh <= $guardband;
|
||
my $expires = gmtime (time + $interval * 2 + $guardband);
|
||
|
||
my $list = param('list');
|
||
my $graph = param('graph') || 'day';
|
||
|
||
my $selfurl.='list='.param('list').'&';
|
||
|
||
print
|
||
"<meta http-equiv=\"expires\" content=\"$expires GMT\">\n",
|
||
"<meta http-equiv=\"refresh\" content=$refresh>\n";
|
||
... | ... | |
print "<table cellpadding=2 cellspacing=0>\n";
|
||
|
||
print "<tr><td valign=top>";
|
||
print_menu_table($lists,'high');
|
||
print_menu_table($lists,'high','_self','noframe');
|
||
|
||
print "<td valign=top>\n";
|
||
print_graph_chooser($graph,$selfurl);
|
||
print "<br/>";
|
||
print_list($lists,$graph,param('list'));
|
||
if ($list) {
|
||
print_graph_chooser($graph,$list,$page,'noframe');
|
||
print "<br/>";
|
||
print_list($lists,$graph,param('list'));
|
||
}
|
||
|
||
print "</table>\n";
|
||
print end_html;
|
||
... | ... | |
{-width=>"100\%"},
|
||
TR(td("Select which list to show"))
|
||
);
|
||
print_menu_table($lists,'wide');
|
||
print_menu_table($lists,'wide','_self','list');
|
||
print "\n","Direct questions and feedback to ",
|
||
a({-href=>"mailto:hamish\@zot.org"}, "Hamish"),
|
||
" (Version $VERSION)",
|
||
... | ... | |
|
||
}
|
||
|
||
if ($warnings) {
|
||
if ($warnings && param('debug')) {
|
||
print "<pre>\n", "$warnings", "</pre>\n";
|
||
}
|
||
|
Also available in: Unified diff
ensure that all forms of the interface work similarly