modification export_matrice_flux, ajout nom SCAN
This commit is contained in:
@@ -158,11 +158,9 @@ def export_to_excel(json_file_path, output_file_excel):
|
|||||||
"Description": acl_desc,
|
"Description": acl_desc,
|
||||||
"Src Equipement": ", ".join(src_e),
|
"Src Equipement": ", ".join(src_e),
|
||||||
"Src CIDR": src_c,
|
"Src CIDR": src_c,
|
||||||
"Src VLAN":"",
|
|
||||||
"Src Site": src_sites,
|
"Src Site": src_sites,
|
||||||
"Dst Equipement": ", ".join(dst_e),
|
"Dst Equipement": ", ".join(dst_e),
|
||||||
"Dst CIDR": dst_c,
|
"Dst CIDR": dst_c,
|
||||||
"Dst VLAN":"",
|
|
||||||
"Dst Site": dst_sites,
|
"Dst Site": dst_sites,
|
||||||
"Application": cfg.get("description",""),
|
"Application": cfg.get("description",""),
|
||||||
"Port": transport.get("destination-port",""),
|
"Port": transport.get("destination-port",""),
|
||||||
@@ -173,6 +171,10 @@ def export_to_excel(json_file_path, output_file_excel):
|
|||||||
})
|
})
|
||||||
|
|
||||||
df = pd.DataFrame(rows)
|
df = pd.DataFrame(rows)
|
||||||
|
tier_is_empty = df["Tier"].replace("", pd.NA).isna().all()
|
||||||
|
if tier_is_empty:
|
||||||
|
df = df.drop(columns=["Tier"])
|
||||||
|
|
||||||
df_addr = pd.DataFrame([
|
df_addr = pd.DataFrame([
|
||||||
{
|
{
|
||||||
"Group Name": g,
|
"Group Name": g,
|
||||||
|
|||||||
@@ -20,9 +20,14 @@ def format_cell_multiline(value):
|
|||||||
return val.replace(", ", "\n").replace(";", "\n").replace(",", "\n").replace(";", "\n")
|
return val.replace(", ", "\n").replace(";", "\n").replace(",", "\n").replace(";", "\n")
|
||||||
|
|
||||||
def style_matrice_flux(ws):
|
def style_matrice_flux(ws):
|
||||||
|
header_values = [cell.value for cell in ws[2]]
|
||||||
|
has_tier = "Tier" in header_values
|
||||||
|
|
||||||
headers = [
|
headers = [
|
||||||
("Description",2),("Source",4),("Destination",4),
|
("Description", 2), ("Source", 3), ("Destination", 3),
|
||||||
("Application",1),("Port",1),("Miscellaneous",1),("Action",1),("Tier",1),("Active",1)
|
("Application", 1), ("Port", 1), ("Miscellaneous", 1), ("Action", 1),
|
||||||
|
*([("Tier", 1)] if has_tier else []),
|
||||||
|
("Active", 1)
|
||||||
]
|
]
|
||||||
|
|
||||||
col = 1
|
col = 1
|
||||||
@@ -57,9 +62,9 @@ def style_matrice_flux(ws):
|
|||||||
cell.border = thin_border
|
cell.border = thin_border
|
||||||
|
|
||||||
col_widths = {
|
col_widths = {
|
||||||
"A": 50, "B": 35, "C": 35, "D": 18, "E": 15, "F": 15,
|
"A": 50, "B": 35, "C": 35, "D": 18, "E": 15,
|
||||||
"G": 35, "H": 18, "I": 15, "J": 15, "K": 12, "L": 20,
|
"F": 35, "G": 18, "H": 15, "I": 12, "J": 20,
|
||||||
"M": 25, "N": 9, "O": 7, "P": 7
|
"K": 25, "L": 9, "M": 7, "N": 7
|
||||||
}
|
}
|
||||||
for col_letter, width in col_widths.items():
|
for col_letter, width in col_widths.items():
|
||||||
ws.column_dimensions[col_letter].width = width
|
ws.column_dimensions[col_letter].width = width
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# Analyse Réseau
|
# SCAN
|
||||||
|
Standardization, Centralization and Analysis of Networks
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
|
|||||||
2
main.py
2
main.py
@@ -68,7 +68,7 @@ def relaunch_in_venv():
|
|||||||
# Contenu fenêtre principale
|
# Contenu fenêtre principale
|
||||||
def open_main_gui():
|
def open_main_gui():
|
||||||
root = tk.Tk()
|
root = tk.Tk()
|
||||||
root.title("Analyse Réseau")
|
root.title("SCAN")
|
||||||
root.geometry("650x500")
|
root.geometry("650x500")
|
||||||
root.resizable(True, True)
|
root.resizable(True, True)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user