diff options
author | Ted Trask <ttrask01@yahoo.com> | 2014-09-22 15:00:23 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2014-09-22 15:00:23 +0000 |
commit | fa443b45714d7396b07edb3684da4badf7ca1b46 (patch) | |
tree | 480b9f4cd3e9241941381e1e09284bbe6ca27a8e | |
parent | 2933fa6475736258973a403ef7ef4700c27219cb (diff) | |
download | acf-freeradius3-fa443b45714d7396b07edb3684da4badf7ca1b46.tar.bz2 acf-freeradius3-fa443b45714d7396b07edb3684da4badf7ca1b46.tar.xz |
Replace convertsize function with orig_size in HTML views
-rw-r--r-- | freeradius3-listmacauthfiles-html.lsp | 16 | ||||
-rw-r--r-- | freeradius3-listpasswdfiles-html.lsp | 16 |
2 files changed, 2 insertions, 30 deletions
diff --git a/freeradius3-listmacauthfiles-html.lsp b/freeradius3-listmacauthfiles-html.lsp index fcb1363..b9972f9 100644 --- a/freeradius3-listmacauthfiles-html.lsp +++ b/freeradius3-listmacauthfiles-html.lsp @@ -3,20 +3,6 @@ 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>'); @@ -57,7 +43,7 @@ end <% end %> </td> <td><%= html.html_escape(v.filename) %></td> - <td><span class="hide"><%= convertsize(v.size) %>b</span><%= html.html_escape(v.size) %></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> </tr> <% end %> diff --git a/freeradius3-listpasswdfiles-html.lsp b/freeradius3-listpasswdfiles-html.lsp index a3b454c..e305a23 100644 --- a/freeradius3-listpasswdfiles-html.lsp +++ b/freeradius3-listpasswdfiles-html.lsp @@ -3,20 +3,6 @@ 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>'); @@ -55,7 +41,7 @@ end <% end %> </td> <td><%= html.html_escape(v.filename) %></td> - <td><span class="hide"><%= convertsize(v.size) %>b</span><%= html.html_escape(v.size) %></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> </tr> <% end %> |