[luci] luci crashing when too much values in a ListValue

Pau hakais at gmail.com
Tue Aug 2 22:12:58 CEST 2011


Dammit, I think you are right. I'm creating the values recursively...
However I need to create this list from cfgvalue because I need to know for
which wifi card is the system drawing the model.
I mean, my UCI configuration is something like that:
--------------------------------
config wireless
  name wlan1
  option channel 1

config wireless
  name wlan2
  option channel 3

config wireless
  name wlan3
  option channel 4
--------------------------------

So, just with this line:
 channel = s_wireless:option(ListValue,"channel","Channel")
I can see in LuCi three listvalues, one for each wireless configuration.

Also each wireless card could support different channels, I need to take
this information from  luci.sys.wifi.channels()
Then the only way to do this I found is using cfgvalue, asking to uci wich
card is the actual one (m.uci:get("qmp", section, "device"))  and depending
on putting a different set of values.

Do you kwno any other way to do that?

--
./p4u



2011/8/2 Bryan Mayland <bmayland at leoninedev.com>

> I believe you're recursively adding items to the list?  You're creating a
> ListValue for selecting channels but for each value in the list you're
> adding a list of values.   You shouldn't be building the list from
> cfgvalue(), which I believe is for converting the UCI value to a display
> value or at least something along those lines.
>
>
> On 8/2/2011 1:31 PM, Pau wrote:
>
>> ------------------------------**------------------------------**
>> -----------------------
>> channel = s_wireless:option(ListValue,"**channel","Channel")
>> channel:value("0","0")
>>
>> function channel.cfgvalue(self, section)
>>    local dev = m.uci:get("qmp", section, "device")
>>    for _,ch in ipairs(luci.sys.wifi.channels(**dev)) do
>>        channel:value(ch.channel, ch.channel)
>>    end
>>    return ListValue.cfgvalue(self, section)
>> end
>> ------------------------------**------------------------------**
>> -----------------------
>>
>> When LuCi is trying to show this page, still thinking all the time showing
>> nothing.
>>
> ______________________________**_________________
> luci mailing list
> luci at lists.subsignal.org
> https://lists.subsignal.org/**mailman/listinfo/luci<https://lists.subsignal.org/mailman/listinfo/luci>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsignal.org/pipermail/luci/attachments/20110802/ce814ba6/attachment.html>


More information about the luci mailing list