[luci] Creating a first time walk through sequence in LuCI gui

Methos methos.oldest at gmail.com
Sun Aug 24 22:03:31 CEST 2014


Hi,

I am new to LuCI. I want to modify GUI for OpenWRT such that when the user
accesses it for the very first time after flashing router, he is taken to a
different page that shows him a consent form with a checkbox and "Next"
button. Upon agreeing it and clicking "Next", it takes him to few
configuration pages. On each such page, he will input some configuration
option until the configuration is finished.

After this, user will be taken to the regular GUI view.

I have read through LuCI wiki, references, how-tos etc. I have familiarized
myself with CBI, templates, actions and views. I have even added GUI
sub-menus using CBI+templates by reading existing code.

However, I am not sure how to stop LuCI GUI from showing the normal user
interface if configuration wanted by me is not done. From my understanding
of LuCI, my first idea for this is:

1. Create a file to indicate if configuration is finished or not.
2. If the file is not created, then stop LuCI from reading the "index()"
functions of all controllers.
    Instead, make it somehow just show my own custom created initial
walk-through pages.

Is this the right way to do so?

I downloaded LuCI source code and tried to read through it. I found the
file:
admin-full/luasrc/controller/admin/index.lua
that I think creates index() functions.

I also found:
./libs/web/luasrc/dispatcher.lua
which has createindex_fastindex() that seems to create indexes using 'C'
library.

However, I am not able to make any further progress than that at this
moment. Any pointers would be helpful.

Also, to create the "Next" button and a consent form webpage, is it
sufficient to reuse templates from "./luci/view/cbi/"?
(I am thinking of using "Button", "Flag" classes with existing template
files)

Thank you for your help.

-M
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsignal.org/pipermail/luci/attachments/20140824/aedb555a/attachment.html>


More information about the luci mailing list