diff options
author | Ted Trask <ttrask01@yahoo.com> | 2015-12-30 14:03:58 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2015-12-30 14:03:58 +0000 |
commit | 1adfcffe91e322e347478d3a855814e3573f66fd (patch) | |
tree | 023554ce4774bad6370b18d8373bef22610137c3 | |
parent | da67a7c45fa1fb4cd3eb48a531a9d07a97410d67 (diff) | |
download | acf-freeswitch-1adfcffe91e322e347478d3a855814e3573f66fd.tar.bz2 acf-freeswitch-1adfcffe91e322e347478d3a855814e3573f66fd.tar.xz |
Change listfiles filesize to size, size and mtime not user-friendly, use posix.stat over fs.stat, use new format functions
-rw-r--r-- | freeswitch-listfiles-html.lsp | 10 | ||||
-rw-r--r-- | freeswitch-model.lua | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/freeswitch-listfiles-html.lsp b/freeswitch-listfiles-html.lsp index 9dd7e87..5752ab1 100644 --- a/freeswitch-listfiles-html.lsp +++ b/freeswitch-listfiles-html.lsp @@ -39,10 +39,10 @@ end %> </thead><tbody> <% local filename = cfe({ type="hidden", value="" }) %> <% local redir = cfe({ type="hidden", value=page_info.orig_action }) %> -<% for k,v in ipairs( view.value ) do %> +<% for i,file in ipairs( view.value ) do %> <tr> <td> - <% filename.value = v.filename %> + <% filename.value = file.filename %> <% if viewlibrary.check_permission("editfile") then %> <% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="", option="Edit", action="editfile"}), page_info, -1) %> <% end %> @@ -50,9 +50,9 @@ end %> <% htmlviewfunctions.displayitem(cfe({type="form", value={filename=filename}, label="", option="Delete", action="deletefile"}), page_info, -1) %> <% end %> </td> - <td><%= html.html_escape(v.filename) %></td> - <td><span class="hide"><%= html.html_escape(v.orig_size) %>b</span><%= html.html_escape(v.size) %></td> - <td><%= html.html_escape(v.mtime) %></td> + <td><%= html.html_escape(file.filename) %></td> + <td><span class="hide"><%= html.html_escape(file.size or 0) %>b</span><%= format.formatfilesize(file.size) %></td> + <td><%= format.formattime(file.mtime) %></td> </tr> <% end %> </tbody></table> diff --git a/freeswitch-model.lua b/freeswitch-model.lua index d4bf837..56b1f05 100644 --- a/freeswitch-model.lua +++ b/freeswitch-model.lua @@ -63,7 +63,7 @@ end mymodule.list_files = function() local retval = {} for file in fs.find(null, baseurl) do - local details = fs.stat(file) + local details = posix.stat(file) if details.type == "regular" then details.filename = file table.insert(retval, details) |