diff options
Diffstat (limited to 'libs/cbi/luasrc/view')
-rw-r--r-- | libs/cbi/luasrc/view/cbi/filebrowser.htm | 13 | ||||
-rw-r--r-- | libs/cbi/luasrc/view/cbi/upload.htm | 3 |
2 files changed, 9 insertions, 7 deletions
diff --git a/libs/cbi/luasrc/view/cbi/filebrowser.htm b/libs/cbi/luasrc/view/cbi/filebrowser.htm index 5eda993b67..f82957221c 100644 --- a/libs/cbi/luasrc/view/cbi/filebrowser.htm +++ b/libs/cbi/luasrc/view/cbi/filebrowser.htm @@ -48,7 +48,8 @@ $Id$ </head> <body> <% - require("luci.fs") + require("nixio.fs") + require("nixio.util") require("luci.http") require("luci.dispatcher") @@ -63,7 +64,7 @@ $Id$ end local filepath = table.concat( path, '/' ) - local filestat = luci.fs.stat( filepath ) + local filestat = nixio.fs.stat( filepath ) local baseurl = luci.dispatcher.build_url('admin', 'filebrowser') if filestat and filestat.type == "reg" then @@ -76,7 +77,7 @@ $Id$ filepath = filepath .. '/' end - local entries = luci.fs.dir(filepath) + local entries = nixio.util.consume((nixio.fs.dir(filepath))) -%> <div id="path"> Location: @@ -98,8 +99,8 @@ $Id$ <div id="listing"> <ul> <% for _, e in luci.util.vspairs(entries) do - local stat = luci.fs.stat(filepath..e) - if e ~= '.' and e ~= '..' and stat and stat.type == 'dir' then + local stat = nixio.fs.stat(filepath..e) + if stat and stat.type == 'dir' then -%> <li class="dir"> <img src="/luci-static/resources/cbi/folder.png" alt="Directory" /> @@ -108,7 +109,7 @@ $Id$ <% end end -%> <% for _, e in luci.util.vspairs(entries) do - local stat = luci.fs.stat(filepath..e) + local stat = nixio.fs.stat(filepath..e) if stat and stat.type ~= 'dir' then -%> <li class="file"> diff --git a/libs/cbi/luasrc/view/cbi/upload.htm b/libs/cbi/luasrc/view/cbi/upload.htm index a4ab0c958d..7bde74b482 100644 --- a/libs/cbi/luasrc/view/cbi/upload.htm +++ b/libs/cbi/luasrc/view/cbi/upload.htm @@ -16,10 +16,11 @@ $Id$ <% local t = require("luci.tools.webadmin") local v = self:cfgvalue(section) + v = v and nixio.fs.stat(v) -%> <%+cbi/valueheader%> <% if v then %> - <%:cbi_upload Uploaded File%> (<%=t.byte_format(luci.fs.stat(v, "size") or 0)%>) + <%:cbi_upload Uploaded File%> (<%=t.byte_format(v.size)%>) <input type="hidden"<%= attr("value", v) .. attr("name", cbid) .. attr("id", cbid) %> /> <input class="cbi-input-image" type="image" value="<%:cbi_replace%>" name="cbi.rlf.<%=section .. "." .. self.option%>" alt="<%:cbi_replace%>" title="<%:cbi_replace%>" src="<%=resource%>/cbi/reload.gif" /> <% else %> |