Edit Luci labels/add tab v24.10

I want to edit luci to include a tab for my custom web page. Also, I'd like to edit the reboot tab. Can someone please tell me where that is located in 24.10.2. There is nothing located under /usr/lib/lua/luci/view/

you have got some catching up to do ... the directory/s you are looking for is found here now

/www/luci-static/resources/view

before you dig into it, you might want to start with the documentation ...

luci server side
luci client side
ucode

1 Like

Thank you! I'm pretty lost when it comes to making a new drop-down tab. I just want each tab to link to a different ip address and bring up a web page in another browser tab. Any help is appreciated.

I think you are pretty much telling me that these instructions no longer apply:
[OpenWrt Wiki] Adding new elements to LuCI

I did manage to successfully change some text within the reboot page: /www/luci-static/resources/view/system/reboot.js

I've got a PiSugar battery successfully setup with the web UI on OpenWRT 24.10.2!! The only thing is that the poweroff function is such that 'reboot' no longer works. It only powersoff the unit which is why I want to change the labels.

you can use luci-compat if you prefer the old way of doing things.

not sure i follow what it is your are trying to do ... but if i do understand, i suggest you use the same imports and functions used in /www/luci-static/resources/view/system/reboot.js and just call the same function on exit of your current poweroff function.

also make sure to uncheck the "minimize ..." options for luci during make menuconfig as shown in the pic above. its a little easier to read :slight_smile: (or just use the src on github) you can see the function called when the reboot button is clicked.

:ui.createHandlerFn(this,'handleReboot')

That's my plan to just let it call a 'reboot', but relabel it as 'Poweroff' since that what it does. The actual pisugar-poweroff command is run at Stop in the init.d file which essentially blocks reboots.

Are you saying that to change dropdown labels or add additional dropdown menus, I have to rebuild OpenWRT with make menuconfig? Can I just run 'opkg install luci-compat' or something similar on the command line? Then use the old approach to adding dropdowns?

well in that case, just add the reboot keyword to the script, maybe send a log message so you can see it happen with logread -f

just add it as the last line of the current poweroff function ... save yourself alot of tinkering


poweroff {
...

logger "Shutting Down ..." && reboot
}

no, but I assumed you were, you can install luci-compat via opkg or apk,

Yes, However, unless you are going to add it manually each time you update the device... your going to need to build openwrt or at minimum, a custom package that add its.

Also, as i mentioned, all .js files are minimized, which makes it very hard to read, so copy the source from git, make your edits, then just replace the entire .js file with your edited file.

this is still what I recommend, but I will never discourage a learning adventure. Whatever path you decide, I'll help you where i can.

Perhaps I wasn't clear what I was trying to do. I'm okay with whatever function the button is doing, just want the label to say 'Poweroff' Your message prompted me to open the dev code and then AI popped up and led me to this page to change the label as such. Thank you, thank you!

/usr/share/luci/menu.d/luci-mod-system.json

    "admin/system/reboot": {
            "title": "Poweroff",
            "order": 90,
            "action": {
                    "type": "view",
                    "path": "system/reboot"
            },
            "depends": {
                    "acl": [ "luci-mod-system-reboot" ]
1 Like