diff options
author | Bart Polot <bart@net.in.tum.de> | 2014-02-17 15:26:17 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2014-02-17 15:26:17 +0000 |
commit | 28668d0b8e781ed717a7546aeac456c73e349e80 (patch) | |
tree | f8ec109594789c08a07f2525bd1eaa464ef743f9 /contrib | |
parent | d7c754d2a70afa0acd49610996a30f0238bbdc0e (diff) | |
download | gnunet-28668d0b8e781ed717a7546aeac456c73e349e80.tar.gz gnunet-28668d0b8e781ed717a7546aeac456c73e349e80.zip |
- cleanup level code
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/log.php | 26 |
1 files changed, 14 insertions, 12 deletions
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) | |||
58 | $pid = preg_replace ("/.*[a-z-]*-([0-9]*).*\n/", '\1', $line); | 58 | $pid = preg_replace ("/.*[a-z-]*-([0-9]*).*\n/", '\1', $line); |
59 | $peers[$pid] = $id; | 59 | $peers[$pid] = $id; |
60 | } | 60 | } |
61 | 61 | ||
62 | $lines[] = array ($date, $component, 0, $level, $msg, $c); | 62 | $lines[] = array ($date, $component, 0, $level, $msg, $c); |
63 | } | 63 | } |
64 | 64 | ||
@@ -108,7 +108,7 @@ if ($start !== null || $stop !== null) { | |||
108 | <meta charset="utf-8"> | 108 | <meta charset="utf-8"> |
109 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> | 109 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
110 | <meta name="viewport" content="width=device-width, initial-scale=1"> | 110 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
111 | 111 | ||
112 | <title>GNUnet log view</title> | 112 | <title>GNUnet log view</title> |
113 | 113 | ||
114 | <!-- Latest compiled and minified Bootstrap CSS --> | 114 | <!-- Latest compiled and minified Bootstrap CSS --> |
@@ -163,15 +163,17 @@ if ($start !== null || $stop !== null) { | |||
163 | <body> | 163 | <body> |
164 | <div class="btn-toolbar" role="toolbar"> | 164 | <div class="btn-toolbar" role="toolbar"> |
165 | <div class="btn-group"> | 165 | <div class="btn-group"> |
166 | <button class="btn btn-danger btn-showerror"><span class="glyphicon glyphicon-fire"></span> Error</button> | 166 | <button id="ERROR" class="btn btn-danger btn-showlevel"><span class="glyphicon glyphicon-fire"></span> Error</button> |
167 | <button class="btn btn-warning btn-showwarn"><span class="glyphicon glyphicon-exclamation-sign"></span> Warning</button> | 167 | <button id="WARNING" class="btn btn-warning btn-showlevel"><span class="glyphicon glyphicon-exclamation-sign"></span> Warning</button> |
168 | <button class="btn btn-info btn-showinfo"><span class="glyphicon glyphicon glyphicon-info-sign"></span> Info</button> | 168 | <button id="INFO" class="btn btn-info btn-showlevel active"><span class="glyphicon glyphicon glyphicon-info-sign"></span> Info</button> |
169 | <button class="btn btn-default btn-showdebug"><span class="glyphicon glyphicon glyphicon-wrench"></span> Debug</button> | 169 | <button id="DEBUG" class="btn btn-default btn-showlevel"><span class="glyphicon glyphicon glyphicon-wrench"></span> Debug</button> |
170 | </div> | 170 | </div> |
171 | <div class="btn-group"> | 171 | <div class="btn-group"> |
172 | <?php foreach($peers as $pid=>$id): ?> | 172 | <?php foreach($peers as $pid=>$id): ?> |
173 | <button class="btn btn-default active"><?php echo $id ?></button> | 173 | <button id="<?php echo $id ?>" class="btn btn-default btn-showpeer active"><?php echo $id ?></button> |
174 | <?php endforeach ?> | 174 | <?php endforeach ?> |
175 | <button id="all" class="btn btn-default btn-showpeer">All</button> | ||
176 | <button id="none" class="btn btn-default btn-showpeer">None</button> | ||
175 | </div> | 177 | </div> |
176 | </div> | 178 | </div> |
177 | <div id="msg" class="alert alert-success"></div> | 179 | <div id="msg" class="alert alert-success"></div> |
@@ -211,6 +213,8 @@ if ($start !== null || $stop !== null) { | |||
211 | function showlevel (level) | 213 | function showlevel (level) |
212 | { | 214 | { |
213 | $("tr").hide(); | 215 | $("tr").hide(); |
216 | $(".btn-showlevel").removeClass("active"); | ||
217 | $("#"+level).addClass("active"); | ||
214 | for (var index = 0; index < types.length; ++index) { | 218 | for (var index = 0; index < types.length; ++index) { |
215 | $("."+types[index]).show(); | 219 | $("."+types[index]).show(); |
216 | if (types[index] == level) | 220 | if (types[index] == level) |
@@ -254,7 +258,7 @@ if ($start !== null || $stop !== null) { | |||
254 | msg("Done loading " + (last-first+1) + " lines."); | 258 | msg("Done loading " + (last-first+1) + " lines."); |
255 | }); | 259 | }); |
256 | //tr.nextUntil("."+tr.attr("class")).show(); | 260 | //tr.nextUntil("."+tr.attr("class")).show(); |
257 | 261 | ||
258 | } | 262 | } |
259 | 263 | ||
260 | function hide (btn) | 264 | function hide (btn) |
@@ -266,10 +270,8 @@ if ($start !== null || $stop !== null) { | |||
266 | $(function() { | 270 | $(function() { |
267 | $(".btn-showup").on ("click", function(){ show(this, true) }); | 271 | $(".btn-showup").on ("click", function(){ show(this, true) }); |
268 | $(".btn-showdown").on ("click", function(){ show(this, false) }); | 272 | $(".btn-showdown").on ("click", function(){ show(this, false) }); |
269 | $(".btn-showerror").on ("click", function(){ showlevel("ERROR") }); | 273 | $(".btn-showlevel").on ("click", function(){ showlevel(this.id) }); |
270 | $(".btn-showwarn").on ("click", function(){ showlevel("WARNING") }); | 274 | $(".btn-showpeer").on ("click", function(){ showpeer(this.id) }); |
271 | $(".btn-showinfo").on ("click", function(){ showlevel("INFO") }); | ||
272 | $(".btn-showdebug").on ("click", function(){ showlevel("DEBUG") }); | ||
273 | }); | 275 | }); |
274 | </script> | 276 | </script> |
275 | </body> | 277 | </body> |