1 -- Copyright 2016 David Thornley <david.thornley@touchstargroup.com>
2 -- Licensed to the public under the Apache License 2.0.
4 local map, section, net = ...
6 local device, apn, pincode, username, password
7 local auth, ipv6, delay, mtu
10 device = section:taboption("general", Value, "device", translate("Modem device"))
11 device.rmempty = false
13 local device_suggestions = nixio.fs.glob("/dev/cdc-wdm*")
15 if device_suggestions then
17 for node in device_suggestions do
23 apn = section:taboption("general", Value, "apn", translate("APN"))
26 pincode = section:taboption("general", Value, "pincode", translate("PIN"))
29 auth = section:taboption("general", Value, "auth", translate("Authentication Type"))
30 auth:value("both", "PAP/CHAP (both)")
31 auth:value("pap", "PAP")
32 auth:value("chap", "CHAP")
33 auth:value("none", "NONE")
37 username = section:taboption("general", Value, "username", translate("PAP/CHAP username"))
38 username:depends("auth", "pap")
39 username:depends("auth", "chap")
40 username:depends("auth", "both")
43 password = section:taboption("general", Value, "password", translate("PAP/CHAP password"))
44 password:depends("auth", "pap")
45 password:depends("auth", "chap")
46 password:depends("auth", "both")
47 password.password = true
50 if luci.model.network:has_ipv6() then
51 ipv6 = section:taboption("advanced", Flag, "ipv6", translate("Enable IPv6 negotiation"))
52 ipv6.default = ipv6.disabled
55 delay = section:taboption("advanced", Value, "delay",
56 translate("Modem init timeout"),
57 translate("Maximum amount of seconds to wait for the modem to become ready"))
58 delay.placeholder = "10"
59 delay.datatype = "min(1)"
61 mtu = section:taboption("advanced", Value, "mtu", translate("Override MTU"))
62 mtu.placeholder = "1500"
63 mtu.datatype = "max(9200)"