mirror of
https://github.com/openwrt/luci.git
synced 2026-08-29 06:22:49 +04:00
cbi.lua: Implement "readonly" property for "Value"
cbi.lua: Implement "readonly" property for "Value" Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
This commit is contained in:
@@ -1471,6 +1471,7 @@ function Value.__init__(self, ...)
|
||||
self.template = "cbi/value"
|
||||
self.keylist = {}
|
||||
self.vallist = {}
|
||||
self.readonly = nil
|
||||
end
|
||||
|
||||
function Value.reset_values(self)
|
||||
@@ -1484,6 +1485,10 @@ function Value.value(self, key, val)
|
||||
table.insert(self.vallist, tostring(val))
|
||||
end
|
||||
|
||||
function Value.parse(self, section, novld)
|
||||
if self.readonly then return end
|
||||
AbstractValue.parse(self, section, novld)
|
||||
end
|
||||
|
||||
-- DummyValue - This does nothing except being there
|
||||
DummyValue = class(AbstractValue)
|
||||
|
||||
Reference in New Issue
Block a user