]> git.pld-linux.org Git - projects/buildlogs.git/commitdiff
- highlight errors
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 8 Feb 2012 13:25:08 +0000 (13:25 +0000)
committerElan Ruusamäe <glen@pld-linux.org>
Wed, 8 Feb 2012 13:25:08 +0000 (13:25 +0000)
index.php

index d4eb1e7b76ea88272143b614210d83f5355bf14e..7de6fb8c7be4f05f6f2261d9ffbaac2d9bb355d2 100644 (file)
--- a/index.php
+++ b/index.php
@@ -88,17 +88,21 @@ echo '<' . '?xml-stylesheet href="#internalStyle" type="text/css"?' . ">\n";
   <style type="text/css"><!--
 A { text-decoration: none; }
 A:hover { text-decoration: underline; }
-H1 { font-family: arial,helvetica,sans-serif; 
-     font-size: 20pt; 
+H1 { font-family: arial,helvetica,sans-serif;
+     font-size: 20pt;
      font-weight: bold;}
-H2 { font-family: arial,helvetica,sans-serif; 
-     font-size: 18pt; 
+H2 { font-family: arial,helvetica,sans-serif;
+     font-size: 18pt;
      font-weight: bold;}
-BODY,TD { font-family: arial,helvetica,sans-serif; 
+BODY,TD { font-family: arial,helvetica,sans-serif;
           font-size: 13pt; }
-TH { font-family: arial,helvetica,sans-serif; 
-     font-size: 13pt; 
+TH { font-family: arial,helvetica,sans-serif;
+     font-size: 13pt;
      font-weight: bold; }
+/* error lines from build logs */
+.error {
+       background-color: #b00;
+}
 //-->
 </style>
  </head>
@@ -293,21 +297,21 @@ function dump_log($tail)
                return "<a href=\"$h\">$c</a>";
        }
 
-       one_item(_("Status"), ($ok == 1 ?  
-                               "<font color=\"green\"><b>"._("OK")."</b></font>" : 
+       one_item(_("Status"), ($ok == 1 ?
+                               "<font color=\"green\"><b>"._("OK")."</b></font>" :
                                "<font color=\"red\"><b>"._("Failed")."</b></a>"));
-       one_item(_("Source URL"), 
-                href("ftp://$buildlogs_server/$f", 
+       one_item(_("Source URL"),
+                href("ftp://$buildlogs_server/$f",
                      "ftp://$buildlogs_server/$f"));
 
        $big_url = "$url?dist=$dist&amp;arch=$arch&amp;ok=$ok&amp;ns=$ns&amp;cnt=$cnt";
        $bu = "$big_url&amp;off=$off";
 
-       one_item(_("text/plain URL"), 
+       one_item(_("text/plain URL"),
                 href("$bu&amp;name=$name_url&amp;id=$id&amp;action=text",
                      _("View!")));
        if ($tail) {
-               one_item(_("full text"), 
+               one_item(_("full text"),
                         href("$bu&amp;name=$name_url&amp;id=$id",
                              _("View!")));
        }
@@ -319,7 +323,7 @@ function dump_log($tail)
         }
        one_item("Date", date("Y/m/d H:i:s", filemtime("$root_directory/$f")));
        /*
-       echo "<tr><td>Here:</td><td>" . 
+       echo "<tr><td>Here:</td><td>" .
                "<a href=\"$url?idx=$idx&amp;ok=$ok&amp;id=$id\">".
                "http://" . getenv("SERVER_NAME") .
                getenv("SCRIPT_NAME") . "?idx=$idx&amp;ok=$ok&amp;id=$id</a>" .
@@ -350,6 +354,10 @@ function dump_log($tail)
                        $s = trim($s);
                }
                $s = htmlspecialchars($s);
+               // highlight errors
+               if (strstr($s, "error")) {
+                       $s = "<span class=error>$s</span>";
+               }
                echo $s;
        }
        end_pre();
@@ -362,7 +370,7 @@ function dump_log($tail)
           [<a href="<?php echo $bu; ?>"><?=_("Back to list of logs")?></a>]
          </td>
          <td align=right>
-          [<a href="<?php echo "$bu&amp;action=qa" 
+          [<a href="<?php echo "$bu&amp;action=qa"
                ?>"><?=_("View rpm -qa of builder")?></a>]
          </td>
         </tr>
@@ -383,7 +391,7 @@ function dump_text()
                return;
 
        echo "# src  : ftp://$buildlogs_server/$f\n";
-       echo "# date   : " .  
+       echo "# date   : " .
                        date("Y/m/d H:i:s", filemtime("$root_directory/$f")) . "\n";
 
        if (preg_match("/\.bz2$/", $f)) {
@@ -433,7 +441,7 @@ function list_archs()
                "alt=\""._("Powered by PLD Linux")."\" border=\"0\" /></a><br />\n" .
             "<small>(c) 2002 ".
             "<a href=\"mailto:feedback@pld-linux.org\">PLD&nbsp;Team</a><br />\n".
-            '$Revision: 1.13 $'.
+            '$Revision: 1.14 $'.
             "</small></div>\n";
 
        # smile ;)
@@ -441,10 +449,10 @@ function list_archs()
        $pow = array("vim", "php", "brain", "power", "electricity",
                     "coffee", "ufo", "penguin", "GNOME", "ELF", "DWARF",
                     "voodoo magic", "Linux", "x-files", "X", "foobar",
-                    "/dev/null", "/dev/zero", "/dev/drzewo", 
+                    "/dev/null", "/dev/zero", "/dev/drzewo",
                     "Leppe'", "matrix", "Neo", "PDP-11",
                     "Ken", "GNU antilope", "PDP-7", "ITS", "Multics",
-                    "foobarbaz", "ed", "Joe", "Unix conspiracy", 
+                    "foobarbaz", "ed", "Joe", "Unix conspiracy",
                     "overclock", "The Right Thing",
                     "The Bad Thing", "Star Treck", "NSA", "NASA",
                     "achelon", "VAX", "Real Programmer",
@@ -524,7 +532,7 @@ function dump_qa($plain)
        $f = get_qa();
 
        if ($plain) {
-               header("Content-type: text/plain"); 
+               header("Content-type: text/plain");
                echo _("# rpm -qa of")." $dist/$arch\n";
        } else {
                echo "<h1>"._("rpm -qa of")." $a</h1>";
@@ -686,7 +694,7 @@ function adv_search()
                        break;
        }
        $query .= " LIMIT $cnt OFFSET $off ";
-    
+
        try {
                $dbh = new PDO("$database");
        } catch (PDOException $e) {
@@ -804,9 +812,9 @@ function welcome()
 <p><?=_("Welcome to PLD Build Logs WWW interface.")?></p><p>
 <?=_("Feel free to email bug reports, complaints and feature requests ")?>
 <!-- ech... niech strace... -->
-<a href="mailto:feedback@pld-linux.org"><?=_("to us")?></a>. <?=_("Positive opinions are also")?> 
+<a href="mailto:feedback@pld-linux.org"><?=_("to us")?></a>. <?=_("Positive opinions are also")?>
 <a href="mailto:feedback@pld-linux.org"><?=_("welcome")?></a> ;)</p>
-<p>Version: $Id: index.php,v 1.13 2010/05/23 17:03:07 adamg Exp $</p>
+<p>Version: $Id: index.php,v 1.14 2010/05/24 07:09:49 adamg Exp $</p>
 </td><td width="20%">&nbsp;</td></tr>
 </table>
 <?php
This page took 0.05201 seconds and 4 git commands to generate.