From 1f90d94331784c4186933aed53a443361e4cd4d2 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 18 Nov 2008 16:45:23 +0000 Subject: [PATCH] * Pretty-print the logs. --- .../lib/HydraFrontend/Controller/Root.pm | 16 ++-- src/HydraFrontend/root/layout.tt | 4 +- src/HydraFrontend/root/log.tt | 4 +- .../root/{ => static/css}/hydra.css | 5 ++ src/HydraFrontend/root/static/css/logfile.css | 84 +++++++++++++++++++ src/HydraFrontend/root/static/js/treebits.js | 50 +++++++++++ src/HydraFrontend/xsl/log2html.xsl | 74 ++++++++++++++++ src/HydraFrontend/xsl/mark-errors.xsl | 24 ++++++ 8 files changed, 250 insertions(+), 11 deletions(-) rename src/HydraFrontend/root/{ => static/css}/hydra.css (98%) create mode 100644 src/HydraFrontend/root/static/css/logfile.css create mode 100644 src/HydraFrontend/root/static/js/treebits.js create mode 100644 src/HydraFrontend/xsl/log2html.xsl create mode 100644 src/HydraFrontend/xsl/mark-errors.xsl diff --git a/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm b/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm index 05b8ce9b..bb668242 100644 --- a/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm +++ b/src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm @@ -340,12 +340,12 @@ sub nixlog :Local { sub loadLog { my ($path) = @_; - # !!! all a quick hack - if ($path =~ /.bz2$/) { - return `cat $path | bzip2 -d`; - } else { - return `cat $path`; - } + + # !!! quick hack + my $pipeline = ($path =~ /.bz2$/ ? "cat $path | bzip2 -d" : "cat $path") + . " | nix-log2xml | xsltproc xsl/mark-errors.xsl - | xsltproc xsl/log2html.xsl - | tail -n +2"; + + return `$pipeline`; } @@ -400,8 +400,8 @@ sub closure :Local { $c->stash->{storePath} = $product->path; $c->stash->{name} = $build->nixname; } - - + + sub end : ActionClass('RenderView') {} diff --git a/src/HydraFrontend/root/layout.tt b/src/HydraFrontend/root/layout.tt index 90f3e57e..ff2bac99 100644 --- a/src/HydraFrontend/root/layout.tt +++ b/src/HydraFrontend/root/layout.tt @@ -14,9 +14,11 @@ [% title %] - + + + + + + + + +
    + + + + linelastline + +
  • + + + + +
  • +
    +
+
+ + + + + + + + error + + + + + + + + + + /... + + + + \ No newline at end of file diff --git a/src/HydraFrontend/xsl/mark-errors.xsl b/src/HydraFrontend/xsl/mark-errors.xsl new file mode 100644 index 00000000..4e91913e --- /dev/null +++ b/src/HydraFrontend/xsl/mark-errors.xsl @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file