-- vim:set ft=lua:
PAGE_COUNT=30
dofile(mg.script_name:gsub('[^\\/]*$','')..'util.lua')
ct=CreateContentBuilder(GZIP_THRESHOLD_BYTE)
ct:Append([=[
]=])
edcb.htmlEscape=15
a=edcb.GetReserveData()
table.sort(a, function(a,b) return os.time(a.startTime) < os.time(b.startTime) end)
pageIndex=GetVarInt(mg.request_info.query_string,'page',0,100000) or 0
for i=1,(#a+PAGE_COUNT-1)/PAGE_COUNT do
ct:Append((i-1==pageIndex and ((i-1)*PAGE_COUNT+1)..'~ ' or '
'..((i-1)*PAGE_COUNT+1)..'~ '))
end
ct:Append([=[
view.lua]=])
for i,v in ipairs(edcb.FindFile and edcb.FindFile('\\\\.\\pipe\\SendTSTCP_*',0) or {}) do
n=v.name:match('^[^_]+_(%d+)_%d+$')
if n then
ct:Append('
port'..n..'')
end
end
ct:Append([=[
(
term)
]=])
ct:Finish()
mg.write(ct:Pop(Response(200,'text/html','utf-8',ct.len)..(ct.gzip and 'Content-Encoding: gzip\r\n' or '')..'\r\n'))