aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xwww/html/bilan.py23
1 files changed, 18 insertions, 5 deletions
diff --git a/www/html/bilan.py b/www/html/bilan.py
index 376f0c6..735959b 100755
--- a/www/html/bilan.py
+++ b/www/html/bilan.py
@@ -6,7 +6,8 @@ from fonctions import baseHTML, connexionBD, lien
def index(req):
req.content_type="text/html"
- content=str()
+ ipdst=str()
+ portdst=str()
#sql part
conn=connexionBD()
@@ -39,17 +40,27 @@ def index(req):
cur.execute("SELECT ip_destination, COUNT(ip_destination) FROM paquet GROUP BY ip_destination")
conn.commit()
each_ip_dest=cur.fetchall()
+#
+ cur.execute("SELECT port_destination, COUNT(port_destination) FROM paquet GROUP BY port_destination")
+ conn.commit()
+ each_port_dest=cur.fetchall()
###
conn.close()
#sql part
-#loop
+#loops
for i in each_ip_dest :
- content+=("""<tr>
+ ipdst+=("""<tr>
+<td>""" + str(i[0]) + """</td>
+<td>""" + str(i[1]) + """</td>
+ </tr>""")
+
+ for i in each_port_dest :
+ portdst+=("""<tr>
<td>""" + str(i[0]) + """</td>
<td>""" + str(i[1]) + """</td>
</tr>""")
-#loop
+#loops
#write the html page
@@ -66,7 +77,9 @@ def index(req):
<br/>
<table>
<tr><th>IP destination</th><th>Recurrence</th></tr>
-"""+str(content)+"""
+"""+str(ipdst)+"""
+<tr><th>Port destination</th><th>Reccurrence</th></tr>
+"""+str(portdst)+"""
</table>
<canvas id="protocole" width="20vh" height="40vw"></canvas>
<script src="/Chart.js"></script>
d>Clyhtsuriva1-8/+10 2021-05-19Update README.mdClyhtsuriva1-1/+2 2021-05-19Update README.mdClyhtsuriva1-8/+7 2021-05-19Update README.mdrelease/3.2.1Clyhtsuriva1-6/+21 2021-05-19Big updaterelease/3.2Clyhtsuriva55-235/+193 Restructuring the packages and adding a Constants.kt for the api URL. Also adding gson in Singletons.kt 2021-05-19Update README.mdClyhtsuriva1-1/+5 2021-05-14Update README.mdClyhtsuriva1-1/+3 2021-05-14Update README.mdClyhtsuriva1-0/+23 2021-05-14Update README.md and adding logo onto the main screenrelease/3.1Clyhtsuriva2-10/+13 2021-05-14Singletons on all pages : OKClyhtsuriva6-125/+81 2021-05-14Singletons : DetailTopManga : OKClyhtsuriva2-21/+49 2021-05-14Addedd Singletons for TopManga.Clyhtsuriva3-23/+43