From aedc34863ba8221fb358039fd5ac0dc989b5e0af Mon Sep 17 00:00:00 2001 From: szalapski Date: Mon, 7 Mar 2016 09:43:19 -0600 Subject: [PATCH] UX improvements: "show only this" link, more compact/usable list of results --- .../plugins/logparser/LogParserParser.java | 18 +++++++++++++---- .../plugins/logparser/LogParserWriter.java | 20 ++++++++++++++----- .../logparser/LogParserAction/index.jelly | 1 + 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/main/java/hudson/plugins/logparser/LogParserParser.java b/src/main/java/hudson/plugins/logparser/LogParserParser.java index b19714c..bddc97f 100755 --- a/src/main/java/hudson/plugins/logparser/LogParserParser.java +++ b/src/main/java/hudson/plugins/logparser/LogParserParser.java @@ -128,6 +128,15 @@ public LogParserResult parseLog(final Run build) throws IOException, Inter // this header headerForSection.add(shortLink); writer.write(LogParserConsts.getHtmlOpeningTags()); + + // write styles for log body + final String styles = "\n"; + writer.write(styles); + if (this.preformattedHtml) writer.write("
");
         // Read bulks of lines, parse
@@ -241,9 +250,10 @@ public void incrementCounterPerSection(final String status,
     }
 
     private String colorLine(final String line, final String status) {
-        final String color = (String) displayConstants.getColorTable().get(
-                status);
-        final StringBuffer result = new StringBuffer("");
         result.append(line);
@@ -270,7 +280,7 @@ private String addMarkerAndLink(final String line,
         final StringBuffer link = new StringBuffer("
  • "); link.append(statusCountStr); link.append(shortLink); - link.append("

  • "); + link.append(""); final BufferedWriter linkWriter = (BufferedWriter) writers .get(effectiveStatus); diff --git a/src/main/java/hudson/plugins/logparser/LogParserWriter.java b/src/main/java/hudson/plugins/logparser/LogParserWriter.java index 8d5968b..0f9ef01 100755 --- a/src/main/java/hudson/plugins/logparser/LogParserWriter.java +++ b/src/main/java/hudson/plugins/logparser/LogParserWriter.java @@ -100,14 +100,24 @@ private static void writeLinks(final BufferedWriter writer, .toString(); final String hudsonRoot = Hudson.getInstance().getRootUrl(); - final String iconLocation = String.format("%s/images/16x16/", - Functions.getResourcePath()); + final String iconLocation = String.format("%s/images/16x16/", Functions.getResourcePath()); + + final String styles = + "\n"; + writer.write(styles); + final String linksStart = "\""\n" + "" - + linkListDisplayStr + " (" + linkListCount + ")
    \n" + "
      \n"; - + + linkListDisplayStr + " (" + linkListCount + ")
      \n" + + "
        \n"; writer.write(linksStart); // Read the links file and insert here diff --git a/src/main/resources/hudson/plugins/logparser/LogParserAction/index.jelly b/src/main/resources/hudson/plugins/logparser/LogParserAction/index.jelly index 39094f1..5a4eb21 100755 --- a/src/main/resources/hudson/plugins/logparser/LogParserAction/index.jelly +++ b/src/main/resources/hudson/plugins/logparser/LogParserAction/index.jelly @@ -12,6 +12,7 @@

        Console Output (parsed)

        + Show only this