express-debug icon indicating copy to clipboard operation
express-debug copied to clipboard

Ability to add info after rendered

Open hrajchert opened this issue 12 years ago • 3 comments

Hi, I've added a small panel that dumps my mongo queries (not really exportable at the moment), and Im planning to do another that can hold messages in the type of console.log, console.debug, etc

Both of my panels are going to require eventually to update the toolbar after an XHR request or even with sockets.io.

Do you offer any js entry point so I can add info dynamically. If not, would you consider adding it?

hrajchert avatar Jul 17 '13 22:07 hrajchert

Currently there is no functionality to do this, but I've been wanting to add it for some time.

Here is the system I'd like to have:

ID each request XHR polling to /{mount_point}/info?id={req_id}

  • option to disable interval polling
  • option to set polling interval
  • returns JSON data of each panel item that's configured for polling, ex:
    "session": {},
    "mongo_queries": {}
    }
    
    

Update the frontend JS to do the following:  
* redraw panel data
* add a button for a forced poll

**Other considerations**
* Special mount page should be adjusted to see multiple requests
* The injected frontend of the library doesn't have any dependencies, and I'd like to keep it that way (except *maybe* client-side jade for rendering templates)


I'll be able to work on this in the next week or two, but you're welcome to send a pull request if you'd like to add the functionality sooner =)

Thanks!

devoidfury avatar Jul 17 '13 23:07 devoidfury

I was thinking something more in the lines of a global library call. Like

EDT.addData("panel_name", {data})

Which would re render the panel/s

The idea behind it is that you don't force when on how the data travel, and only the specific panels. Of course, this could be done in parallel of the idea you are proposing, and having the XHR polling to /{mount_point}/info?id={req_id} to use the EDT.addData.

So if I like to update in real time with socket.io, I can also do it.

hrajchert avatar Jul 18 '13 03:07 hrajchert

Sure, I'm open the idea.

devoidfury avatar Jul 18 '13 04:07 devoidfury