feat: add log_id to suspicious activities for detailed request viewing

This commit is contained in:
Lorenzo Venerandi
2026-03-04 12:37:42 +01:00
parent 3d7958acf8
commit a385381dbd
2 changed files with 6 additions and 2 deletions

View File

@@ -1504,6 +1504,7 @@ class DatabaseManager:
"path": log.path, "path": log.path,
"user_agent": log.user_agent, "user_agent": log.user_agent,
"timestamp": log.timestamp.isoformat(), "timestamp": log.timestamp.isoformat(),
"log_id": log.id,
} }
for log in logs for log in logs
] ]

View File

@@ -8,7 +8,7 @@
<th>Path</th> <th>Path</th>
<th>User-Agent</th> <th>User-Agent</th>
<th>Time</th> <th>Time</th>
<th style="width: 40px;"></th> <th style="width: 80px;"></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -24,7 +24,10 @@
<td>{{ activity.path | e }}</td> <td>{{ activity.path | e }}</td>
<td style="word-break: break-all;">{{ (activity.user_agent | default(''))[:80] | e }}</td> <td style="word-break: break-all;">{{ (activity.user_agent | default(''))[:80] | e }}</td>
<td>{{ activity.timestamp | format_ts(time_only=True) }}</td> <td>{{ activity.timestamp | format_ts(time_only=True) }}</td>
<td> <td style="display: flex; gap: 6px; flex-wrap: wrap;">
{% if activity.log_id %}
<button class="view-btn" @click="viewRawRequest({{ activity.log_id }})">View Request</button>
{% endif %}
<button class="inspect-btn" @click="openIpInsight('{{ activity.ip | e }}')" title="Inspect IP"> <button class="inspect-btn" @click="openIpInsight('{{ activity.ip | e }}')" title="Inspect IP">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"/></svg> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"/></svg>
</button> </button>