diff options
Diffstat (limited to 'www/html/destination.py')
-rwxr-xr-x | www/html/destination.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/www/html/destination.py b/www/html/destination.py index 4d37c22..032d797 100755 --- a/www/html/destination.py +++ b/www/html/destination.py @@ -25,14 +25,18 @@ def index(req): #sql part conn=connexionBD() cur=conn.cursor() - sql="select * from paquet where ip_destination='{}';".format(ip) + + sql="select * from paquet where ip_destination='{}' ORDER BY heure DESC;".format(ip) sql_count="select count(*) from paquet where ip_destination='{}';".format(ip) + cur.execute(sql) conn.commit() data=cur.fetchall() + cur.execute(sql_count) conn.commit() - rec=cur.fetchone() + count=cur.fetchone() + conn.close() #sql part @@ -49,12 +53,12 @@ def index(req): #write the html page req.write(baseHTML("Destination",""" -<center><h1>IP Destination : """ + ip + """</h1></center> -<p>Nombre de paquets en destination de """+ ip + """ : <b>"""+ str(rec[0])+ """</b><p> -<center><table> +<h1>IP Destination : """ + ip + """</h1> +<p>Nombre de paquets en destination de """+ ip + """ : <b>"""+ str(count[0])+ """</b></p> +<table class="data_tab"> <tr><th>Heure</th><th>Protocole</th><th>IP Source</th><th>IP Destination</th><th>Port Source</th><th>Port Destination</th></tr> """ + content + """ -</table></center> +</table> """)) |