From 2134c4226de25957c7a778dc7ada93eb1e007a83 Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Sat, 20 Apr 2024 16:54:33 -0400 Subject: [PATCH] Fix audit log raw --- app/classes/models/management.py | 2 ++ app/frontend/templates/panel/activity_logs.html | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/classes/models/management.py b/app/classes/models/management.py index 38ce53b2..dc57816d 100644 --- a/app/classes/models/management.py +++ b/app/classes/models/management.py @@ -156,6 +156,8 @@ class HelpersManagement: ) def add_to_audit_log_raw(self, user_name, user_id, server_id, log_msg, source_ip): + if isinstance(server_id, Servers) and server_id is not None: + server_id = server_id.server_id auth_logger.info( str(log_msg), extra={ diff --git a/app/frontend/templates/panel/activity_logs.html b/app/frontend/templates/panel/activity_logs.html index 45ab3a79..e053e50e 100644 --- a/app/frontend/templates/panel/activity_logs.html +++ b/app/frontend/templates/panel/activity_logs.html @@ -111,7 +111,11 @@ $.each(data, function (index, value) { let row = $(''); row.append(`${value.time}`); - row.append(`${value.user_name}`); + if (value.user_name != "system" && value.user_id != "-1") { + row.append(`${value.user_name}`); + } else { + row.append(`${value.user_name}`); + } row.append(`${value.log_msg}`); row.append(`${value.server_id}`); row.append(`${value.source_ip}`);