aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xwww/html/destination.py5
-rwxr-xr-xwww/html/index.py8
-rwxr-xr-xwww/html/style.css12
3 files changed, 24 insertions, 1 deletions
diff --git a/www/html/destination.py b/www/html/destination.py
index cc8713a..4d37c22 100755
--- a/www/html/destination.py
+++ b/www/html/destination.py
@@ -26,9 +26,13 @@ def index(req):
conn=connexionBD()
cur=conn.cursor()
sql="select * from paquet where ip_destination='{}';".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()
conn.close()
#sql part
@@ -46,6 +50,7 @@ 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>
<tr><th>Heure</th><th>Protocole</th><th>IP Source</th><th>IP Destination</th><th>Port Source</th><th>Port Destination</th></tr>
"""
diff --git a/www/html/index.py b/www/html/index.py
index 958c5be..d483458 100755
--- a/www/html/index.py
+++ b/www/html/index.py
@@ -32,6 +32,8 @@ def index(req):
#write the html page
req.write(baseHTML("ATS-Project","""
<center><h1>ATS-Project</h1></center>
+<div id="tip" style="display:block;">
+Pour voir le nombre de paquets en destination d'une adresse IP, cliquez sur cette derniere dans le tableau.<div id="ok" onclick="toggle_div(this,'tip');"><b>OK</b></div></div>
<b>Filtre</b>
<input type="text" id="condition" onkeyup="cherche()">
<div id="tab">
@@ -43,4 +45,10 @@ def index(req):
</table></center>
</div>
<script src="filtre.js"></script>
+<script>
+function toggle_div(bouton, id) {
+ var div = document.getElementById(id);
+ div.style.display = "none";
+}
+</script>
"""))
diff --git a/www/html/style.css b/www/html/style.css
index 45ce811..a826da5 100755
--- a/www/html/style.css
+++ b/www/html/style.css
@@ -19,7 +19,7 @@ a {
text-decoration: none;
}
- a:hover {
+a:hover {
color: red;
}
@@ -27,3 +27,13 @@ table,th,td {
border: 2px solid red;
text-align: center;
}
+
+#tip {
+ color: #6666ff;
+ position: fixed;
+ bottom: 10px;
+ right: 50px;
+ border: solid #6666ff;
+ padding:10px;
+ background-color: black;
+}