From c700c97cb992cdc3eb62d93a52e1bf56ed5ea585 Mon Sep 17 00:00:00 2001 From: ttrask Date: Tue, 17 Mar 2009 20:39:56 +0000 Subject: Changed the way startstop works in core to add a list of allowed actions. Modified all ACFs that don't use the standard functions to work with new library method. git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@1730 ab2d0c66-481e-0410-8bed-d214d4d58bed --- app/startstop-html.lsp | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'app/startstop-html.lsp') diff --git a/app/startstop-html.lsp b/app/startstop-html.lsp index ab9b8ac..924f14d 100644 --- a/app/startstop-html.lsp +++ b/app/startstop-html.lsp @@ -1,23 +1,30 @@ <% local data, viewlibrary, page_info = ... %> +<% local reverseactions = {} +data.value.actions = data.value.actions or {} +local actions = data.value.actions.value or {"start", "stop", "restart"} +for i,act in ipairs(actions) do + reverseactions[act] = i +end %> +

Management

-
-
" method="POST"> -
Program control-panel
-
-> -> -> -
-
<% if data.value.result then %> -
Previous action result
-
+

Previous action result

<% if data.value.result.value ~= "" then %>

<%= string.gsub(html.html_escape(data.value.result.value), "\n", "
") %>

<% end if data.value.result.errtxt then %>

<%= string.gsub(html.html_escape(data.value.result.errtxt), "\n", "
") %>

<% end end %> + +
+
" method="POST"> +
Program control-panel
+
+<% if reverseactions.start then %>><% end %> +<% if reverseactions.stop then %>><% end %> +<% if reverseactions.restart then %>><% end %> +<% if reverseactions.reload then %>><% end %>
+
-- cgit v1.2.3