summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/luasrc/view/cbi/upload.htm
diff options
context:
space:
mode:
Diffstat (limited to 'modules/luci-base/luasrc/view/cbi/upload.htm')
-rw-r--r--modules/luci-base/luasrc/view/cbi/upload.htm30
1 files changed, 10 insertions, 20 deletions
diff --git a/modules/luci-base/luasrc/view/cbi/upload.htm b/modules/luci-base/luasrc/view/cbi/upload.htm
index 3c3d82b653..e610495380 100644
--- a/modules/luci-base/luasrc/view/cbi/upload.htm
+++ b/modules/luci-base/luasrc/view/cbi/upload.htm
@@ -1,24 +1,14 @@
-<%
- local t = require("luci.tools.webadmin")
- local v = self:cfgvalue(section)
- local s = v and nixio.fs.stat(v)
--%>
<%+cbi/valueheader%>
- <% if s then %>
- <%:Uploaded File%> (<%=t.byte_format(s.size)%>)
- <% if self.unsafeupload then %>
- <input type="hidden"<%= attr("value", v) .. attr("name", cbid) .. attr("id", cbid) %> />
- <input class="cbi-button cbi-button-image" type="image" value="<%:Replace entry%>" name="cbi.rlf.<%=section .. "." .. self.option%>" alt="<%:Replace entry%>" title="<%:Replace entry%>" src="<%=resource%>/cbi/reload.gif" />
- <% end %>
- <% end %>
- <% if not self.unsafeupload then %>
- <input type="hidden"<%= attr("value", v) .. attr("name", "cbi.rlf." .. section .. "." .. self.option) .. attr("id", "cbi.rlf." .. section .. "." .. self.option) %> />
- <% end %>
+<div<%=attr("data-ui-widget", luci.util.serialize_json({
+ "FileUpload", self:cfgvalue(section) or self.default, {
+ id = cbid,
+ name = cbid,
+ show_hidden = self.show_hidden,
+ enable_remove = self.enable_remove,
+ enable_upload = self.enable_upload,
+ root_directory = "/" --self.root_directory
+ }
+}))%>></div>
- <% if (not s) or (s and not self.unsafeupload) then %>
- <input class="cbi-input-file" type="file"<%= attr("name", cbid) .. attr("id", cbid) %> />
- <% end %>
- <input type="text" class="cbi-input-text" data-update="change"<%=
- attr("name", cbid .. ".textbox") .. attr("id", cbid .. ".textbox") .. attr("value", luci.cbi.AbstractValue.cfgvalue(self, section) or self.default) .. ifattr(self.size, "size") .. ifattr(self.placeholder, "placeholder") .. ifattr(self.readonly, "readonly") .. ifattr(self.maxlength, "maxlength") %> />
<%+cbi/valuefooter%>