X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=contrib%2Flog.php;h=b2ca9ed6cde69f7cd88386b6851ba249532b7bf2;hb=9a112a7aa7c1703a9489da7306293ee1b9df7331;hp=9a7f0a7764c5fd907d9d26ad069c36994ae8eb47;hpb=1a8b577397f739d74bc977bf2faa9b238c73d840;p=oweals%2Fgnunet.git diff --git a/contrib/log.php b/contrib/log.php index 9a7f0a776..b2ca9ed6c 100644 --- a/contrib/log.php +++ b/contrib/log.php @@ -3,8 +3,12 @@ $path='log'; $lines = array(); $peers = array(); +$comps = array(); $ajax = FALSE; -$colors = array('#F00', '#0C0', '#44F', '#FF0', '#F0F', '#0FF'); +$colors = array('#F00', '#F80', '#FF0', + '#4F0', '#0A0', + '#22F', '#ADF', '#0FF', '#F0F', '#508', '#FAA', + '#FFF', '#AAA', '#666', '#222'); function render_row ($d, $component, $pid, $level, $msg, $c) { @@ -16,18 +20,17 @@ function render_row ($d, $component, $pid, $level, $msg, $c) list($comp,$peer) = explode (',', preg_replace ('/(.*)-(\d*)/', '\1,\2', $component)); $peer = array_key_exists ($peer, $peers) ? $peers[$peer] : $peer; $date = $d ? $d->format('Y-m-d'). $d->format('H:i:s') : ""; - echo "
$msg
Processed in seconds.
+Rendered in seconds.
@@ -228,39 +254,60 @@ if ($start !== null || $stop !== null) { $(".btn-showlevel").removeClass("active"); $("#"+level).addClass("active"); for (var index = 0; index < types.length; ++index) { - $(".btn-showpeer.active").each(function(){ - $("."+types[index]+"."+this.id).show(); + $("#btn-showpeer > .btn-element.active").each(function(){ + var peer = this.id; + $("#btn-showcomp > .btn-element.active").each(function(){ + $("."+types[index]+"."+peer+"."+this.id).show(); + }); }); if (types[index] == level) return; } } - function shownone() + function shownone(btn) { - $(".btn-showpeer").removeClass("active"); - $("tbody > tr").hide(); + $(btn).parents(".btn-group").children(".btn-element.active").each(function(){$(this).click()}); } - function showall() + function showall(btn) { - $(".btn-showpeer:not(.active)").each(function(){showpeer(this.id)}); + $(btn).parents(".btn-group").children(".btn-element:not(.active)").each(function(){$(this).click()}); } function showpeer (peer) { $("#"+peer).toggleClass("active"); if ($("#"+peer).hasClass("active")) { - for (var index = 0; index < types.length; ++index) { - var className = "." + types[index] + "." + peer; - $(className).show(); - if ($("#"+types[index]).hasClass("active")) - return; - } + $("#btn-showcomp > .btn-element.active").each(function(){ + for (var index = 0; index < types.length; ++index) { + var className = "." + types[index] + "." + peer + "." + this.id; + $(className).show(); + if ($("#"+types[index]).hasClass("active")) + return; + } + }); } else { $("."+peer).hide(); } } + + function showcomp (comp) + { + $("#"+comp).toggleClass("active"); + if ($("#"+comp).hasClass("active")) { + $("#btn-showpeer > .btn-element.active").each(function(){ + for (var index = 0; index < types.length; ++index) { + var className = "." + types[index] + "." + comp + "." + this.id; + $(className).show(); + if ($("#"+types[index]).hasClass("active")) + return; + } + }); + } else { + $("."+comp).hide(); + } + } function load_debug (btn, up) { @@ -299,10 +346,8 @@ if ($start !== null || $stop !== null) { var loc = $("#"+(first-1)); var trs = $(resp); for (var peer in peers) { - console.log (peer + "=>" + peers[peer]); trs.filter(".P-"+peer).removeClass('P-'+peer).addClass('P-'+peers[peer]).find("td.peer").html(peers[peer]); } - console.log (trs); if (loc.length > 0) loc.after(trs); else { @@ -324,9 +369,10 @@ if ($start !== null || $stop !== null) { $(".btn-showup").on ("click", function(){ load_debug(this, true) }); $(".btn-showdown").on ("click", function(){ load_debug(this, false) }); $(".btn-showlevel").on ("click", function(){ showlevel(this.id) }); - $(".btn-showpeer").on ("click", function(){ showpeer(this.id) }); - $("#btn-showall").on ("click", function(){ showall() }); - $("#btn-shownone").on ("click", function(){ shownone() }); + $("#btn-showpeer > .btn-element").on ("click", function(){ showpeer(this.id) }); + $("#btn-showcomp > .btn-element").on ("click", function(){ showcomp(this.id) }); + $(".btn-showall").on ("click", function(){ showall(this) }); + $(".btn-shownone").on ("click", function(){ shownone(this) }); });