From 28668d0b8e781ed717a7546aeac456c73e349e80 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Mon, 17 Feb 2014 15:26:17 +0000 Subject: - cleanup level code --- contrib/log.php | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'contrib') diff --git a/contrib/log.php b/contrib/log.php index 9c7cf6d10..3f2c8324b 100644 --- a/contrib/log.php +++ b/contrib/log.php @@ -58,7 +58,7 @@ function process ($line, $c) $pid = preg_replace ("/.*[a-z-]*-([0-9]*).*\n/", '\1', $line); $peers[$pid] = $id; } - + $lines[] = array ($date, $component, 0, $level, $msg, $c); } @@ -108,7 +108,7 @@ if ($start !== null || $stop !== null) { - + GNUnet log view @@ -163,15 +163,17 @@ if ($start !== null || $stop !== null) {
@@ -211,6 +213,8 @@ if ($start !== null || $stop !== null) { function showlevel (level) { $("tr").hide(); + $(".btn-showlevel").removeClass("active"); + $("#"+level).addClass("active"); for (var index = 0; index < types.length; ++index) { $("."+types[index]).show(); if (types[index] == level) @@ -254,7 +258,7 @@ if ($start !== null || $stop !== null) { msg("Done loading " + (last-first+1) + " lines."); }); //tr.nextUntil("."+tr.attr("class")).show(); - + } function hide (btn) @@ -266,10 +270,8 @@ if ($start !== null || $stop !== null) { $(function() { $(".btn-showup").on ("click", function(){ show(this, true) }); $(".btn-showdown").on ("click", function(){ show(this, false) }); - $(".btn-showerror").on ("click", function(){ showlevel("ERROR") }); - $(".btn-showwarn").on ("click", function(){ showlevel("WARNING") }); - $(".btn-showinfo").on ("click", function(){ showlevel("INFO") }); - $(".btn-showdebug").on ("click", function(){ showlevel("DEBUG") }); + $(".btn-showlevel").on ("click", function(){ showlevel(this.id) }); + $(".btn-showpeer").on ("click", function(){ showpeer(this.id) }); }); -- cgit v1.2.3