- #!/usr/local/bin/perl5
- # -*- perl -*-
- use P4CGI ;
- use strict ;
- #
- #####################################################################
- ##
- ## CONFIGURATION INFORMATION:
- ## All config info should be in $configFile (see init() in P4CGI.pm)
- ##
- #####################################################################
- ##
- ## INDEX (homepage for P4 depot browser)
- ##
- #####################################################################
- # Set back references
- my $backtourl = "$ENV{RETURN_PAGE}" ;
- my $backtoname = "$ENV{RETURN_NAME}" ;
- # Print title and legend
- "",
- &P4CGI::start_page("P4DB<br> Perforce Depot Browser",
- "<small><i>Hint:</i>
- You can bookmark any page you want to get back to later.</small>",
- $backtourl, $backtoname) ;
- # Print options
- "",
- &P4CGI::start_table("width=100%"),
- &P4CGI::table_row(-align => "left",
- &P4CGI::ahref(-url => &P4CGI::DTB_URL(),
- "FSPC=/", "HIDEDEL=NO", "NDX=yes",
- "<font size=+1>Browse Depot Tree</font>"),
- &P4CGI::ahref(-url => &P4CGI::CHB_URL(),
- "FSPC=//...",
- "STATUS=pending",
- "<font size=+1>Pending Changes</font>"),
- &P4CGI::ahref(-url => &P4CGI::LAB_URL(),
- "<font size=+1>List Branches</font>"),
- &P4CGI::ahref(-url => &P4CGI::LAL_URL(),
- "<font size=+1>List Labels</font>"),
- { -text => &P4CGI::ahref(-url => &P4CGI::LAU_URL(),
- "<font size=+1>List Users</font>"), -align => "right"} ),
- &P4CGI::end_table(),
- "<hr>" ;
- # Search-for-file form
- &P4CGI::cgi()->startform(-action => &P4CGI::SFF_URL(),
- -method => "GET"),
- &P4CGI::cgi()->submit(-name => "ignore",
- -value => "Search for file:"),
- &P4CGI::cgi()->textfield(-name => "FSPC",
- -default => "//...",
- -size => 50,
- -maxlength => 256),
- &P4CGI::cgi()->endform() ;
- # View-changes-for-file form
- &P4CGI::cgi()->startform(-action => &P4CGI::CHB_URL(),
- -method => "GET"),
- &P4CGI::cgi()->submit(-name => "ignore",
- -value => "View changes for file:"),
- &P4CGI::cgi()->hidden(-name => "MAXCH",
- -value => "100"),
- &P4CGI::cgi()->textfield(-name => "FSPC",
- -default => "//...",
- -size => 41,
- -maxlength => 256),
- &P4CGI::cgi()->endform() ;
- # View-change-number form
- my $currlev = &P4CGI::CURRENT_CHANGE_LEVEL() ;
- "",
- &P4CGI::cgi()->startform(-action => &P4CGI::CHV_URL(),
- -method => "GET"),
- &P4CGI::cgi()->submit(-name => "ignore",
- -value => "View change number:"),
- &P4CGI::cgi()->textfield(-name => "CH",
- -default => "$currlev",
- -size => 20,
- -maxlength => 20),
- &P4CGI::cgi()->endform() ;
- # Browse-a-different-repository form
- my $userp4port = &P4CGI::USER_P4PORT() ;
- my ($host,$port) ;
- ($host,$port) = split( /:/, $userp4port ) ;
- "",
- &P4CGI::cgi()->startform(-action => &P4CGI::MAIN_URL(),
- -method => "GET"),
- &P4CGI::cgi()->submit(-name => "ignore",
- -value => "Browse a different repository:"),
- &P4CGI::cgi()->textfield(-name => "HOST",
- -default => "$host",
- -size => 20,
- -maxlength => 256),
- &P4CGI::cgi()->textfield(-name => "PORT",
- -default => "$port",
- -size => 20,
- -maxlength => 256),
- &P4CGI::cgi()->submit(-name => "Go",
- -value => "Go"),
- &P4CGI::cgi()->endform() ;
- # Print list-changes options
- "",
- &P4CGI::start_table("width=100%"),
- &P4CGI::table_row(-align => "left",
- &P4CGI::ahref(-url => &P4CGI::CBB_URL(),
- "<font size=+1>List Changes by Branch</font>"),
- {-align => "center",
- -text => &P4CGI::ahref(-url => &P4CGI::LOF_URL(),
- "<font size=+1>List Opened Files</font>")},
- {-align => "right",
- -text => &P4CGI::ahref(-url => &P4CGI::CBU_URL(),
- "<font size=+1>List Changes by User</font>")}),
- &P4CGI::end_table();
- # Javascript function to open Help as an offset window
- print "<script language=javascript>" ;
- print "function OpenWin(page) {
- HelpWin = this.open(page, \"HelpWindow\", \"toolbar=yes,menubar=yes,location=yes,scrollbars=yes, resizable=yes,height=500,width=800,left=200,top=50\"); }" ;
- print "</script>\n" ;
- # Print help-link and silliness option
- "<hr>",
- &P4CGI::start_table("width=100%"),
- &P4CGI::table_row(
- -align => "left",
- "<a href=\"javascript:OpenWin('../htdocs/p4db_help.html')\"><font size=+1>Get Help</font></a>",
- { -text => &P4CGI::ahref(-url => "p4race.cgi",
- "<font size=-1>The Great<br>Submit Race</font>"), -align => "right"}),
- &P4CGI::end_table() ;
- # End the page, pass that we're the homepage so it doesn't do Page Top link,
- # since the homepage should never be so long you'd need that
- "",
- &P4CGI::end_page("index") ;
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 271 | Diane Holt | The Perl files for P4DB. These (almost) match the files in rev 1 of the p4db.tar file --... a few files have some minor cosmetic changes in the code, and chv.cgi has a Legend item added that was missing in the one in the tar-file. These files, at rev 1 (and the files in p4db.tar at rev 1), are suitable for for running the app with release 98.2 of P4. « |
25 years ago |