From 70af483e01ea81915929dc07adc342dd5e093014 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 3 Oct 2024 21:38:30 -0700 Subject: [PATCH] wall of shame! @xdep dude seriously thank you so much fun --- logs/mesh_network_analyzer.py | 76 +++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/logs/mesh_network_analyzer.py b/logs/mesh_network_analyzer.py index 25c6854..9da3cf1 100644 --- a/logs/mesh_network_analyzer.py +++ b/logs/mesh_network_analyzer.py @@ -226,6 +226,18 @@ def get_system_info(): 'cli_local': cli_local } +def get_wall_of_shame(): + # Get the wall of shame + return { + 'shame': "N/A", + } + +def get_database_info(): + # Get the database information + return { + 'database': "N/A", + } + def generate_main_html(log_data, system_info): html_template = """ @@ -342,6 +354,8 @@ def generate_main_html(log_data, system_info): @@ -639,6 +653,58 @@ def generate_sys_hosts_html(system_info): template = Template(html_template) return template.safe_substitute(system_info) +def generate_wall_of_shame_html(shame_info): + html_template = """ + + + + + + Wall Of Shame + + + +

Put Shame Here

+ + + +
Shame MetricValue
shame${shame}
+ + + """ + + template = Template(html_template) + return template.safe_substitute(shame_info) + +def generate_database_html(database_info): + html_template = """ + + + + + + Database Information + + + +

Database Information

+

${database}

+ + + """ + + template = Template(html_template) + return template.safe_substitute(database_info) + def main(): log_dir = LOG_PATH today = datetime.now().strftime('%Y_%m_%d') @@ -652,10 +718,14 @@ def main(): log_data = parse_log_file(log_path) system_info = get_system_info() + shame_info = get_wall_of_shame() + database_info = get_database_info() main_html = generate_main_html(log_data, system_info) network_map_html = generate_network_map_html(log_data) hosts_html = generate_sys_hosts_html(system_info) + wall_of_shame = generate_wall_of_shame_html(shame_info) + database_html = generate_database_html(database_info) output_dir = W3_PATH index_path = os.path.join(output_dir, 'index.html') @@ -684,6 +754,12 @@ def main(): with open(os.path.join(output_dir, f'hosts_{today}.html'), 'w') as f: f.write(hosts_html) + with open(os.path.join(output_dir, f'wall_of_shame_{today}.html'), 'w') as f: + f.write(wall_of_shame) + + with open(os.path.join(output_dir, f'database_{today}.html'), 'w') as f: + f.write(database_html) + print(f"HTML reports generated for {today} in {output_dir}") except PermissionError: