From f04705827a8426fdd51f876d0ad8ed9352538c18 Mon Sep 17 00:00:00 2001 From: clyhtsuriva Date: Sun, 19 Apr 2020 22:10:42 +0200 Subject: ajout de ports, centrage tableau, ... --- www/html/index.py | 17 ++++++++++------- www/html/init-bd.sql | 8 +++++--- 2 files changed, 15 insertions(+), 10 deletions(-) (limited to 'www/html') diff --git a/www/html/index.py b/www/html/index.py index 010ed2d..bf4face 100755 --- a/www/html/index.py +++ b/www/html/index.py @@ -12,28 +12,31 @@ def index(req): #sql part conn=connexionBD() cur=conn.cursor() - sql="select * from trame;" + sql="select * from paquet;" cur.execute(sql) conn.commit() data=cur.fetchall() conn.close() #sql part +#takes every lines from the select for i in data : - content+=("""""" + + content+=("""""" + """""" + str(i[1]) + """""" + """""" + str(i[2]) + """""" + """""" + str(i[3]) + """""" + """""" + str(i[4]) + """""" + +"""""" + str(i[5]) + """""" + +"""""" + str(i[6]) + """""" + """""") +#write the html page req.write(baseHTML("ATS-Project","""

ATS-Project

- - +
HeureProtocoleSourceDestination
+ """ + content + """ -
HeureProtocoleIP SourceIP DestinationPort SourcePort Destination
-""")) #tableheads to change so it takes the output of the select - + +""")) diff --git a/www/html/init-bd.sql b/www/html/init-bd.sql index f824545..4621dfc 100755 --- a/www/html/init-bd.sql +++ b/www/html/init-bd.sql @@ -4,9 +4,11 @@ drop table if exists paquet cascade; create table paquet( id_paquet SERIAL PRIMARY KEY, heure TIME(0) NOT NULL, - protocole VARCHAR(100) NOT NULL, - source VARCHAR(100) NOT NULL, - destination VARCHAR(100) NOT NULL + protocole VARCHAR NOT NULL, + ip_source VARCHAR NOT NULL, + ip_destination VARCHAR NOT NULL, + port_source INT NOT NULL, + port_destination INT NOT NULL ); -- cgit v1.2.3