From 9267fef2cb26d66b5d4715004b75f5ba32ed9cc9 Mon Sep 17 00:00:00 2001 From: KF7EEL Date: Fri, 4 Jun 2021 04:43:32 -0700 Subject: [PATCH] start add color to log --- user_managment/app.py | 65 ++++++++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/user_managment/app.py b/user_managment/app.py index 0160cb7..80c11f6 100644 --- a/user_managment/app.py +++ b/user_managment/app.py @@ -974,17 +974,28 @@ def create_app(): \n''' for i in a: - content = content + ''' - - ''' + str(i.login_dmr_id) + ''' + if i.login_type == 'Attempt': + content = content + ''' + + ''' + str(i.login_dmr_id) + ''' ''' + i.portal_username + ''' - ''' + i.peer_ip + ''' - ''' + i.login_auth_method + ''' - ''' + i.server_name + ''' - ''' + str(i.login_time) + ''' - ''' + str(i.login_type) + ''' - - + ''' + i.peer_ip + ''' + ''' + i.login_auth_method + ''' + ''' + i.server_name + ''' + ''' + str(i.login_time) + ''' + ''' + str(i.login_type) + ''' + +''' + if i.login_type == 'Confirmed': + content = content + ''' + + ''' + str(i.login_dmr_id) + ''' + ''' + i.portal_username + ''' + ''' + i.peer_ip + ''' + ''' + i.login_auth_method + ''' + ''' + i.server_name + ''' + ''' + str(i.login_time) + ''' + ''' + str(i.login_type) + ''' ''' content = content + '' @@ -1022,20 +1033,30 @@ def create_app(): \n''' for i in a: - content = content + ''' - - ''' + str(i.login_dmr_id) + ''' + if i.login_type == 'Attempt': + content = content + ''' + + ''' + str(i.login_dmr_id) + ''' ''' + i.portal_username + ''' - ''' + i.peer_ip + ''' - ''' + i.login_auth_method + ''' - ''' + i.server_name + ''' - ''' + str(i.login_time) + ''' - ''' + str(i.login_type) + ''' - - + ''' + i.peer_ip + ''' + ''' + i.login_auth_method + ''' + ''' + i.server_name + ''' + ''' + str(i.login_time) + ''' + ''' + str(i.login_type) + ''' - ''' - +''' + if i.login_type == 'Confirmed': + content = content + ''' + + ''' + str(i.login_dmr_id) + ''' + ''' + i.portal_username + ''' + ''' + i.peer_ip + ''' + ''' + i.login_auth_method + ''' + ''' + i.server_name + ''' + ''' + str(i.login_time) + ''' + ''' + str(i.login_type) + ''' + +''' content = content + '' return render_template('flask_user_layout.html', markup_content = Markup(content))