#!/bin/sh
#This script is created by ssparser automatically. The parser first created by MaoShouyan
printf "Content-type: text/html
Cache-Control: no-cache

"
echo -n "";
. ../common/common.sh 
myself="/cgi-bin/Maintain/`basename $0`"

echo -n "
<script type=\"text/javascript\" src=\"/img/common.js\"></script>
<script language=\"javascript\">
function onEditEvent(evt)
{
	window.location.href = \"/cgi-bin/Maintain/cfg_evtedit?evtype=\" + evt;
}
	
</script>
<body>
"; cgi_show_title "־->¼" 
echo -n "
<br>
<table width=900 border=0 cellspacing=1 cellpadding=1>
<tr id=tblhdr height=22>
	<td width=120 align=center>¼</td>
	<td width=80 align=center>־ʽ</td>
	<td width=160 align=center>շIP:˿</td>
	<td width=110 align=center>¼ɹ</td>
	<td width=110 align=center>¼ʧ</td>
	<td width=110 align=center>ͳɹ</td>
	<td width=110 align=center>ʧ</td>
        <td width=*   align=center></td>
</tr>
";
tblid="row1"
${FLOWEYE} logger stat event_detail=1 | \
while read cfgevt evtype desc svrip svrport logtype sentok sentfail dropped written theothers;
do
	[ "${cfgevt}" != "evtcfg" ] && continue
	[ "${evtype}" = "appflow" -o "${evtype}" = "alg" ] && continue
	[ "${evtype}" = "url" -o "${evtype}" = "flow" ] && continue

echo -n "
	<tr id=${tblid}>
	<td align=center>${desc}</td>
	"; [ "${logtype}" = "none" ] && logtype="¼" 
echo -n "
	<td align=center>${logtype}</td>
	<td align=center>${svrip}:${svrport}</td>
	<td align=center>${written}</td>
	<td align=center>${dropped}</td>
	<td align=center>${sentok}</td>
	<td align=center>${sentfail}</td>
	<td align=center><a style=\"color:#0000ff\" href=\"javascript:onEditEvent('${evtype}')\">༭</a></td>
	</tr>
";
	if [ "${tblid}" = "row1" ]; then
		tblid="row2"
	else
		tblid="row1"
	fi
done

echo -n "
</table>
</body>
</html>
";