From fb7f65d60670cf322429daaa263fc847476a865d Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Sun, 28 Oct 2012 03:21:24 +0000 Subject: Removed unneeded views by updating CFE for autoview --- iptables-createchain-html.lsp | 1 - iptables-editchain-html.lsp | 16 ---------------- iptables-model.lua | 10 +++++++--- 3 files changed, 7 insertions(+), 20 deletions(-) delete mode 120000 iptables-createchain-html.lsp delete mode 100644 iptables-editchain-html.lsp diff --git a/iptables-createchain-html.lsp b/iptables-createchain-html.lsp deleted file mode 120000 index 4ff1163..0000000 --- a/iptables-createchain-html.lsp +++ /dev/null @@ -1 +0,0 @@ -iptables-editchain-html.lsp \ No newline at end of file diff --git a/iptables-editchain-html.lsp b/iptables-editchain-html.lsp deleted file mode 100644 index 3648a39..0000000 --- a/iptables-editchain-html.lsp +++ /dev/null @@ -1,16 +0,0 @@ -<% local form, viewlibrary, page_info = ... -require("htmlviewfunctions") -html = require("acf.html") -%> - -

<%= html.html_escape(form.label) %>

-<% - form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action - if page_info.action == "editchain" then - form.value.table.readonly = true - form.value.table.type = "text" - form.value.chain.readonly = true - end - local order = {"table", "chain", "policy"} - htmlviewfunctions.displayform(form, order) -%> diff --git a/iptables-model.lua b/iptables-model.lua index e06512e..537baea 100644 --- a/iptables-model.lua +++ b/iptables-model.lua @@ -221,19 +221,23 @@ end function read_chain(tab, chain) local retval = {} - retval.table = cfe({ type="select", value=tab or "filter", label="Table", option=tables }) - retval.chain = cfe({ value=chain or "", label="Chain" }) + retval.table = cfe({ type="select", value=tab or "filter", label="Table", option=tables, seq=1 }) + retval.chain = cfe({ value=chain or "", label="Chain", seq=2 }) getdetails() if tab and not details[tab] then retval.table.errtxt = "Invalid table" end if chain then + retval.table.readonly = true + retval.table.type = "text" + retval.chain.readonly = true + local chn = find_chain(retval.table.value, chain) if not chn then retval.chain.errtxt = "Cannot find chain" elseif chn.policy then -- only built-in chains can have policies, and the target can only be DROP or ACCEPT - retval.policy = cfe({ type="select", value=chn.policy, label="Policy", option={"DROP", "ACCEPT"} }) + retval.policy = cfe({ type="select", value=chn.policy, label="Policy", option={"DROP", "ACCEPT"}, seq=3 }) end end return cfe({ type="group", value=retval, label="Chain" }) -- cgit v1.2.3