Differences From
Artifact [241a1c4277]:
28 28 local invoker = quote co:complain(404,'not found','no such control panel is available in this version of parsav') end
29 29
30 30 for i, m in ipairs(mappings) do
31 31 if lib.render.conf[m.render] then
32 32 invoker = quote
33 33 if path(1):cmp(lib.str.lit([m.url])) then
34 34 var body = [lib.render.conf[m.render]] (co, path)
35 - var a: lib.str.acc a:init(body.ct+48)
35 + var a = co:stra(body.ct+48)
36 36 if not body then
37 37 a:lpush(['<h1>' .. m.title .. ' :: error</h1>' ..
38 38 '<p>the requested resource is not available.</p>'])
39 39 panel = a:finalize()
40 40 else
41 41 a:lpush(['<h1>' .. m.title .. '</h1>']):ppush(body)
42 42 panel = a:finalize()
43 - body:free()
43 + --body:free()
44 44 end
45 45 else [invoker] end
46 46 end
47 47 end
48 48 end
49 49
50 50 local terra
51 51 render_conf([co], [path], notify: pstr)
52 - var menu: lib.str.acc menu:init(64):lpush('<hr>') defer menu:free()
52 + var menu = co:stra(256)
53 + menu:lpush('<hr>')
53 54
54 55 -- build menu
55 56 do var p = co.who.rights.powers
56 57 if p:affect_users() then menu:lpush '<a href="/conf/users">users</a>' end
57 58 if p.censor() then menu:lpush '<a href="/conf/censor">badthink alerts</a>' end
58 59 if p.config() then menu:lpush([
59 60 '<a href="/conf/srv">server & policy</a>' ..
................................................................................
74 75 menu = mptr;
75 76 panel = panel;
76 77 }
77 78
78 79 var pgt: pstr
79 80 if notify:ref() then
80 81 var fnpg: lib.str.acc
81 - fnpg:compose('<div class="flashmsg">', notify, '</div>')
82 + fnpg:pcompose(&co.srv.pool, '<div class="flashmsg">', notify, '</div>')
82 83 pg:append(&fnpg)
83 84 pgt = fnpg:finalize()
84 - else pgt = pg:tostr() end
85 - defer pgt:free()
85 + else pgt = pg:poolstr(&co.srv.pool) end
86 + --defer pgt:free()
86 87
87 88 co:stdpage([lib.srv.convo.page] {
88 89 title = 'configure'; body = pgt;
89 90 class = lib.str.plit 'conf';
90 91 cache = false;
91 92 })
92 93
93 - if panel.ct ~= 0 then panel:free() end
94 + --if panel.ct ~= 0 then panel:free() end
94 95 end
95 96
96 97 return render_conf