summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/luasrc/view/cbi
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2019-07-19 17:19:24 +0200
committerJo-Philipp Wich <jo@mein.io>2019-07-19 17:28:36 +0200
commit5510bdae399c131f8911f4d4b39ec6832252c161 (patch)
treec9f1125f59572326b2d7eaffff38a60d8291fc18 /modules/luci-base/luasrc/view/cbi
parent9c736c83924194979db88145780c018607f11cfb (diff)
luci-base: render default values for all server side cbi map widgets
Fixes: 9c7eb1dec ("luci-base: switch from server side to client side widget markup") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/luasrc/view/cbi')
-rw-r--r--modules/luci-base/luasrc/view/cbi/dropdown.htm2
-rw-r--r--modules/luci-base/luasrc/view/cbi/dynlist.htm2
-rw-r--r--modules/luci-base/luasrc/view/cbi/lvalue.htm2
-rw-r--r--modules/luci-base/luasrc/view/cbi/tvalue.htm2
4 files changed, 4 insertions, 4 deletions
diff --git a/modules/luci-base/luasrc/view/cbi/dropdown.htm b/modules/luci-base/luasrc/view/cbi/dropdown.htm
index 40bd8e9536..95bd0d4bdc 100644
--- a/modules/luci-base/luasrc/view/cbi/dropdown.htm
+++ b/modules/luci-base/luasrc/view/cbi/dropdown.htm
@@ -1,6 +1,6 @@
<%+cbi/valueheader%>
<div<%=attr("data-ui-widget", luci.util.serialize_json({
- "Dropdown", self:cfgvalue(section), self:choices(), {
+ "Dropdown", self:cfgvalue(section) or self.default, self:choices(), {
id = cbid,
name = cbid,
sort = self.keylist,
diff --git a/modules/luci-base/luasrc/view/cbi/dynlist.htm b/modules/luci-base/luasrc/view/cbi/dynlist.htm
index d50328d79f..2a3da67ff9 100644
--- a/modules/luci-base/luasrc/view/cbi/dynlist.htm
+++ b/modules/luci-base/luasrc/view/cbi/dynlist.htm
@@ -1,6 +1,6 @@
<%+cbi/valueheader%>
<div<%=attr("data-ui-widget", luci.util.serialize_json({
- "DynamicList", self:cfgvalue(section), self:choices(), {
+ "DynamicList", self:cfgvalue(section) or self.default, self:choices(), {
name = cbid,
size = self.size,
sort = self.keylist,
diff --git a/modules/luci-base/luasrc/view/cbi/lvalue.htm b/modules/luci-base/luasrc/view/cbi/lvalue.htm
index e076488356..920b5e9f92 100644
--- a/modules/luci-base/luasrc/view/cbi/lvalue.htm
+++ b/modules/luci-base/luasrc/view/cbi/lvalue.htm
@@ -1,6 +1,6 @@
<%+cbi/valueheader%>
<div<%=attr("data-ui-widget", luci.util.serialize_json({
- "Select", self:cfgvalue(section), self:choices(), {
+ "Select", self:cfgvalue(section) or self.default, self:choices(), {
id = cbid,
name = cbid,
size = self.size,
diff --git a/modules/luci-base/luasrc/view/cbi/tvalue.htm b/modules/luci-base/luasrc/view/cbi/tvalue.htm
index d1e9e66728..f3b12bd094 100644
--- a/modules/luci-base/luasrc/view/cbi/tvalue.htm
+++ b/modules/luci-base/luasrc/view/cbi/tvalue.htm
@@ -1,5 +1,5 @@
<%+cbi/valueheader%>
<textarea class="cbi-input-textarea" <% if not self.size then %> style="width: 100%"<% else %> cols="<%=self.size%>"<% end %> data-update="change"<%= attr("name", cbid) .. attr("id", cbid) .. ifattr(self.rows, "rows") .. ifattr(self.wrap, "wrap") .. ifattr(self.readonly, "readonly") %>>
- <%-=pcdata(self:cfgvalue(section))-%>
+ <%-=pcdata(self:cfgvalue(section) or self.default)-%>
</textarea>
<%+cbi/valuefooter%>