Web interface

From The Neuros Technology Wiki

Jump to: navigation, search

Contents

[edit] OSD Web Interface

web interface as of 2/19/08
web interface as of 2/19/08

The OSD web interface I am developing is built on and with various components. This page describes exactly how the interface is implemented.

Development is still in progress, mainly now with developing the libraries that the web scripts can call upon. Documentation for them will be created (I promise!) for them once I deem them usable.

A lot of this page describes work done since the pre-release I made. If you can help with any of the 'Outstanding Issues' below then please do so :)


[edit] lighttpd

lighttpd is a lightweight webserver which is already included in the OSD firmware. With the addition of mod_fastcgi it is able to run Lua scripts via Luaetta.

A lighttpd.conf that works with luaetta, as well as a mod_fastcgi binary are included in the pre-release I made.

[edit] Luaetta

When lighttpd receives a request for a Lua file it uses FastCGI to pass the request to Luaetta. Luaetta is responsible for loading and executing the script, and returning the result.


A simple Luaetta script:

function onRequest(env, post)
print "<html><body>Hello world!</body></html>"
end

env is a table containing various request-related information post, when present, indicates that HTTP POST data was submitted. It is an array of tables, each entry in post[] describes a single form. Often there is only one.

POST data can be handled with getBodyData(id) or saveBodyData(id, filename) where id is the entry in post[].

[edit] Wooble

A framework I have made for modular web interface.

It allows adding modules, which appear as tabs. Each module may implement any number of views.

More info here: http://matthewwild.co.uk/projects/wooble

[edit] Lua

Help on Lua scripting is available at http://lua.org/manual/5.1/ and http://lua.org/pil/

There is also #lua on Freenode, and myself (MattJ).

[edit] Libraries

A revived Lobster gives access to CoolerCore and CoolerMedia APIs (anything else not wrapped yet). Libraries are 'coolercore' and 'coolermedia'.

In addition there is a pure-Lua 'recordings' library for modifying scheduled recordings, and 'lfs' (Lua File System) for accessing files and folders.

A pure-Lua configuration library 'config' is also available for saving persistent settings.

The 'lol' library has various helper functions for dealing with HTTP/HTML.


[edit] Outstanding issues

  • 'recordings' library for scheduled recordings not complete... lack of understanding of .recordings file (Fixed in AZ)
  • Recording via NmsRecord() requires integration
  • Some 'unfriendly' (to SWIG/Lua) Cooler functions need wrapping nicely

More at the wooble bug tracker...

[edit] Possible future modules

  • EPG
  • Admin, auto-update, security management
  • Lua/shell code execution (alternative to telnet)
  • about:config style editor of settings
  • IR Blaster and/or Serial Control (web client acting as a universal remote)
Personal tools