Show
Ignore:
Timestamp:
11/07/10 23:38:37 (3 years ago)
Author:
jow
Message:

modules/admin-full: rework dnsamasq page, get rid of options, add tabs, better help texts

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • luci/trunk/modules/admin-full/luasrc/model/cbi/admin_services/dnsmasq.lua

    r5925 r6397  
    2222s.addremove = false 
    2323 
    24 s:option(Flag, "domainneeded", 
     24s:tab("general", translate("General Settings")) 
     25s:tab("files", translate("Resolv and Hosts Files")) 
     26s:tab("tftp", translate("TFTP Settings")) 
     27s:tab("advanced", translate("Advanced Settings")) 
     28 
     29s:taboption("general", Flag, "domainneeded", 
    2530    translate("Domain required"), 
    2631    translate("Don't forward <abbr title=\"Domain Name System\">DNS</abbr>-Requests without " .. 
    2732        "<abbr title=\"Domain Name System\">DNS</abbr>-Name")) 
    2833 
    29 s:option(Flag, "authoritative", 
     34s:taboption("general", Flag, "authoritative", 
    3035    translate("Authoritative"), 
    3136    translate("This is the only <abbr title=\"Dynamic Host Configuration Protocol\">DHCP</" .. 
    3237        "abbr> in the local network")) 
    3338 
    34 s:option(Flag, "boguspriv", 
    35     translate("Filter private"), 
    36     translate("Don't forward reverse lookups for local networks")) 
    37  
    38 s:option(Flag, "filterwin2k", 
    39     translate("Filter useless"), 
    40     translate("filter useless <abbr title=\"Domain Name System\">DNS</abbr>-queries of " .. 
    41         "Windows-systems")) 
    42  
    43 s:option(Flag, "localise_queries", 
    44     translate("Localise queries"), 
    45     translate("localises the hostname depending on its subnet")) 
    46  
    47 s:option(Value, "local", 
    48     translate("Local Server")) 
    49  
    50 s:option(Value, "domain", 
    51     translate("Local Domain")) 
    52  
    53 s:option(Flag, "expandhosts", 
    54     translate("Expand Hosts"), 
    55     translate("adds domain names to hostentries in the resolv file")) 
    56  
    57 s:option(Flag, "nonegcache", 
    58     translate("don't cache unknown"), 
    59     translate("prevents caching of negative <abbr title=\"Domain Name System\">DNS</abbr>-" .. 
    60         "replies")) 
    61  
    62 s:option(Flag, "readethers", 
     39 
     40s:taboption("files", Flag, "readethers", 
    6341    translate("Use <code>/etc/ethers</code>"), 
    6442    translate("Read <code>/etc/ethers</code> to configure the <abbr title=\"Dynamic Host " .. 
    6543        "Configuration Protocol\">DHCP</abbr>-Server")) 
    6644 
    67 s:option(Value, "leasefile", 
     45s:taboption("files", Value, "leasefile", 
    6846    translate("Leasefile"), 
    6947    translate("file where given <abbr title=\"Dynamic Host Configuration Protocol\">DHCP</" .. 
    7048        "abbr>-leases will be stored")) 
    7149 
    72 s:option(Value, "resolvfile", 
    73     translate("Resolvfile"), 
     50s:taboption("files", Flag, "noresolv", 
     51    translate("Ignore resolve file")).optional = true 
     52 
     53rf = s:taboption("files", Value, "resolvfile", 
     54    translate("Resolve file"), 
    7455    translate("local <abbr title=\"Domain Name System\">DNS</abbr> file")) 
    7556 
    76 s:option(Flag, "nohosts", 
    77     translate("Ignore <code>/etc/hosts</code>")).optional = true 
    78  
    79 s:option(Flag, "strictorder", 
     57rf:depends("noresolv", "") 
     58rf.optional = true 
     59 
     60 
     61s:taboption("files", Flag, "nohosts", 
     62    translate("Ignore Hosts files")).optional = true 
     63 
     64hf = s:taboption("files", DynamicList, "addnhosts", 
     65    translate("Additional Hosts files")) 
     66 
     67hf:depends("nohosts", "") 
     68hf.optional = true 
     69 
     70 
     71s:taboption("advanced", Flag, "boguspriv", 
     72    translate("Filter private"), 
     73    translate("Do not forward reverse lookups for local networks")) 
     74 
     75s:taboption("advanced", Flag, "filterwin2k", 
     76    translate("Filter useless"), 
     77    translate("Do not forward requests that cannot be answered by public name servers")) 
     78 
     79s:taboption("advanced", Flag, "localise_queries", 
     80    translate("Localise queries"), 
     81    translate("Localise hostname depending on the requesting subnet if multiple IPs are available")) 
     82 
     83s:taboption("general", Value, "local", 
     84    translate("Local server"), 
     85    translate("Local domain specification. Names matching this domain are never forwared and resolved from DHCP or hosts files only")) 
     86 
     87s:taboption("general", Value, "domain", 
     88    translate("Local domain"), 
     89    translate("Local domain suffix appended to DHCP names and hosts file entries")) 
     90 
     91s:taboption("advanced", Flag, "expandhosts", 
     92    translate("Expand hosts"), 
     93    translate("Add local domain suffix to names served from hosts files")) 
     94 
     95s:taboption("advanced", Flag, "nonegcache", 
     96    translate("No negative cache"), 
     97    translate("Do not cache negative replies, e.g. for not existing domains")) 
     98 
     99s:taboption("advanced", Flag, "strictorder", 
    80100    translate("Strict order"), 
    81     translate("<abbr title=\"Domain Name System\">DNS</abbr>-Server will be queried in the " .. 
     101    translate("<abbr title=\"Domain Name System\">DNS</abbr> servers will be queried in the " .. 
    82102        "order of the resolvfile")).optional = true 
    83103 
    84 s:option(Flag, "logqueries", 
    85     translate("Log queries")).optional = true 
    86  
    87 s:option(Flag, "noresolv", 
    88     translate("Ignore resolve file")).optional = true 
    89  
    90 s:option(Value, "dnsforwardmax", 
    91     translate("concurrent queries")).optional = true 
    92  
    93 s:option(Value, "port", 
    94     translate("<abbr title=\"Domain Name System\">DNS</abbr>-Port")).optional = true 
    95  
    96 s:option(Value, "ednspacket_max", 
    97     translate("<abbr title=\"maximal\">max.</abbr> <abbr title=\"Extension Mechanisms for " .. 
    98         "Domain Name System\">EDNS0</abbr> paket size")).optional = true 
    99  
    100 s:option(Value, "dhcpleasemax", 
    101     translate("<abbr title=\"maximal\">max.</abbr> <abbr title=\"Dynamic Host Configuration " .. 
    102         "Protocol\">DHCP</abbr>-Leases")).optional = true 
    103  
    104 s:option(DynamicList, "addnhosts", 
    105     translate("additional hostfile")).optional = true 
    106  
    107 s:option(Value, "queryport", 
    108     translate("query port")).optional = true 
    109  
    110 s:option(Flag, "enable_tftp", 
    111     translate("Enable TFTP-Server")).optional = true 
    112  
    113 s:option(Value, "tftp_root", 
    114     translate("TFTP-Server Root")).optional = true 
    115  
    116 s:option(Value, "dhcp_boot", 
    117     translate("Network Boot Image")).optional = true 
    118  
    119 s:option(DynamicList, "server", translate("DNS forward"), 
    120         translate("List of <abbr title=\"Domain Name System\">DNS</abbr> " .. 
    121                 "servers to forward requests to")).optional = true 
     104s:taboption("general", Flag, "logqueries", 
     105    translate("Log queries"), 
     106    translate("Write received DNS requests to syslog")).optional = true 
     107 
     108df = s:taboption("general", DynamicList, "server", translate("DNS forwardings"), 
     109    translate("List of <abbr title=\"Domain Name System\">DNS</abbr> " .. 
     110            "servers to forward requests to")) 
     111 
     112df.optional = true 
     113df.placeholder = "/example.org/10.1.2.3" 
     114 
     115 
     116rp = s:taboption("general", Flag, "rebind_protection", 
     117    translate("Rebind protection"), 
     118    translate("Discard upstream RFC1918 responses")) 
     119 
     120 
     121rl = s:taboption("general", Flag, "rebind_localhost", 
     122    translate("Allow localhost"), 
     123    translate("Allow upstream responses in the 127.0.0.0/8 range, e.g. for RBL services")) 
     124 
     125rl:depends("rebind_protection", "1") 
     126 
     127 
     128rd = s:taboption("general", DynamicList, "rebind_domain", 
     129    translate("Domain whitelist"), 
     130    translate("List of domains to allow RFC1918 responses for")) 
     131 
     132rd:depends("rebind_protection", "1") 
     133rd.datatype = "host" 
     134rd.placeholder = "ihost.netflix.com" 
     135 
     136 
     137pt = s:taboption("advanced", Value, "port", 
     138    translate("<abbr title=\"Domain Name System\">DNS</abbr> server port"), 
     139    translate("Listening port for inbound DNS queries")) 
     140 
     141pt.optional = true 
     142pt.datatype = "port" 
     143pt.placeholder = 53 
     144 
     145 
     146qp = s:taboption("advanced", Value, "queryport", 
     147    translate("<abbr title=\"Domain Name System\">DNS</abbr> query port"), 
     148    translate("Fixed source port for outbound DNS queries")) 
     149 
     150qp.optional = true 
     151qp.datatype = "port" 
     152qp.placeholder = translate("any") 
     153 
     154 
     155lm = s:taboption("advanced", Value, "dhcpleasemax", 
     156    translate("<abbr title=\"maximal\">Max.</abbr> <abbr title=\"Dynamic Host Configuration " .. 
     157        "Protocol\">DHCP</abbr> leases"), 
     158    translate("Maximum allowed number of active DHCP leases")) 
     159 
     160lm.optional = true 
     161lm.datatype = "uinteger" 
     162lm.placeholder = translate("unlimited") 
     163 
     164 
     165em = s:taboption("advanced", Value, "ednspacket_max", 
     166    translate("<abbr title=\"maximal\">Max.</abbr> <abbr title=\"Extension Mechanisms for " .. 
     167        "Domain Name System\">EDNS0</abbr> paket size"), 
     168    translate("Maximum allowed size of EDNS.0 UDP packets")) 
     169 
     170em.optional = true 
     171em.datatype = "uinteger" 
     172em.placeholder = 1280 
     173 
     174 
     175cq = s:taboption("advanced", Value, "dnsforwardmax", 
     176    translate("<abbr title=\"maximal\">Max.</abbr> concurrent queries"), 
     177    translate("Maximum allowed number of concurrent DNS queries")) 
     178 
     179cq.optional = true 
     180cq.datatype = "uinteger" 
     181cq.placeholder = 150 
     182 
     183 
     184s:taboption("tftp", Flag, "enable_tftp", 
     185    translate("Enable TFTP server")).optional = true 
     186 
     187tr = s:taboption("tftp", Value, "tftp_root", 
     188    translate("TFTP server root"), 
     189    translate("Root directory for files served via TFTP")) 
     190 
     191tr.optional = true 
     192tr:depends("enable_tftp", "1") 
     193tr.placeholder = "/" 
     194 
     195 
     196db = s:taboption("tftp", Value, "dhcp_boot", 
     197    translate("Network boot image"), 
     198    translate("Filename of the boot image advertised to clients")) 
     199 
     200db.optional = true 
     201db:depends("enable_tftp", "1") 
     202db.placeholder = "pxelinux.0" 
     203 
    122204 
    123205return m