summaryrefslogtreecommitdiffstats
path: root/postgresql-listfiles-html.lsp
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2015-12-30 14:06:42 +0000
committerTed Trask <ttrask01@yahoo.com>2015-12-30 14:06:42 +0000
commit6ec1b47d5c92ba76ca5b78ff1c467312b6169c5d (patch)
tree83a23222d5a7bc8119e0bf5bf77e37fc0485cd1e /postgresql-listfiles-html.lsp
parentfac423d9a798fb368e926d21194feabe0fdebd05 (diff)
downloadacf-postgresql-6ec1b47d5c92ba76ca5b78ff1c467312b6169c5d.tar.bz2
acf-postgresql-6ec1b47d5c92ba76ca5b78ff1c467312b6169c5d.tar.xz
Change listfiles filesize to size, size and mtime not user-friendly, use posix.stat over fs.stat, use new format functions
Diffstat (limited to 'postgresql-listfiles-html.lsp')
-rw-r--r--postgresql-listfiles-html.lsp18
1 files changed, 2 insertions, 16 deletions
diff --git a/postgresql-listfiles-html.lsp b/postgresql-listfiles-html.lsp
index 6b7fc9c..11f904d 100644
--- a/postgresql-listfiles-html.lsp
+++ b/postgresql-listfiles-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>');
@@ -59,8 +45,8 @@ end %>
htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="", option="Edit", action="expert"}), page_info, -1)
%></td>
<td><%= html.html_escape(file.filename) %></td>
- <td><span class="hide"><%= convertsize(file.filesize) %>b</span><%= html.html_escape(file.filesize) %></td>
- <td><%= html.html_escape(file.mtime) %></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>