[LEDE-DEV] Help with luci: building DynamicList out of uci configuration parameters

Mauro Mozzarelli openwrt at ezplanet.net
Sat Mar 4 04:20:13 PST 2017


Hello,


I am a newby with luci and I hope to find some help.


I need to present a DynamicList of values that I need to take from a 
configuration file

I tried to look at get_zones and get_networks functions as an example to 
build my own code, but when I invoke them like this:


local net = require "luci.model.network"

rs = vs:option(DynamicList, "real", "Real Servers")
for _, v in pairs(net:get_networks()) do
     rs:value(v)
end

In the DynamicList I get only

table: 0x77aa80

...

and so on, rather than network names.


The plan is to get the existing function to return net names, and then 
copy+adapt for my configuration, but I can't get meaningful results.

Either this way or another I need to fill my DynamicList with values 
from a configuration file structured as follows:

config real
     option ipaddr '192.168.10.19'
     option weight '1'

config real
     option ipaddr '192.168.10.20'
     option weight '1'

In my case I need to get all of the ipaddr inside the DynamicList.


Please could anyone help?


Mauro




More information about the Lede-dev mailing list