Add Custom Luci Page From Source

Hi,

I am trying to add a custom page(s) to the WebUI for a custom openwrt build. I have been working with Luci to create a new application module to add, but have so far not been able to get it to generate on the html pages. Are there any existing examples on how to add a new page to a menu item which contains something as simple as a button which runs a script? I would like to do this from source, but if this can only be done on device then that is fine too and I will work backwards if needed.

Thank you,
Jared-DEDW

You could just about look any package with a luci app and use it as a base as most configures the apps settings in a config file somehow and commit's it with a restart script from Luci.

1 Like

Thank you for the reply. This is what I have been doing so far. I based a new app module on the luci-app-sysupgrade package and attempted to build a new page to appear under the System menu like the Attended SysUpgrade page does. I am able to integrate this into my Luci feed in my openwrt image build, but when I load the image onto my device I cannot seem to get the UI to show my new page. There seems to be a component of the app package integration to the html pages that I am missing during the build. I have reviewed the makefiles for the app package and for Luci, but cannot seem to find what is missing.

Thanks,
Jared

you can add custom feeds from make menuconfig.

but for the luciapp integration just pick an app that you are not using and use that as a base, as for it not showing up I'm not sure on that one as it depends on your code , you would be best to submit you code so we can look at it and offer suggestions.

refer to:

if your code is in /feeds/luci/applications folder, run ./scripts/feeds install -a before make menuconfig, then your app will be in the menuconfig lists.

The following is my luci-app-xxx template (lua files), this sample code, should be put in package folder, but it still could be in the Luci - Applications lists in the menuconfig.

Hi,

I'm actually looking / thinking about the same thing;

I was in need of a parent control function for the televisions and kids ipad's / iphones. I have it technically working with:

-- Every device has a DHCP reservation with a TAG
-- With the TAG they get a different dns server (other openwrt device, but could also be a different dns instance
-- I use the luci-app-commands to make my scripts executable via a "public" web link (basicly my html file calls these luci commands file.
-- scripts are: block youtube / enable youtube, block netflix, enable netflix on dns level (domains to NULL, and smart tv fully block or enable (IP filter DENY rule in the firewall)
-- I created an html file calling the luci commands script(s) when pushed on a button. (Enable / Disable)

But ...
For starters, the html is not username/password protected (i'm waiting until the little ones find that out :slight_smile: )
It could do so much more, functionality wise, but also for the community/parents.

I'm in the progress of thinking about a luci-app-parent-control

To wrap it up for now; Perhaps within this post you could proceed with the luci commands app?

Regards,

Alternative solution, easier to maintain during system upgrades: Create separate HTML/PHP-code, instead of using LuCI and use uhttpd as server.

Sounds like the functions you described, already in some of adblock apps (black/white list).

this is a chinese app, you could check it by google translation.