summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--freeradius3-listmacauthfiles-html.lsp16
-rw-r--r--freeradius3-listpasswdfiles-html.lsp16
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 %>