summaryrefslogtreecommitdiffstats
path: root/logfiles-status-html.lsp
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2015-12-30 13:38:14 +0000
committerTed Trask <ttrask01@yahoo.com>2015-12-30 13:54:13 +0000
commit94a0a302dab75c3a901c736a47b93b614d5e83d1 (patch)
tree86d29052748f3b913e31f1b4274cd61348567bcf /logfiles-status-html.lsp
parent92baed49c0b6780fbd55ebb2e0fb9b1ee13e220e (diff)
downloadacf-alpine-baselayout-94a0a302dab75c3a901c736a47b93b614d5e83d1.tar.bz2
acf-alpine-baselayout-94a0a302dab75c3a901c736a47b93b614d5e83d1.tar.xz
Change logfiles filesize to size, size and mtime not user-friendly, use posix.stat over fs.stat, use new format functions
Diffstat (limited to 'logfiles-status-html.lsp')
-rw-r--r--logfiles-status-html.lsp18
1 files changed, 2 insertions, 16 deletions
diff --git a/logfiles-status-html.lsp b/logfiles-status-html.lsp
index e85a9ba..688d975 100644
--- a/logfiles-status-html.lsp
+++ b/logfiles-status-html.lsp
@@ -2,20 +2,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>');
@@ -71,8 +57,8 @@ end
<td><% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename}, label="", option="View", action="view" }), page_info, -1) %></td>
<td><% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename}, label="", option="Tail", action="tail" }), page_info, -1) %></td>
<td><% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, viewtype=viewtype}, label="", option="Download", action="download" }), page_info, -1) %></td>
- <td><span class="hide"><%= convertsize(file.value.filesize.value) %>b</span><%= html.html_escape(file.value.filesize.value) %></td>
- <td><%= html.html_escape(file.value.mtime.value) %></td>
+ <td><span class="hide"><%= html.html_escape(file.value.size.value) %>b</span><%= format.formatfilesize(file.value.size.value) %></td>
+ <td><%= format.formattime(file.value.mtime.value) %></td>
<td><%= html.html_escape(file.value.filename.value) %></td>
</tr>
<% end %>