fixes #2450 add user agent in activities performed with api key

Updated user activity display to show when a user is connected via API key, including an icon and updated tooltip. Modified backend to set a 'connected_with' flag in activity details when API key authentication is used.
This commit is contained in:
Linty
2025-11-18 15:48:42 +01:00
parent da2804db72
commit 31d8f4516c
2 changed files with 11 additions and 3 deletions

View File

@@ -481,7 +481,7 @@ function lineConstructor(line) {
/* Detail_section */
newLine.find(".detail-item-1").html(line.ip_address);
newLine.find(".detail-item-1").attr("title", "IP");
newLine.find(".detail-item-1").attr("title", "IP: " + line.ip_address);
if (line.detailsType == "script") {
newLine.find(".detail-item-2").html(line.details.script);
@@ -492,8 +492,10 @@ function lineConstructor(line) {
}
if (line.details.agent) {
newLine.find(".detail-item-3").html(line.details.agent);
newLine.find(".detail-item-3").attr('title', line.details.agent);
const api_key = line.details.connected_with ? 'API Key, ' : '';
const details = line.details.connected_with ? '<i class="icon-key"></i>' + line.details.agent : line.details.agent;
newLine.find(".detail-item-3").html(details);
newLine.find(".detail-item-3").attr('title', api_key + 'User-Agent: ' + line.details.agent);
} else if (line.details.users && line.action != "logout" && line.action != "login") {
const user_string = [...new Set(line.details.users)].toString();
newLine.find(".detail-item-3").html(user_string);