[luci] Custom buttons and functions

Hanno Schupp hanno.schupp at gmail.com
Thu Sep 24 13:14:23 CEST 2009


Dera All,
I have switched from XWrt to Luci and am quite impressed with he concepts
and vision of the approach. I have managed to create my own CBI pages
updating config data, manipulate the menus, and link my custom functions.
All good.

Now I want to add some custom functions, particular buttons, and I am a bit
stuck - not even sure how to start. I am asking for some serious pointers.

I am trying to create a page that includes the following elements:

a) A button that points to a URL outside the router, but with part of the
URL parameters set by uci variables (set in a /etc/configfile
b) A button that allows to start a daemon or stop it. Button should toggle
Start/Stop depending on the status of the programme
c) A button that triggers a shell script programme when pressed. However,
depending on a configuration option stored in one of the /etc/config files
the button should either show, ready for action, or show a text in lieu of
the button, indicating the function is not available.

I have no idea how to approach these quite easy tasks in a html/lua
environment. As I said I am used to the html/shell script solution of the
XWRT and the old OpenWrt webif.

Can anyone point out how to achieve these functions, either by example,
documentation, or pointing out relevant examples in the current code base?
Please assume my lua knowledge is very basic.

I appreciate any hint.

Cheer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.subsignal.org/pipermail/luci/attachments/20090924/79163981/attachment.htm 


More information about the luci mailing list