Permalink
Browse files

Added object exploration to debug.log

  • Loading branch information...
1 parent 38756fe commit 85d6443eef47cacae3100286d6d8403b5da89741 Connorhd committed Nov 23, 2009
Showing with 12 additions and 6 deletions.
  1. +6 −4 debug.js
  2. +6 −2 index.html
View
@@ -82,9 +82,11 @@ debug.log = function (msg) {
for (var id in sessions) {
if (!sessions.hasOwnProperty(id)) continue;
var session = sessions[id];
-
- session.queue.push(msg);
-
+
+ session.cmd += 1;
+ session.result[session.cmd] = msg;
+ session.queue.push(session.cmd);
+
if (session.timeout !== undefined) {
clearTimeout(session.timeout);
}
@@ -123,7 +125,7 @@ function hasChildren(obj) {
return children;
}
-function getObj (id, cmd, key) {
+function getObj(id, cmd, key) {
if (sessions[id] === undefined || sessions[id].result[cmd] === undefined)
return {};
View
@@ -106,10 +106,14 @@
function(data){
$.each(data, function(i, x) {
response = '<div class="response">'
- + ' <code class="result">'+x+'</code>'
+ + ' <ul class="tree" id="cmd_'+x+'"></ul>'
+ '</div>'
;
- $("#console").prepend(response);
+ $("#console").prepend(response);
+ $("#cmd_"+x).treeview({
+ url: "/tree?cmd="+x+"&id="+id,
+ unique: true
+ });
});
longPollConsole();
});

0 comments on commit 85d6443

Please sign in to comment.