From 42029e2ecdb3c68f10a567e0724490c726f70f14 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Thu, 10 Apr 2014 07:23:16 +0000 Subject: Changes to use new htmlviewfunctions functions and make searchdatabase a proper form --- kamailio-listfiles-html.lsp | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) (limited to 'kamailio-listfiles-html.lsp') diff --git a/kamailio-listfiles-html.lsp b/kamailio-listfiles-html.lsp index 564dcce..c2ebfb2 100644 --- a/kamailio-listfiles-html.lsp +++ b/kamailio-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 +%> + @@ -27,17 +41,25 @@ html = require("acf.html") viewlibrary.dispatch_component("status") end %> -

Configuration

+<% local header_level = htmlviewfunctions.displaysectionstart(cfe({label="Configuration"}), page_info) %> + -<% - for k,v in ipairs( view.value ) do - io.write( "\n" ) - end -%> +<% local filename = cfe({ type="hidden", value="" }) %> +<% local redir = cfe({ type="hidden", value=page_info.orig_action }) %> +<% for i,file in ipairs( view.value ) do %> + <% filename.value = file.filename %> + + + + + + +<% end %>
Action File Size Last Modified
" .. html.html_escape(v.filename) .. "" .. html.html_escape(v.size) .."" .. html.html_escape(v.mtime) .."
<% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="", option="Edit", action="edit"}), page_info, -1) %><%= html.html_escape(file.filename) %><%= convertsize(file.size) %>b<%= html.html_escape(file.size) %><%= html.html_escape(file.mtime) %>
+<% htmlviewfunctions.displaysectionend(header_level) %> -- cgit v1.2.3