[luci] displaying an image in a luci app

Jonathan Bennett jbscience87 at gmail.com
Mon May 18 06:14:04 CEST 2015


On Sun, May 17, 2015 at 6:29 PM, Jonathan Bennett <jbscience87 at gmail.com> wrote:
>
> Given a luci app that is a single cbi page, is it possible to include an image in the page? Specifically, the underlying package will have the ability to generate a qr code, and I'd like to display that qr code on the luci page if it exists. Any hints?


For anyone wondering the same thing, the answer is the .template
function. In the cbi file, I added these lines:
    qr = s:option(DummyValue, "note1", translate("Enter custom
access.conf variables below:"))
    qr.template = "fwknopd-qr"
and then add the needed html in appFolder/luasrc/view/fwknopd-qr.htm


It's funny, I searched for hours before asking here, and then found
the answer very soon after sending the email. Figures.

>
> Thanks,
> Jonathan Bennett


More information about the luci mailing list