summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEudyptula <eitan@mosenkis.net>2009-07-17 16:58:20 -0400
committerEudyptula <eitan@mosenkis.net>2009-07-17 16:58:20 -0400
commita1ed428db0b333ab8a4acc888e3529cead184c57 (patch)
tree424abab8d4c0d1a74f11f88d3c5466c72c3d9423 /frontend
parentRearranged logviewer for security (diff)
downloadingenue-a1ed428db0b333ab8a4acc888e3529cead184c57.tar.gz
ingenue-a1ed428db0b333ab8a4acc888e3529cead184c57.tar.bz2
ingenue-a1ed428db0b333ab8a4acc888e3529cead184c57.zip
Added metadata back to log viewer
Diffstat (limited to 'frontend')
-rw-r--r--frontend/classes/ansi.php2
-rw-r--r--frontend/pages/logview.php5
2 files changed, 2 insertions, 5 deletions
diff --git a/frontend/classes/ansi.php b/frontend/classes/ansi.php
index 947904b..87f0621 100644
--- a/frontend/classes/ansi.php
+++ b/frontend/classes/ansi.php
@@ -3,7 +3,7 @@ class ansi_to_html {
var $spans=0;
public function process($txt) {
// Clear to end of line
- $txt=str_replace(array("\x1b[K", "\n", "\t", ' '), array('', "<br/>\n", str_repeat('&nbsp;', 8), '&nbsp;'), $txt);
+ $txt=str_replace(array("\x1b[K", "\n", "\t", ' '), array('', "<br/>\n", str_repeat('&nbsp;', 8), '&nbsp;&nbsp;'), $txt);
// Backspace
while (($i=strpos($txt, chr(8))) !== false) {
if ($i == 0) {
diff --git a/frontend/pages/logview.php b/frontend/pages/logview.php
index 10c85dd..ac41c5d 100644
--- a/frontend/pages/logview.php
+++ b/frontend/pages/logview.php
@@ -49,10 +49,7 @@ function body_logview() {
$ansi=new ansi_to_html();
while ($entry=$r->fetch(PDO::FETCH_ASSOC)) {
$entry=new sql_buildlog_entry($entry);
- // $text=str_replace(array("\n", "\t"), array("<br/>\n", str_repeat('&nbsp;', 4)), htmlentities($entry->text));
- // echo '<a name="entry_'.$task->order.'_'.$entry->order.'"'.($entry->stream=='stderr'?' style="color: red" ':'').' title="'.strtoupper($entry->stream).', entry #'.$entry->order.' @ '.date('D j M Y @ H:i:s', $entry->timestamp).' UTC">'.$text.'</a>';
- echo $ansi->process($entry->text);
- // TODO handle tabs properly, move all this into ansi_to_html
+ echo '<'.($t=($entry->stream=='stderr'?'b':'span')).' title="'.strtoupper($entry->stream).', entry #'.$entry->order.' '.date('D j M Y @ H:i:s T', $entry->timestamp).'">'.$ansi->process($entry->text)."</$t>";
}
echo $ansi->reset(); // Clear any leftover <span>s
echo '</div>';