Add eDNC-Fix API endpoints and displaypc.asp integration

API endpoints:
- logDNCEvent: Log events from eDNC-Fix PowerShell script
- getDNCStats: Get all eDNC installations and stats

Database tables (sql/ednc_tables.sql):
- ednc_logs: Event log entries
- ednc_installations: Per-hostname tracking

displaypc.asp:
- Shows eDNC-Fix stats in Applications tab if installed

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
cproudlock
2025-12-12 08:55:27 -05:00
parent de7d8faacd
commit 4e37378923
38 changed files with 261 additions and 0 deletions

View File

@@ -733,6 +733,73 @@ End If
</tbody>
</table>
</div>
<!-- eDNC Special Character Fix Stats -->
<%
'=============================================================================
' eDNC-Fix Installation Stats for this PC
'=============================================================================
Dim edncSQL, rsEdnc, hasEdnc
hasEdnc = False
edncSQL = "SELECT i.version, i.watch_folder, i.file_filter, i.first_seen, i.last_seen, " & _
"i.total_cleaned, i.total_failed, " & _
"(SELECT COUNT(*) FROM ednc_logs l WHERE l.hostname = i.hostname AND l.created > DATE_SUB(NOW(), INTERVAL 24 HOUR)) AS events_24h, " & _
"(SELECT MAX(created) FROM ednc_logs l WHERE l.hostname = i.hostname AND l.action = 'cleaned') AS last_cleaned " & _
"FROM ednc_installations i " & _
"INNER JOIN machines m ON UPPER(i.hostname) = UPPER(m.hostname) " & _
"WHERE m.machineid = ?"
Set rsEdnc = ExecuteParameterizedQuery(objConn, edncSQL, Array(machineid))
If Not rsEdnc.EOF Then
hasEdnc = True
%>
<h6 class="mt-4 mb-3"><i class="zmdi zmdi-settings"></i> eDNC Special Character Fix</h6>
<div class="table-responsive">
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="font-weight-bold" width="35%">Version</td>
<td><%= Server.HTMLEncode(rsEdnc("version") & "") %></td>
</tr>
<tr>
<td class="font-weight-bold">Watch Folder</td>
<td><code><%= Server.HTMLEncode(rsEdnc("watch_folder") & "") %></code></td>
</tr>
<tr>
<td class="font-weight-bold">File Filter</td>
<td><code><%= Server.HTMLEncode(rsEdnc("file_filter") & "") %></code></td>
</tr>
<tr>
<td class="font-weight-bold">First Seen</td>
<td><%= rsEdnc("first_seen") %></td>
</tr>
<tr>
<td class="font-weight-bold">Last Active</td>
<td><%= rsEdnc("last_seen") %></td>
</tr>
<tr>
<td class="font-weight-bold">Files Cleaned (Total)</td>
<td><span class="badge badge-success"><%= rsEdnc("total_cleaned") %></span></td>
</tr>
<tr>
<td class="font-weight-bold">Files Failed (Total)</td>
<td><span class="badge badge-<%= IIf(CLng(rsEdnc("total_failed") & "0") > 0, "danger", "secondary") %>"><%= rsEdnc("total_failed") %></span></td>
</tr>
<tr>
<td class="font-weight-bold">Events (Last 24h)</td>
<td><%= rsEdnc("events_24h") %></td>
</tr>
<tr>
<td class="font-weight-bold">Last File Cleaned</td>
<td><%= rsEdnc("last_cleaned") & "" %></td>
</tr>
</tbody>
</table>
</div>
<%
End If
rsEdnc.Close
Set rsEdnc = Nothing
%>
</div>
</div>
</div>