Fixed DHCP-Options and some CBI stuff
This commit is contained in:
parent
554286bdc6
commit
19c79a30b9
8 changed files with 17 additions and 9 deletions
|
@ -182,6 +182,8 @@ dhcp_dhcp_ignore_desc = 'disable <abbr title="Dynamic Host Configuration Protoco
|
||||||
dhcp_dhcp_force = 'Force'
|
dhcp_dhcp_force = 'Force'
|
||||||
dhcp_dhcp_start_desc = 'first address (last octet)'
|
dhcp_dhcp_start_desc = 'first address (last octet)'
|
||||||
dhcp_dhcp_limit_desc = 'number of leased addresses -1'
|
dhcp_dhcp_limit_desc = 'number of leased addresses -1'
|
||||||
|
dhcp_dhcp_dhcpoption = 'DHCP-Options'
|
||||||
|
dhcp_dhcp_dhcpoption_desc = 'See "dnsmasq --help dhcp" for a list of available options.'
|
||||||
dhcp_leases = 'Leases'
|
dhcp_leases = 'Leases'
|
||||||
luci_ethers = 'Static Leases'
|
luci_ethers = 'Static Leases'
|
||||||
dhcp_timeremain = 'Leasetime remaining'
|
dhcp_timeremain = 'Leasetime remaining'
|
||||||
|
|
|
@ -186,6 +186,8 @@
|
||||||
<i18n:msg xml:id="dhcp_dhcp_force">Force</i18n:msg>
|
<i18n:msg xml:id="dhcp_dhcp_force">Force</i18n:msg>
|
||||||
<i18n:msg xml:id="dhcp_dhcp_start_desc">first address (last octet)</i18n:msg>
|
<i18n:msg xml:id="dhcp_dhcp_start_desc">first address (last octet)</i18n:msg>
|
||||||
<i18n:msg xml:id="dhcp_dhcp_limit_desc">number of leased addresses -1</i18n:msg>
|
<i18n:msg xml:id="dhcp_dhcp_limit_desc">number of leased addresses -1</i18n:msg>
|
||||||
|
<i18n:msg xml:id="dhcp_dhcp_dhcpoption">DHCP-Options</i18n:msg>
|
||||||
|
<i18n:msg xml:id="dhcp_dhcp_dhcpoption_desc">See "dnsmasq --help dhcp" for a list of available options.</i18n:msg>
|
||||||
<i18n:msg xml:id="dhcp_leases">Leases</i18n:msg>
|
<i18n:msg xml:id="dhcp_leases">Leases</i18n:msg>
|
||||||
<i18n:msg xml:id="luci_ethers">Static Leases</i18n:msg>
|
<i18n:msg xml:id="luci_ethers">Static Leases</i18n:msg>
|
||||||
<i18n:msg xml:id="dhcp_timeremain">Leasetime remaining</i18n:msg>
|
<i18n:msg xml:id="dhcp_timeremain">Leasetime remaining</i18n:msg>
|
||||||
|
|
|
@ -141,6 +141,8 @@ dhcp_dhcp_force = 'Start erzwingen'
|
||||||
dhcp_dhcp_ignore = 'Schnittstelle ignorieren'
|
dhcp_dhcp_ignore = 'Schnittstelle ignorieren'
|
||||||
dhcp_dhcp_ignore_desc = 'DHCP für dieses Netzwerk deaktivieren'
|
dhcp_dhcp_ignore_desc = 'DHCP für dieses Netzwerk deaktivieren'
|
||||||
dhcp_dhcp_leasetime = 'Laufzeit'
|
dhcp_dhcp_leasetime = 'Laufzeit'
|
||||||
|
dhcp_dhcp_dhcpoption = 'DHCP-Optionen'
|
||||||
|
dhcp_dhcp_dhcpoption_desc = 'Siehe "dnsmasq --help dhcp" für eine Liste verfügbarer Optionen.'
|
||||||
dhcp_dhcp_limit_desc = 'Anzahl zu vergebender Adressen -1'
|
dhcp_dhcp_limit_desc = 'Anzahl zu vergebender Adressen -1'
|
||||||
dhcp_dhcp_start_desc = 'Erste vergebene Adresse (letztes Oktett)'
|
dhcp_dhcp_start_desc = 'Erste vergebene Adresse (letztes Oktett)'
|
||||||
dhcp_dnsmasq_addnhosts = 'Zusätzliche Hostdatei'
|
dhcp_dnsmasq_addnhosts = 'Zusätzliche Hostdatei'
|
||||||
|
|
|
@ -145,6 +145,8 @@
|
||||||
<i18n:msg xml:id="dhcp_dhcp_ignore">Schnittstelle ignorieren</i18n:msg>
|
<i18n:msg xml:id="dhcp_dhcp_ignore">Schnittstelle ignorieren</i18n:msg>
|
||||||
<i18n:msg xml:id="dhcp_dhcp_ignore_desc">DHCP für dieses Netzwerk deaktivieren</i18n:msg>
|
<i18n:msg xml:id="dhcp_dhcp_ignore_desc">DHCP für dieses Netzwerk deaktivieren</i18n:msg>
|
||||||
<i18n:msg xml:id="dhcp_dhcp_leasetime">Laufzeit</i18n:msg>
|
<i18n:msg xml:id="dhcp_dhcp_leasetime">Laufzeit</i18n:msg>
|
||||||
|
<i18n:msg xml:id="dhcp_dhcp_dhcpoption">DHCP-Optionen</i18n:msg>
|
||||||
|
<i18n:msg xml:id="dhcp_dhcp_dhcpoption_desc">Siehe "dnsmasq --help dhcp" für eine Liste verfügbarer Optionen.</i18n:msg>
|
||||||
<i18n:msg xml:id="dhcp_dhcp_limit_desc">Anzahl zu vergebender Adressen -1</i18n:msg>
|
<i18n:msg xml:id="dhcp_dhcp_limit_desc">Anzahl zu vergebender Adressen -1</i18n:msg>
|
||||||
<i18n:msg xml:id="dhcp_dhcp_start_desc">Erste vergebene Adresse (letztes Oktett)</i18n:msg>
|
<i18n:msg xml:id="dhcp_dhcp_start_desc">Erste vergebene Adresse (letztes Oktett)</i18n:msg>
|
||||||
<i18n:msg xml:id="dhcp_dnsmasq_addnhosts">Zusätzliche Hostdatei</i18n:msg>
|
<i18n:msg xml:id="dhcp_dnsmasq_addnhosts">Zusätzliche Hostdatei</i18n:msg>
|
||||||
|
|
|
@ -933,7 +933,7 @@ function AbstractValue.parse(self, section)
|
||||||
local fvalue = self:formvalue(section)
|
local fvalue = self:formvalue(section)
|
||||||
local cvalue = self:cfgvalue(section)
|
local cvalue = self:cfgvalue(section)
|
||||||
|
|
||||||
if fvalue and fvalue ~= "" then -- If we have a form value, write it to UCI
|
if fvalue and #fvalue > 0 then -- If we have a form value, write it to UCI
|
||||||
fvalue = self:transform(self:validate(fvalue, section))
|
fvalue = self:transform(self:validate(fvalue, section))
|
||||||
if not fvalue then
|
if not fvalue then
|
||||||
self.tag_invalid[section] = true
|
self.tag_invalid[section] = true
|
||||||
|
@ -983,7 +983,9 @@ end
|
||||||
-- Return the UCI value of this object
|
-- Return the UCI value of this object
|
||||||
function AbstractValue.cfgvalue(self, section)
|
function AbstractValue.cfgvalue(self, section)
|
||||||
local value = self.map:get(section, self.option)
|
local value = self.map:get(section, self.option)
|
||||||
if not self.cast or self.cast == type(value) then
|
if not value then
|
||||||
|
return nil
|
||||||
|
elseif not self.cast or self.cast == type(value) then
|
||||||
return value
|
return value
|
||||||
elseif self.cast == "string" then
|
elseif self.cast == "string" then
|
||||||
if type(value) == "table" then
|
if type(value) == "table" then
|
||||||
|
@ -1251,7 +1253,8 @@ function DynamicList.value(self, key, val)
|
||||||
table.insert(self.vallist, tostring(val))
|
table.insert(self.vallist, tostring(val))
|
||||||
end
|
end
|
||||||
|
|
||||||
function DynamicList.validate(self, value, section)
|
function DynamicList.formvalue(self, section)
|
||||||
|
local value = AbstractValue.formvalue(self, section)
|
||||||
value = (type(value) == "table") and value or {value}
|
value = (type(value) == "table") and value or {value}
|
||||||
|
|
||||||
local valid = {}
|
local valid = {}
|
||||||
|
|
|
@ -14,7 +14,7 @@ $Id$
|
||||||
-%>
|
-%>
|
||||||
<%+cbi/valueheader%>
|
<%+cbi/valueheader%>
|
||||||
<%
|
<%
|
||||||
local vals = self:cfgvalue(section)
|
local vals = self:cfgvalue(section) or {}
|
||||||
for i=1, #vals + 1 do
|
for i=1, #vals + 1 do
|
||||||
local val = vals[i]
|
local val = vals[i]
|
||||||
%>
|
%>
|
||||||
|
|
|
@ -13,7 +13,7 @@ $Id$
|
||||||
|
|
||||||
-%>
|
-%>
|
||||||
<%
|
<%
|
||||||
local v = self:valuelist(section)
|
local v = self:valuelist(section) or {}
|
||||||
%>
|
%>
|
||||||
<%+cbi/valueheader%>
|
<%+cbi/valueheader%>
|
||||||
<% if self.widget == "select" then %>
|
<% if self.widget == "select" then %>
|
||||||
|
|
|
@ -56,10 +56,7 @@ s:option(Value, "netmask", translate("netmask")).optional = true
|
||||||
|
|
||||||
s:option(Flag, "force").optional = true
|
s:option(Flag, "force").optional = true
|
||||||
|
|
||||||
for i, line in pairs(luci.util.execl("dnsmasq --help dhcp")) do
|
s:option(DynamicList, "dhcp_option").optional = true
|
||||||
k, v = line:match("([^ ]+) +([^ ]+)")
|
|
||||||
s:option(Value, "dhcp"..k, v).optional = true
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
for i, n in ipairs(s.children) do
|
for i, n in ipairs(s.children) do
|
||||||
|
|
Loading…
Reference in a new issue