-- vim:set ft=lua: PAGE_COUNT=50 dofile(mg.script_name:gsub('[^\\/]*$','')..'util.lua') vtag=GetVarInt(mg.request_info.query_string,'vtag') or -1 ct=CreateContentBuilder(GZIP_THRESHOLD_BYTE) ct:Append([=[

# 予約一覧

]=]) rsdef=(edcb.GetReserveData(0x7FFFFFFF) or {}).recSetting rate={} for i=page*PAGE_COUNT+1,math.min(#a,(page+1)*PAGE_COUNT) do v=a[i] size=nil if v.recSetting.recMode~=4 then --予想ファイルサイズ for j=1,4 do key=('%04X%04X%04X'):format((j>3 and 65535 or v.onid),(j>2 and 65535 or v.tsid),(j>1 and 65535 or v.sid)) rate[key]=rate[key] or tonumber(edcb.GetPrivateProfile('BITRATE',key,0,'Bitrate.ini')) or 0 if rate[key]>0 then break elseif j==4 then rate[key]=19456 end end size=rate[key]/8*1000*math.max((v.recSetting.startMargin or rsdef and rsdef.startMargin or 0)+ (v.recSetting.endMargin or rsdef and rsdef.endMargin or 0)+v.durationSecond,0) end cl=v.recSetting.recMode==5 and ' class="disabled"' or v.overlapMode==1 and ' class="partially"' or v.overlapMode==2 and ' class="shortage"' or '' ct:Append('
' ..FormatTimeAndDuration(v.startTime, v.durationSecond) ..''..v.stationName..''..v.title ..''..(RecModeTextList()[v.recSetting.recMode+1] or '') ..''..v.recSetting.priority ..''..(size and ('%.1fG'):format(size/1024/1024/1024) or '')..'
\n') 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((vtag..''==n and ' -pipe'..n ..(vtag..''==n and '' or ' (video)')) 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'))