From 4997bbffa20c9c4910502e8fdab28d7956514d88 Mon Sep 17 00:00:00 2001 From: Brian Read Date: Mon, 1 Jul 2024 08:54:19 +0100 Subject: [PATCH] more format for the table plus supress links when no database saved --- .../opt/mailstats/templates/mailstats.html.pt | 31 ++++++++++++++----- root/usr/bin/mailstats.py | 6 +++- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/root/opt/mailstats/templates/mailstats.html.pt b/root/opt/mailstats/templates/mailstats.html.pt index 9192df7..0e69c6d 100644 --- a/root/opt/mailstats/templates/mailstats.html.pt +++ b/root/opt/mailstats/templates/mailstats.html.pt @@ -59,14 +59,29 @@ Totals Percent Hour - - - - Cell - - - Cell - + + + + + + + Cell + - + + + + + + Cell + - + + + + + Cell + - + + diff --git a/root/usr/bin/mailstats.py b/root/usr/bin/mailstats.py index 4e8f8be..6835cfb 100644 --- a/root/usr/bin/mailstats.py +++ b/root/usr/bin/mailstats.py @@ -777,6 +777,7 @@ if __name__ == "__main__": print(f"Unable to connect to {DBName} on {DBHost} port {DBPort} error ({e}) ") saveData = False + nolinks = not saveData # Not sure we need these... # if (ConfigDB,"qpsmtpd","RHSBL").lower() == 'enabled': # RBLList = get_value(ConfigDB,"qpsmtpd","RBLList") @@ -1120,7 +1121,10 @@ if __name__ == "__main__": template = PageTemplate(template_content) # Render the template with the 2D array data and column headers try: - rendered_html = template(array_2d=columnCounts_2d, column_headers=columnHeaders, reporting_date=analysis_date, title=hello_string, version=version_string) + rendered_html = template(array_2d=columnCounts_2d, column_headers=columnHeaders, + reporting_date=analysis_date, title=hello_string, + version=version_string, + nolinks=nolinks) except Exception as e: print(f"Chameleon template Exception {e}") except Exception as e: