From 9d959fdbace25ac2a7f28149793d3fce7000bea1 Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Thu, 4 Sep 2008 12:17:34 +0000 Subject: Removing some details from the statuspage so it gets cleaner and not so technical git-svn-id: svn://svn.alpinelinux.org/acf/ipsec-tools/trunk@1445 ab2d0c66-481e-0410-8bed-d214d4d58bed --- ipsectools-model.lua | 13 ++++++++++--- ipsectools-status-html.lsp | 25 +++++++++++-------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/ipsectools-model.lua b/ipsectools-model.lua index 9e68b3d..c30fbb7 100644 --- a/ipsectools-model.lua +++ b/ipsectools-model.lua @@ -46,8 +46,8 @@ end local function phase2details(dst) local output = {} dst = string.match(dst,"^(.*)%.") -- Removes the portnumber - table.insert(output, {label="Outgoing", value=ip_xfrm("state list src ".. dst)}) - table.insert(output, {label="Incoming", value=ip_xfrm("state list dst ".. dst)}) + table.insert(output, {label="Outgoing", value=ip_xfrm("state list src ".. dst .. " | grep '^src'")}) + table.insert(output, {label="Incoming", value=ip_xfrm("state list dst ".. dst .. " | grep '^src'")}) return output end @@ -105,11 +105,18 @@ local function racoonctl_table() value=(variable[8] or "") .. " " .. (variable[9] or ""), }) + local phase2s = phase2details(variable[2]) output[k]['Phase2']=cfe({ name="Phase2", label="Phase2", value=variable[10], - option=phase2details(variable[2]), + option=phase2s, + }) + + output[k]['Phase2details']=cfe({ + name="Phase2details", + label="Phase2details", + value=tostring(string.gsub(phase2s[1]['value'],"\n","
")) .. tostring(string.gsub(phase2s[2]['value'],"\n","
")) }) end end diff --git a/ipsectools-status-html.lsp b/ipsectools-status-html.lsp index 83e1474..447f007 100644 --- a/ipsectools-status-html.lsp +++ b/ipsectools-status-html.lsp @@ -1,6 +1,10 @@ -<% local form = ... %> -<% +<% local form = ... require("viewfunctions") +--[[ DEBUG INFORMATION +io.write("

DEBUGGING

DEBUG INFO: CFE

") +io.write(html.cfe_unpack(form)) +io.write("
") +--]] %>

SYSTEM INFO

@@ -13,34 +17,27 @@ displayinfo(myform,tags,"viewonly")

PROGRAM SPECIFIC OPTIONS/INFORMATION

-

Phase1 and Phase2 information

<% local myform = form.status.show_isakmp.option for k,v in pairs(myform) do if (type(v) == "table") and (v.Destination) and (v.Destination.value) and (#v.Destination.value > 0) then - io.write("
".. v['Destination']['value'] .. "
") - io.write("
\n") - io.write("") - local tags = {"Created","Source", "St", "S", "E",} + io.write(".png' width='16' height='16'> ".. v['Destination']['value'] .. "") + io.write("
Phase1 details
\n") + local tags = {"Created","Source","Destination", "St", "Phase2details"} for k1,v1 in pairs(tags) do io.write("") end - io.write("") - for k1,v1 in pairs(v['Phase2']['option']) do - io.write("") - end - io.write("
" .. (v[v1]['label'] or "") .. ""..(v[v1]['value'] or "")) if (v[v1]['descr']) and (#v[v1]['descr'] > 0) then io.write(" (".. v[v1]['descr'] .. ")") end io.write("
Phase2 details
" .. (v1['value'] or "") .. "
") - io.write("
") + io.write("") end end %> -- cgit v1.2.3