From 4441dde2e816632f1b1d92db8af33b8acf5f1104 Mon Sep 17 00:00:00 2001 From: cproudlock Date: Fri, 12 Dec 2025 09:01:57 -0500 Subject: [PATCH] displaypc.asp: Add eDNC recent activity log (last 10 entries) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Shows file, action (cleaned/ok/failed/error), and timestamp 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- displaypc.asp | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/displaypc.asp b/displaypc.asp index cec0d1f..7f7d511 100644 --- a/displaypc.asp +++ b/displaypc.asp @@ -795,6 +795,61 @@ End If +<% + ' Show recent log entries + Dim logSQL, rsLog + logSQL = "SELECT filename, action, bytes_removed, created FROM ednc_logs " & _ + "WHERE UPPER(hostname) = UPPER(?) AND action IN ('cleaned', 'ok', 'failed', 'error') " & _ + "ORDER BY created DESC LIMIT 10" + Set rsLog = ExecuteParameterizedQuery(objConn, logSQL, Array(rsEdnc("hostname") & "")) +%> +
Recent Activity
+
+ + + + + + + + + +<% + If rsLog.EOF Then + Response.Write "" + Else + Do While Not rsLog.EOF + Dim logAction, logBadge + logAction = rsLog("action") & "" + Select Case logAction + Case "cleaned" + logBadge = "cleaned" + If CLng(rsLog("bytes_removed") & "0") > 0 Then + logBadge = logBadge & " (" & rsLog("bytes_removed") & " bytes)" + End If + Case "ok" + logBadge = "ok" + Case "failed" + logBadge = "failed" + Case "error" + logBadge = "error" + Case Else + logBadge = "" & Server.HTMLEncode(logAction) & "" + End Select + Response.Write "" + Response.Write "" + Response.Write "" + Response.Write "" + Response.Write "" + rsLog.MoveNext + Loop + End If + rsLog.Close + Set rsLog = Nothing +%> + +
FileActionTime
No recent activity
" & Server.HTMLEncode(rsLog("filename") & "") & "" & logBadge & "" & rsLog("created") & "
+
<% End If rsEdnc.Close