aboutsummaryrefslogtreecommitdiff
path: root/www/html
diff options
context:
space:
mode:
Diffstat (limited to 'www/html')
-rw-r--r--www/html/affiche-tas.py2
-rwxr-xr-xwww/html/destination.py10
-rwxr-xr-xwww/html/index.py3
3 files changed, 9 insertions, 6 deletions
diff --git a/www/html/affiche-tas.py b/www/html/affiche-tas.py
index 726bed4..4c63c3a 100644
--- a/www/html/affiche-tas.py
+++ b/www/html/affiche-tas.py
@@ -11,7 +11,7 @@ def index(req):
conn=connexionBD()
cur=conn.cursor()
- sql="SELECT * FROM paquet ORDER BY heure DESC;"
+ sql="SELECT * FROM paquet ORDER BY heure DESC"
cur.execute(sql)
conn.commit()
diff --git a/www/html/destination.py b/www/html/destination.py
index e0729b1..062ab2f 100755
--- a/www/html/destination.py
+++ b/www/html/destination.py
@@ -26,14 +26,14 @@ def index(req):
conn=connexionBD()
cur=conn.cursor()
- sql="select * from paquet where ip_destination='{}' ORDER BY heure DESC;".format(ip)
- sql_count="select count(*) from paquet where ip_destination='{}';".format(ip)
+ sql="SELECT * FROM paquet WHERE ip_destination=%s ORDER BY heure DESC"
+ sql_count="SELECT COUNT(*) FROM paquet WHERE ip_destination=%s"
- cur.execute(sql)
+ cur.execute(sql, (ip, ))
conn.commit()
data=cur.fetchall()
- cur.execute(sql_count)
+ cur.execute(sql_count, (ip, ))
conn.commit()
count=cur.fetchone()
@@ -55,10 +55,12 @@ def index(req):
req.write(baseHTML(ip,"""
<h1>IP Destination : """ + ip + """</h1>
<p>Nombre de paquets en destination de """+ ip + """ : <b>"""+ str(count[0])+ """</b></p>
+<div id="tab">
<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>
+</div>
"""))
diff --git a/www/html/index.py b/www/html/index.py
index b709c3a..7f419b0 100755
--- a/www/html/index.py
+++ b/www/html/index.py
@@ -44,7 +44,8 @@ def index(req):
<div id="tip" style="display:block;">
Pour voir le nombre de paquets en destination d'une adresse IP, cliquez sur cette dernière dans le tableau.<div id="ok" onclick="toggle_div(this,'tip');"><b>OK</b></div></div>
<p>Nombre total de paquets : <b>"""+ count +"""</b></p>
-<em><div id="ici" onclick="affiche_tas()">Pour afficher toute la table, cliquez sur ce texte.</div></em><br/>
+<em>Pour afficher toute la table, cliquez</em>
+<button onclick="affiche_tas()">ICI</button><br/>
<div id="tab">
<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>