Add top-level 'logs.cgi' to show all the logs; deal with stuff being in a 'data' subdirectory.

This commit is contained in:
waterson%netscape.com 1999-11-16 22:10:11 +00:00
Родитель 8cc3299e5a
Коммит d515f53683
4 изменённых файлов: 124 добавлений и 4 удалений

Просмотреть файл

@ -19,7 +19,7 @@
#
# Contributor(s):
#
# $Id: bloat-log.cgi,v 1.1 1999/11/15 22:31:33 waterson%netscape.com Exp $
# $Id: bloat-log.cgi,v 1.2 1999/11/16 22:10:07 waterson%netscape.com Exp $
#
#
@ -35,7 +35,7 @@ use Zip;
$::query = new CGI();
# The ZIP where all the log files are kept
$::log = $::query->param('log' => 'current');
$::log = $::query->param('log');
$::zip = new Zip($::log);
print $::query->header;

Просмотреть файл

@ -0,0 +1,23 @@
<html>
<head>
<title>Leak-o-Matic Instructions</title>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td bgcolor="#000000" valign="top">
<img src="http://www.mozilla.org/images/mozilla-banner.gif"
alt="mozilla.org" border="0" href="http://www.mozilla.org/">
</td></tr></table>
<center>
<h1>Leak-o-Matic Instructions</h1>
</center>
<p>
Write me!
</p>
<small>$Id: instructions.html,v 1.1 1999/11/16 22:10:08 waterson%netscape.com Exp $</small>
</body>
</html>

Просмотреть файл

@ -19,7 +19,7 @@
#
# Contributor(s):
#
# $Id: leaks.cgi,v 1.1 1999/11/15 22:31:34 waterson%netscape.com Exp $
# $Id: leaks.cgi,v 1.2 1999/11/16 22:10:10 waterson%netscape.com Exp $
#
#
@ -35,7 +35,7 @@ use Zip;
$::query = new CGI();
# The ZIP where all the log files are kept
$::log = $::query->param('log' => 'current');
$::log = $::query->param('log');
$::zip = new Zip($::log);
print $::query->header;

97
webtools/leak-o-matic/logs.cgi Executable file
Просмотреть файл

@ -0,0 +1,97 @@
#!/usr/bin/perl -w
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
# $Id: logs.cgi,v 1.1 1999/11/16 22:10:11 waterson%netscape.com Exp $
#
#
# ``Front door'' script that shows all of the logs that are
# available for perusal
#
use 5.004;
use strict;
use CGI;
use POSIX;
$::query = new CGI();
$::logdir = $::query->param('logdir' => 'data');
print $::query->header;
print $::query->start_html("Leak-o-Matic");
print qq{
<table border='0' cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td bgcolor='#000000' valign='top'>
<img src='http://www.mozilla.org/images/mozilla-banner.gif'
border="0" alt='mozilla.org' href='http://www.mozilla.org/'>
</td>
</tr>
</table>
<center>
<h1>Leak-o-Matic</h1>
</center>
<p>
Welcome to the Marvelous Leak-o-Matic. Listed below are the leak logs
that are currently available for your perusal.
</p>
<div align='center'>
<table border='0'>
<tr><td align='center' colspan='3'><b>Leaks</b></td></tr>
};
# ``ls'' the directory, ``-1Sr'' returns it sorted by name, reversed, so
# the most recent logs will be at the top.
ZIP: foreach (qx/ls -1Sr $::logdir\/*.zip/) {
chomp;
next ZIP unless (/(\d\d\d\d)(\d\d)(\d\d)/);
my ($year, $month, $day) = ($1, $2, $3);
print "<tr>\n";
print "<td>$month/$day/$year</td>\n";
print "<td><a href='leaks.cgi?log=$_'>Leaks</a></td>\n";
print "<td><a href='bloat-log.cgi?log=$_'>Bloat Log</a></td>\n";
print "</tr>\n";
}
print qq{
</table>
</div>
<p>
For more information on how to use the Leak-o-Matic, see the
<a href="instructions.html">instructions</a>
</p>
};
print '<small>$Id: logs.cgi,v 1.1 1999/11/16 22:10:11 waterson%netscape.com Exp $</small>';
print $::query->end_html;