diff options
author | Ted Trask <ttrask01@yahoo.com> | 2014-03-04 02:44:32 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2014-03-04 02:44:32 +0000 |
commit | 8dd18fc4b8a97bc50dd030db5ae5bc0c5310799b (patch) | |
tree | 0ccad4de8f43ec973d2fb47ea91eb2145e3b3cb7 | |
parent | 2bd635102285c76c592290dd1fad8d2597aef3e7 (diff) | |
download | acf-freeswitch-8dd18fc4b8a97bc50dd030db5ae5bc0c5310799b.tar.bz2 acf-freeswitch-8dd18fc4b8a97bc50dd030db5ae5bc0c5310799b.tar.xz |
Fix sort by filesize in logfiles/status
-rw-r--r-- | freeswitch-listfiles-html.lsp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/freeswitch-listfiles-html.lsp b/freeswitch-listfiles-html.lsp index 5b38091..02fc1e2 100644 --- a/freeswitch-listfiles-html.lsp +++ b/freeswitch-listfiles-html.lsp @@ -3,6 +3,20 @@ htmlviewfunctions = require("htmlviewfunctions") html = require("acf.html") %> +<% +function convertsize(size) + if string.find(size, "k$") then + return tonumber(string.match(size, "[%d.]*")) * 1024.0 + elseif string.find(size, "M$") then + return tonumber(string.match(size, "[%d.]*")) * 1024.0 * 1024.0 + elseif string.find(size, "G$") then + return tonumber(string.match(size, "[%d.]*")) + 1024.0 * 1024.0 * 1024.0 + else + return tonumber(string.match(size, "[%d.]*")) + end +end +%> + <script type="text/javascript"> if (typeof jQuery == 'undefined') { document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"><\/script>'); @@ -48,7 +62,7 @@ end %> <% end %> </td> <td><%= html.html_escape(v.filename) %></td> - <td><%= html.html_escape(v.size) %></td> + <td><span style="display:none"><%= convertsize(v.size) %>b</span><%= html.html_escape(v.size) %></td> <td><%= html.html_escape(v.mtime) %></td> </tr> <% end %> |