mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Update to latest luci-base and luci-mod-admin-full
This commit is contained in:
parent
613042b0a0
commit
b218a47995
17 changed files with 2882 additions and 221 deletions
|
@ -1417,6 +1417,12 @@ function AbstractValue.parse(self, section, novld)
|
|||
self:add_error(section, "invalid", val_err)
|
||||
end
|
||||
|
||||
if self.alias then
|
||||
self.section.aliased = self.section.aliased or {}
|
||||
self.section.aliased[section] = self.section.aliased[section] or {}
|
||||
self.section.aliased[section][self.alias] = true
|
||||
end
|
||||
|
||||
if fvalue and (self.forcewrite or not (fvalue == cvalue)) then
|
||||
if self:write(section, fvalue) then
|
||||
-- Push events
|
||||
|
@ -1426,10 +1432,16 @@ function AbstractValue.parse(self, section, novld)
|
|||
end
|
||||
else -- Unset the UCI or error
|
||||
if self.rmempty or self.optional then
|
||||
if self:remove(section) then
|
||||
-- Push events
|
||||
self.section.changed = true
|
||||
--luci.util.append(self.map.events, self.events)
|
||||
if not self.alias or
|
||||
not self.section.aliased or
|
||||
not self.section.aliased[section] or
|
||||
not self.section.aliased[section][self.alias]
|
||||
then
|
||||
if self:remove(section) then
|
||||
-- Push events
|
||||
self.section.changed = true
|
||||
--luci.util.append(self.map.events, self.events)
|
||||
end
|
||||
end
|
||||
elseif cvalue ~= fvalue and not novld then
|
||||
-- trigger validator with nil value to get custom user error msg.
|
||||
|
@ -1455,7 +1467,7 @@ function AbstractValue.cfgvalue(self, section)
|
|||
if self.tag_error[section] then
|
||||
value = self:formvalue(section)
|
||||
else
|
||||
value = self.map:get(section, self.option)
|
||||
value = self.map:get(section, self.alias or self.option)
|
||||
end
|
||||
|
||||
if not value then
|
||||
|
@ -1496,12 +1508,12 @@ AbstractValue.transform = AbstractValue.validate
|
|||
|
||||
-- Write to UCI
|
||||
function AbstractValue.write(self, section, value)
|
||||
return self.map:set(section, self.option, value)
|
||||
return self.map:set(section, self.alias or self.option, value)
|
||||
end
|
||||
|
||||
-- Remove from UCI
|
||||
function AbstractValue.remove(self, section)
|
||||
return self.map:del(section, self.option)
|
||||
return self.map:del(section, self.alias or self.option)
|
||||
end
|
||||
|
||||
|
||||
|
@ -1834,6 +1846,15 @@ function DynamicList.formvalue(self, section)
|
|||
end
|
||||
|
||||
|
||||
DropDown = class(MultiValue)
|
||||
|
||||
function DropDown.__init__(self, ...)
|
||||
ListValue.__init__(self, ...)
|
||||
self.template = "cbi/dropdown"
|
||||
self.delimiter = " "
|
||||
end
|
||||
|
||||
|
||||
--[[
|
||||
TextValue - A multi-line value
|
||||
rows: Rows
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue