summaryrefslogtreecommitdiffstats
path: root/freeswitch-listfiles-html.lsp
diff options
context:
space:
mode:
Diffstat (limited to 'freeswitch-listfiles-html.lsp')
-rw-r--r--freeswitch-listfiles-html.lsp32
1 files changed, 26 insertions, 6 deletions
diff --git a/freeswitch-listfiles-html.lsp b/freeswitch-listfiles-html.lsp
index caff231..3c96bad 100644
--- a/freeswitch-listfiles-html.lsp
+++ b/freeswitch-listfiles-html.lsp
@@ -2,7 +2,8 @@
require("viewfunctions")
%>
-<% displaycommandresults({"edit", "startstop"}, session) %>
+<% displaycommandresults({"editfile", "deletefile", "startstop"}, session) %>
+<% displaycommandresults({"createfile"}, session, true) %>
<% if viewlibrary and viewlibrary.dispatch_component then
viewlibrary.dispatch_component("status")
@@ -11,18 +12,37 @@ end %>
<h1>Configuration</h1>
<DL><TABLE>
<TR style="background:#eee;font-weight:bold;">
+ <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Action</TD>
<TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">File</TD>
<TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Size</TD>
<TD style="white-space:nowrap;text-align:left;" class="header">Last Modified</TD>
</TR>
-<%
- for k,v in ipairs( view.value ) do
- io.write( "<tr><td><a href=\"" .. html.html_escape(page_info.script .. page_info.prefix .. page_info.controller) .. "/edit?filename=" .. html.html_escape(v.filename) .. "&redir=" .. html.html_escape(page_info.orig_action) .. "\">" .. html.html_escape(v.filename) .. "</a></td><td>" .. html.html_escape(v.size) .."</td><td>" .. html.html_escape(v.mtime) .."</td></tr>\n" )
- end
-%>
+<% for k,v in ipairs( view.value ) do %>
+ <TR>
+ <TD style="padding-right:20px;white-space:nowrap;">
+ <% if viewlibrary.check_permission("editfile") then %>
+ <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editfile?filename="..v.filename.."&redir="..page_info.orig_action, label="Edit "} %>
+ <% end %>
+ <% if viewlibrary.check_permission("deletefile") then %>
+ <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deletefile?filename="..v.filename, label="Delete "} %>
+ <% end %>
+ </TD>
+ <TD style="padding-right:20px;white-space:nowrap;text-align:left;"><%= html.html_escape(v.filename) %></TD>
+ <TD style="padding-right:20px;white-space:nowrap;text-align:left;"><%= html.html_escape(v.size) %></TD>
+ <TD style="white-space:nowrap;"><%= html.html_escape(v.mtime) %></TD>
+ </TR>
+<% end %>
</TABLE></DL>
+<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createfile") then
+ local createform = viewlibrary.dispatch_component("createfile", nil, true) %>
+<H2><%= html.html_escape(createform.label) %></H2>
+<%
+ createform.action = page_info.script .. page_info.prefix .. page_info.controller .. "/createfile"
+ displayform(createform)
+end %>
+
<% if viewlibrary and viewlibrary.dispatch_component then
viewlibrary.dispatch_component("startstop")
end %>