I've discovered the beauty of CBI and want to create a "Quick WiFi Setup" page, but I have a question.
Right now this is what my cbi file looks like:
local iface = luci.model.uci.cursor():get_first("wireless", "wifi-iface")
m = Map("wireless", "WiFi Quick Config")
s1 = m:section(NamedSection, iface, "wifi-iface", "WiFi Options")
p11 = s1:option(Value,"ssid","WiFi Name")
p12 = s1:option(Value,"key","WiFi Password")
s2 = m:section(NamedSection, "radio0", "wifi-device", "WiFi Device Options")
p21 = s2:option(ListValue, "channel", "Channel")
p21:value("auto", "Auto Channel")
p21:value("1", "Channel 1")
p21:value("2", "Channel 2")
p21:value("3", "Channel 3")
p21:value("4", "Channel 4")
p21:value("5", "Channel 5")
p21:value("6", "Channel 6")
p21:value("7", "Channel 7")
p21:value("8", "Channel 8")
p21:value("9", "Channel 9")
p21:value("10", "Channel 10")
p21:value("11", "Channel 11")
return m
And it of course creates two sections (as per screenshot below).
How can I roll all these settings into one section visually?
Also, how can I create an item which would depend on another item not containing specific value, but just being non-empty? I want to add the encryption only if the password is non-empty. What's the best way to do that?