* luci/libs/uvl: implement default value option for variable sections
This commit is contained in:
parent
98ff081c9f
commit
885e54007f
2 changed files with 10 additions and 1 deletions
|
@ -1119,7 +1119,7 @@ end
|
||||||
--- Get the value of this option.
|
--- Get the value of this option.
|
||||||
-- @return The associated configuration value
|
-- @return The associated configuration value
|
||||||
function option.value(self)
|
function option.value(self)
|
||||||
local v = self:config()
|
local v = self:config() or self:scheme('default')
|
||||||
if v and self:scheme('multival') then
|
if v and self:scheme('multival') then
|
||||||
v = luci.util.split( v, "%s+", nil, true )
|
v = luci.util.split( v, "%s+", nil, true )
|
||||||
end
|
end
|
||||||
|
|
|
@ -267,6 +267,15 @@ config variable
|
||||||
option datatype 'string'
|
option datatype 'string'
|
||||||
option required false
|
option required false
|
||||||
|
|
||||||
|
# Variable default value (schema.@variable.default)
|
||||||
|
config variable
|
||||||
|
option name 'default'
|
||||||
|
option title 'Datatype of this variable'
|
||||||
|
option section 'schema.variable'
|
||||||
|
option type 'variable'
|
||||||
|
option datatype 'string'
|
||||||
|
option required false
|
||||||
|
|
||||||
# Variable validators (schema.@variable.validator)
|
# Variable validators (schema.@variable.validator)
|
||||||
config variable
|
config variable
|
||||||
option name 'validator'
|
option name 'validator'
|
||||||
|
|
Loading…
Reference in a new issue