diff --git a/app.py b/app.py
index a4b7f49..9bcb2f9 100644
--- a/app.py
+++ b/app.py
@@ -103,85 +103,7 @@ except Exception as e:
def display_haproxy_stats():
haproxy_stats = fetch_haproxy_stats()
parsed_stats = parse_haproxy_stats(haproxy_stats)
- return render_template_string('''
-
-
- Haproxy Configurator
-
-
- Home
- Add Frontend&Backend
- Edit HAProxy Config
- Security Events
- Statistics
- HAProxy Stats
-
| Frontend Name | -Server Name | -4xx Errors | -5xx Errors | -Bytes In (MB) | -Bytes Out (MB) | -Total Connections | -
|---|---|---|---|---|---|---|
| {{ stat.frontend_name }} | -{{ stat.server_name }} | -{{ stat['4xx_errors'] }} | -{{ stat['5xx_errors'] }} | -{{ stat.bytes_in_mb }} | -{{ stat.bytes_out_mb }} | -{{ stat.conn_tot }} | -
| Frontend Name | +Server Name | +4xx Errors | +5xx Errors | +Bytes In (MB) | +Bytes Out (MB) | +Total Connections | +
|---|---|---|---|---|---|---|
| + {{ stat.frontend_name }} + | ++ {{ stat.server_name }} + | ++ {% if stat['4xx_errors'] > 0 %} + {{ stat['4xx_errors'] }} + {% else %} + {{ stat['4xx_errors'] }} + {% endif %} + | ++ {% if stat['5xx_errors'] > 0 %} + {{ stat['5xx_errors'] }} + {% else %} + {{ stat['5xx_errors'] }} + {% endif %} + | +{{ "%.2f"|format(stat.bytes_in_mb) }} | +{{ "%.2f"|format(stat.bytes_out_mb) }} | ++ {{ stat.conn_tot }} + | +