summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/luasrc/view/cbi
diff options
context:
space:
mode:
authorYousong Zhou <yszhou4tech@gmail.com>2015-11-03 14:20:03 +0800
committerYousong Zhou <yszhou4tech@gmail.com>2015-11-03 17:07:45 +0800
commita28da6a88a0cd7a5bc0c12c1ef2d8cad86c2aff3 (patch)
treea379a0d40127cd3265ac57a216231a651f304818 /modules/luci-base/luasrc/view/cbi
parent20ccc903505ee15419b5cde113f9061b7a4f7513 (diff)
luci-base: add support for DynamicList with FileBrowser
Two new arguments url, defpath were added to cbi_dynlist_init() for initializing the brower button. An example of usage identity = section:taboption("general", DynamicList, "identity", translate("List of SSH key files for auth")) identity.datatype = "file" Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Diffstat (limited to 'modules/luci-base/luasrc/view/cbi')
-rw-r--r--modules/luci-base/luasrc/view/cbi/dynlist.htm4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/luci-base/luasrc/view/cbi/dynlist.htm b/modules/luci-base/luasrc/view/cbi/dynlist.htm
index fd626a4ecf..e936c0c39f 100644
--- a/modules/luci-base/luasrc/view/cbi/dynlist.htm
+++ b/modules/luci-base/luasrc/view/cbi/dynlist.htm
@@ -15,7 +15,9 @@
<script type="text/javascript">
cbi_dynlist_init(
'<%=cbid%>', '<%=resource%>', '<%=self.datatype%>',
- <%=tostring(self.optional or self.rmempty)%>
+ <%=tostring(self.optional or self.rmempty)%>,
+ '<%=url('admin/filebrowser')%>',
+ '<%=self.default_path and self.default_path%>'
<%- if #self.keylist > 0 then -%>, [{
<%- for i, k in ipairs(self.keylist) do -%>
<%-=string.format("%q", k) .. ":" .. string.format("%q", self.vallist[i])-%>