From: Stephen L Johnson Date: Mon, 16 Oct 2000 20:51:16 +0000 (+0000) Subject: added back do action. changed

align to left. removed extraneous <\br> X-Git-Tag: spong-2_7_0-beta1~3 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b0cf3e12380632cd8031ec37a36eb36894bb56f;p=spong.git added back do action. changed

align to left. removed extraneous <\br> --- diff --git a/src/wap-spong.pl b/src/wap-spong.pl index 0efbf7f..a9d44a2 100644 --- a/src/wap-spong.pl +++ b/src/wap-spong.pl @@ -1,17 +1,17 @@ -#@@PERL@@ - -# $Id: wap-spong.pl,v 1.1 2000/09/25 20:53:33 sljohnson Exp $ +#!@@PERL@@ # # This program is used to display information collected by the spong server to -# people using WAP enabled clients. This provides the same type of interface to +# people using web based clients. This provides the same type of interface to # the data as the text based client does. You can run this program as a CGI # program to provide an interactive experience, or you can use it from a cron # job, or some other automated process to just generate static web pages. # - -# !!!!! This is a very beta program. Not all of the WAP display options -# are present. The old HTML code is present in several cases. +# History: +# (1) Ported mkbb.* scripts to perl. (Ed Hill, Mar 1, 1997) +# (2) Re-did in a more generic and OO way (Ed Hill, May 9, 1997) +# (3) Re-did as a client which gets info from the spong-server (07/24/1997) +# (4) Did a whole bunch of stuff (Ed Hill, 06/18/1998) use Sys::Hostname; use Getopt::Long; @@ -38,9 +38,11 @@ $interactive = 0; &load_config_files(); # Loads the user specified configuration information +$main::WWW_DEFAULT_VIEW = "HOST" unless $main::WWW_DEFAULT_VIEW; + # Check to see if I am being run as a command line program (in which case I -# just generate static WML documents), or a CGI program (in which case I -# present back an interactive WAP interface). The command line arguments are +# just generate static HTML documents), or a CGI program (in which case I +# present back an interactive web interface). The command line arguments are # the same as the text based spong program, and produce similar results if( $ENV{'SCRIPT_NAME'} eq "" ) { @@ -52,6 +54,8 @@ if( $ENV{'SCRIPT_NAME'} eq "" ) { "histservice=s", "grp-summary:s", "grp-problems", "brief", "standard", "full" ); + $actionbar = 0; + if( ! GetOptions( \%opt, @options )) {warn "Incorrect usage:\n\n"; &help();} &help if defined $opt{'help'}; @@ -100,6 +104,7 @@ $interactive = 1; $cmd = $ENV{'PATH_INFO'}; # Commands that are more applicable to spong running in interactive mode. +# These commands control the frame interface, etc... if( $cmd eq "" || $cmd eq "/" ) { $view = "brief"; @@ -487,12 +492,12 @@ sub services { header(1); - print "

\n"; + print "

\n"; print "Summary"; print "
\n"; print POSIX::strftime($DATETIMEFMT,localtime()),"

\n"; - print "

\n"; - print " $host

\n"; + print "

\n"; + print " $host
\n"; print &query( $SPONGSERVER, "services", $host, "wml", $view ); print "

\n"; @@ -533,12 +538,12 @@ sub service { header(1); - print "

\n"; + print "

\n"; print "Host"; print "
\n"; print POSIX::strftime($DATETIMEFMT,localtime()),"

\n"; - print "

\n"; - print " $host
\n"; + print "

\n"; + print " $host \n"; print &query( $SPONGSERVER, "service", $host, "wml", $view, $service ); print "

\n"; &footer(); @@ -560,11 +565,15 @@ sub grp_summary { &header(1); - print "

\n"; - print "Grp Summary"; - print "
\n"; +# print "\n"; +# print "\n\n"; + +# print "

\n"; +# print "Grp Summary"; +# print "
\n"; + print "

"; print POSIX::strftime($DATETIMEFMT,localtime()),"

\n"; - print "


\n"; + print "


\n"; print &query( $SPONGSERVER, "grpsummary", '', "wml", $view, $other); print "

\n"; @@ -700,10 +709,15 @@ Content-type: text/vnd.wap.wml + + + HEADER ; +# print "\n"; +# print "\n\n"; # &show( "header", 1 ) if -f "$main::WWWHTML/header.html"; }