summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2014-02-17 15:26:23 +0000
committerBart Polot <bart@net.in.tum.de>2014-02-17 15:26:23 +0000
commit178af2467939701605697f33e740ac6ffb59097e (patch)
tree480dc73e02cd7f70d635ba13b1351cf4d9fcb630 /contrib
parentf9e1f26e0afb4ff993a4effa6af6cff0fc600674 (diff)
-add class and peer_id to ajax-loaded rows
Diffstat (limited to 'contrib')
-rw-r--r--contrib/log.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/contrib/log.php b/contrib/log.php
index ee6fc09eb..00f49f83b 100644
--- a/contrib/log.php
+++ b/contrib/log.php
@@ -201,6 +201,7 @@ if ($start !== null || $stop !== null) {
<script>
var types = ["ERROR", "WARNING", "INFO", "DEBUG"];
+ var peers = {<?php foreach($peers as $pid=>$id) echo "'$pid': '$id', "; ?>};
var msg_timeout;
function msg (content)
@@ -285,10 +286,16 @@ if ($start !== null || $stop !== null) {
data: { a: first, z: last }
}).done(function ( resp ) {
var loc = $("#"+(first-1));
+ var trs = $(resp);
+ for (var peer in peers) {
+ console.log (peer + "=>" + peers[peer]);
+ trs.filter("."+peer).removeClass(peer).addClass(peers[peer]).find("td.peer").html(peers[peer]);
+ }
+ console.log (trs);
if (loc.length > 0)
- loc.after(resp);
+ loc.after(trs);
else {
- $("#"+(last+1)).before(resp);
+ $("#"+(last+1)).before(trs);
}
msg("Done loading " + (last-first+1) + " lines.");
});