From: Stephen L Johnson Date: Mon, 13 Mar 2000 21:16:19 +0000 (+0000) Subject: added three frame mode. 2 or three frame mode is configurable X-Git-Tag: spong-2_7-alpha5~46 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=806cf5b8b6d19e8e427d01c5de2c0f49588cfdf6;p=spong.git added three frame mode. 2 or three frame mode is configurable --- diff --git a/src/www-spong.pl b/src/www-spong.pl index 8ac0987..0efcb40 100755 --- a/src/www-spong.pl +++ b/src/www-spong.pl @@ -1,4 +1,4 @@ -#!@@PERL@@ +#!/usr/bin/perl # # This program is used to display information collected by the spong server to # people using web based clients. This provides the same type of interface to @@ -37,6 +37,8 @@ $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 HTML documents), or a CGI program (in which case I # present back an interactive web interface). The command line arguments are @@ -104,12 +106,17 @@ $cmd = $ENV{'PATH_INFO'}; # These commands control the frame interface, etc... if( $cmd eq "" || $cmd eq "/" ) { - $main::SPONG_DEFAULT_VIEW = "HOST" unless $main::SPONG_DEFAULT_VIEW; - &interactive( "all" ) if $main::SPONG_DEFAULT_VIEW eq "HOST"; - &ovinteractive( "all" ) if $main::SPONG_DEFAULT_VIEW eq "OVERVIEW"; + if ($WWWFRAMES == 3) { &toplevel(); } + else { + &interactive( "all" ) if $main::WWW_DEFAULT_VIEW eq "HOSTS"; + &ovinteractive( "all" ) if $main::WWW_DEFAULT_VIEW eq "GROUPS"; + } exit; } +if ($cmd =~ m!^/title$! ) { &title(); exit; } + if( $cmd =~ m!^/group/(.*)$! ) { &interactive( $1 ); exit; } +if( $cmd =~ m!^/bygroup/(.*)$! ) { &ovinteractive( $1 ); exit; } if( $cmd =~ m!^/commands/(.*)$! ) { &commands( $1 ); exit; } if( $cmd =~ m!^/ovcommands/(.*)$! ) { &ovcommands( $1 ); exit; } @@ -162,6 +169,28 @@ exit(0); # commands & error summary information is shown, and the frame for more # detailed host information. + +sub toplevel { + + print "Content-type: text/html\n\n"; + print "\n"; + print "Spong v$SPONGVER - System Status Monitor\n"; + print ""; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "Frameless version not currently available.\n"; + print "\n\n"; +} + sub interactive { my $group = shift; @@ -196,6 +225,30 @@ sub ovinteractive { print "\n\n"; } +# This function fills out the Title header. It had a command bar that changes +# the the current View type in the 'view' frame + +sub title { + &header(0); + + my $me = $main::WWWSPONG; + + print "\n"; +# print "
"; + print "Spong v$SPONGVER\n"; +# print "
\n"; +# print "
"; + print "Groups || \n"; + print "Hosts \n"; + +# print "Extra Tool Bar Commands: "; +# print " Spong RRD Charts\n"; +# print " || System Summaries\n"; + + if ( $main::WWW_TITLE_ACTIONBAR ) { print $main::WWW_TITLE_ACTIONBAR,"\n"; } +} + + # This function fills out the action bar of the interactive spong display. # This lists the functions that you can perform via the web interface. @@ -210,7 +263,13 @@ sub commands { &header( 1 ); print "\n"; - print "Spong v$SPONGVER\n"; +# print "Spong v$SPONGVER\n"; + print "Hosts View\n"; + unless ($WWWFRAMES == 3) { + print "
\n"; + print "Views: Groups || \n"; + print "Hosts \n"; + } print "
\n"; print "Ack || \n"; @@ -238,12 +297,17 @@ sub ovcommands { &header( 1 ); print "\n"; - print "Spong v$SPONGVER\n"; +# print "Spong v$SPONGVER\n"; + print "Groups View\n"; + unless ($WWWFRAMES == 3) { + print "
\n"; + print "Views: Groups || \n"; + print "Hosts \n"; + } print "
\n"; print "Groups || \n"; - print "Group Summary || \n"; - print "Hosts \n"; + print "Group Summary\n"; print "
\n"; print "Ack || \n"; @@ -254,7 +318,8 @@ sub ovcommands { &ovproblems( $group ); -# print "


Group: $gname\n
\n"; + print "


"; +# print "Group: $gname\n
\n"; print "Updated at ", POSIX::strftime( "%H:%M, on %D", localtime() ), "\n"; &footer(); } @@ -321,7 +386,7 @@ sub groups { my $group; &header( $group, "Groups", '', 0 ); - print "\n"; + print "\n"; print "Spong Groups\n
\n"; print "You can select a specific group to show only information about ";