diff options
author | clyhtsuriva <clyhtsuriva@gmail.com> | 2020-05-09 10:35:49 +0200 |
---|---|---|
committer | clyhtsuriva <clyhtsuriva@gmail.com> | 2020-05-09 10:35:49 +0200 |
commit | cb6a7852bf1015497aaaf40cc41050405f3f3f84 (patch) | |
tree | 143b0e5019a01404c271b8679d93a541ffdd147f /www/html/affiche-tas.py | |
parent | 8b57e76f64cf5de3d0a810019a7fcff03d876544 (diff) |
beaucoup de modifs
Diffstat (limited to 'www/html/affiche-tas.py')
-rw-r--r-- | www/html/affiche-tas.py | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/www/html/affiche-tas.py b/www/html/affiche-tas.py new file mode 100644 index 0000000..726bed4 --- /dev/null +++ b/www/html/affiche-tas.py @@ -0,0 +1,38 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- + +import mod_python +from fonctions import baseHTML, connexionBD, lien + +def index(req): + req.content_type="text/html" + content=str() + + conn=connexionBD() + cur=conn.cursor() + + sql="SELECT * FROM paquet ORDER BY heure DESC;" + + cur.execute(sql) + conn.commit() + data=cur.fetchall() + + conn.close() + + for i in data: + content+=("""<tr>""" + +"""<td>""" + str(i[1]) + """</td>""" + +"""<td>""" + str(i[2]) + """</td>""" + +"""<td>""" + str(i[3]) + """</td>""" + +"""<td>""" + lien('destination.py?ip=' + str(i[4]), str(i[4])) + """</td>""" + +"""<td>""" + str(i[5]) + """</td>""" + +"""<td>""" + str(i[6]) + """</td>""" + +"""</tr>""") + + req.write(""" +<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>""") |