From c2515982416549d64a9189f6d5ea1068e43c4be4 Mon Sep 17 00:00:00 2001 From: aszlig Date: Thu, 2 Apr 2015 17:29:48 +0200 Subject: [PATCH] plain-reload: Constrain tail output to 50 lines. There are quite a lot of build outputs which have lines with a length exceeding the width of the taillog
 and thus visually produce more
lines than 50. This causes the tail "box" to change height frequently
and to get to the bottom you need to scroll down.

We now set a fixed line-height to 120% of the font size and cap the
maximum height based on that value (50 * 1.2 = 60). It's probably not
nice to override the line-height, but max-lines is currently only
available using browser-specific property names. But after all it's just
for the tail output, if people complain about the line-height, we can
still change it :-)

Signed-off-by: aszlig 
---
 src/root/plain-reload.tt      | 1 +
 src/root/static/css/hydra.css | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/src/root/plain-reload.tt b/src/root/plain-reload.tt
index 7448d8ff..687c7b7a 100644
--- a/src/root/plain-reload.tt
+++ b/src/root/plain-reload.tt
@@ -15,6 +15,7 @@ function injectTail() {
         dataType: "text",
         success: function (tail) {
             $("#contents").text(tail);
+            $("#contents").scrollTop($("#contents").get(0).scrollHeight);
         }
     });
 }
diff --git a/src/root/static/css/hydra.css b/src/root/static/css/hydra.css
index d55dcd7c..d8f848bb 100644
--- a/src/root/static/css/hydra.css
+++ b/src/root/static/css/hydra.css
@@ -119,3 +119,9 @@ span.keep-whitespace {
 .build-status {
     max-width: none; /* don't apply responsive design to status images */
 }
+
+pre.taillog {
+    line-height: 1.2em;
+    max-height: 60em;
+    overflow: hidden;
+}