Add Button with Refresh to Web Interface

Hi,

I have manually (i.e. on the router) added a button that I want in the web interface - and would like it refresh on a "regular" (interval) basis. I got the Lua and HTML code working just fine (again, on the router for testing), and it seems that I need to add JS on the client side - to call for the recurring update (GET / POST I think?). But I admit, it's not clear where exactly to add the code (i.e. which files), and how to get it to show up (FYI, it's on the header, in header.htm, by the Auto Refresh button).

Any pointers / suggestions?

Thanks!

Hi,

OK, I have my JS working fine, and Lua code (separately) ... but not sure where to put a new html / lua file, so that I can use L.Request.poll.add (i.e. I need a URL for the callback, to get data from the router via Lua).

Is there a "correct" place to put the new HTML file (with Lua code in it)? I tried /www, but it seems that doesn't go through the Lua interpreter (right?).

Thanks!

OK, this is likely me, but added an htm file to lucidir (/usr/lib/lua/luci), view inside that ... but can't seem to get to that page? Want to use it in JS, to poll (and GET, request data from the server). I assume that's the right way to do this (I may be wrong!), but can't get to that page for some reason.

Thanks!