From 939bdbf3bc8e4b1b11b82a89dc863f15fe42ae26 Mon Sep 17 00:00:00 2001 From: Pavel Loginov Date: Tue, 19 Oct 2021 13:10:52 +0600 Subject: [PATCH] v5.3.1.0 Changelog: https://haproxy-wi.org/changelog.py#5_3_1 --- app/funct.py | 10 ++++++++-- inc/style.css | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/funct.py b/app/funct.py index 4605bda1..79fb02b7 100644 --- a/app/funct.py +++ b/app/funct.py @@ -192,10 +192,16 @@ def keep_action_history(service: str, action: str, server_ip: str, login: str, u import sql try: server_id = sql.select_server_id_by_ip(server_ip=server_ip) - user_id = sql.get_user_id_by_username(login) + if login != '': + user_id = sql.get_user_id_by_username(login) + else: + user_id = 0 + if user_ip == '': + user_ip = 'localhost' + sql.insert_action_history(service, action, server_id, user_id, user_ip) except Exception as e: - print('Cannot save a history ' + srt(e)) + logging('localhost', 'Cannot save a history: ' + srt(e), haproxywi=1) def telegram_send_mess(mess, **kwargs): diff --git a/inc/style.css b/inc/style.css index 23bcf5d0..26d9fefc 100644 --- a/inc/style.css +++ b/inc/style.css @@ -758,7 +758,7 @@ label { background-color: #fbfbfb; border: 1px solid #A4C7F5; height: 165px; - width: 375px; + width: 400px; padding: 10px 15px 20px; margin: 0 5px 20px 20px; display: block;