jbe@303: local function format_time(seconds) jbe@303: return string.format("%.1f ms", seconds * 1000) jbe@302: end jbe@302: jbe@302: local function format_triple(real_time, proc_time, db_time) jbe@302: if proc_time and db_time then jbe@302: return string.format( bsw@307: "u=%.1f, d=%.1f, t=%.1f", jbe@305: 1000 * proc_time, jbe@302: 1000 * db_time, jbe@302: 1000 * real_time jbe@302: ) jbe@299: else jbe@299: end jbe@295: end jbe@295: jbe/bsw@0: local function open(class) jbe/bsw@0: slot.put('
| ", encode.html(tostring(k)), " | ", encode.html(tostring(v)), " |
')
poelzi@29: slot.put(encode.html(node.message))
poelzi@29: slot.put('')
poelzi@29: close()
jbe/bsw@0: elseif node_type == "request" then
jbe/bsw@0: open("request")
bsw@115: open_head(node)
jbe/bsw@0: slot.put("REQUESTED")
jbe/bsw@0: if node.view then
jbe/bsw@0: slot.put(" VIEW")
jbe/bsw@0: elseif node.action then
jbe/bsw@0: slot.put(" ACTION")
jbe/bsw@0: end
jbe/bsw@0: slot.put(
jbe/bsw@0: ": ",
jbe/bsw@0: encode.html(node.module),
jbe/bsw@0: "/",
jbe/bsw@0: encode.html(node.view or node.action)
jbe/bsw@0: )
jbe/bsw@0: close_with_children()
jbe/bsw@0: elseif node_type == "config" then
jbe/bsw@0: open("config")
bsw@115: open_head(node)
jbe/bsw@0: slot.put('Configuration "', encode.html(node.name), '"')
jbe/bsw@0: close_with_children()
jbe/bsw@0: elseif node_type == "filter" then
jbe/bsw@0: open("filter")
bsw@115: open_head(node)
jbe/bsw@0: slot.put(encode.html(node.path))
jbe/bsw@0: close_with_children()
jbe/bsw@0: elseif node_type == "view" then
jbe/bsw@0: open("view")
bsw@115: open_head(node)
jbe/bsw@0: slot.put(
jbe/bsw@0: "EXECUTE VIEW: ",
jbe/bsw@0: encode.html(node.module),
jbe/bsw@0: "/",
jbe/bsw@0: encode.html(node.view)
jbe/bsw@0: )
jbe/bsw@0: close_with_children()
jbe/bsw@0: elseif node_type == "action" then
jbe/bsw@0: if
jbe/bsw@0: node.status and (
jbe/bsw@0: node.status == "ok" or
jbe/bsw@0: string.find(node.status, "^ok_")
jbe/bsw@0: )
jbe/bsw@0: then
jbe/bsw@0: open("action_success")
jbe/bsw@0: elseif
jbe/bsw@0: node.status and (
jbe/bsw@0: node.status == "error" or
jbe/bsw@0: string.find(node.status, "^error_")
jbe/bsw@0: )
jbe/bsw@0: then
jbe/bsw@0: open("action_softfail")
jbe/bsw@0: else
jbe/bsw@0: open("action_neutral")
jbe/bsw@0: end
bsw@115: open_head(node)
jbe/bsw@0: slot.put(
jbe/bsw@0: "EXECUTE ACTION: ",
jbe/bsw@0: encode.html(node.module),
jbe/bsw@0: "/",
jbe/bsw@0: encode.html(node.action)
jbe/bsw@0: )
jbe/bsw@0: close_head()
jbe/bsw@0: if node.status == "softfail" then
jbe/bsw@0: render_children(
jbe/bsw@0: '