Fix dualpath propagation, getShopfloorPCs filtering, USB management, and printer features

- Fix dualpath PC propagation direction (Equipment->PC) in api.asp and db_helpers.asp
- Fix early exit in CreatePCMachineRelationship preventing propagation
- Fix getShopfloorPCs to filter machinetypeid IN (33,34,35) instead of >= 33
- Fix getShopfloorPCs to show equipment numbers via GROUP_CONCAT subquery
- Add detailed PropagateDP logging for dualpath debugging
- Default "Show on Shopfloor Dashboard" checkbox to checked in addnotification.asp
- Add USB label batch printing, single USB labels, and USB history pages
- Add printer supplies tracking and toner report enhancements
- Add uptime map visualization page
- Add dashboard/lobby display SQL migration
- Update CLAUDE.md with IIS 401 workaround documentation
- Update TODO.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
cproudlock
2026-02-03 10:44:55 -05:00
parent 8945fe2a0a
commit e382a3246e
27 changed files with 1926 additions and 255 deletions

View File

@@ -407,8 +407,8 @@ End If
<div class="tab-pane" id="relationships">
<h5 class="mb-3">Machine Relationships</h5>
<!-- Controlling PCs -->
<h6 class="mt-3 mb-2"><i class="zmdi zmdi-desktop-mac"></i> Controlled By PC</h6>
<!-- Connected PCs -->
<h6 class="mt-3 mb-2"><i class="zmdi zmdi-desktop-mac"></i> Connected PCs</h6>
<div class="table-responsive mb-4">
<table class="table table-hover table-striped">
<thead>
@@ -421,36 +421,54 @@ End If
</thead>
<tbody>
<%
' Query PCs that control this machine (directly or via dualpath)
' Query ALL PCs related to this machine via machinerelationships
' Check both directions - the PC is identified by pctypeid IS NOT NULL
' Use GROUP_CONCAT to combine multiple IPs into one row per PC
strSQL2 = "SELECT m.machineid, m.machinenumber, m.hostname, " & _
"GROUP_CONCAT(DISTINCT c.address ORDER BY c.address SEPARATOR ', ') as address, 'Controls' as relationshiptype " & _
strSQL2 = "SELECT m.machineid, m.machinenumber, m.hostname, rt.relationshiptype, " & _
"GROUP_CONCAT(DISTINCT c.address ORDER BY c.address SEPARATOR ', ') as address " & _
"FROM machinerelationships mr " & _
"JOIN relationshiptypes rt ON mr.relationshiptypeid = rt.relationshiptypeid " & _
"JOIN machines m ON (mr.machineid = m.machineid OR mr.related_machineid = m.machineid) " & _
"LEFT JOIN communications c ON m.machineid = c.machineid AND c.comstypeid IN (1, 3) AND c.isactive = 1 " & _
"WHERE (mr.machineid = ? OR mr.related_machineid = ?) AND mr.relationshiptypeid = 3 " & _
"WHERE (mr.machineid = ? OR mr.related_machineid = ?) " & _
" AND m.pctypeid IS NOT NULL AND m.machineid <> ? AND mr.isactive = 1 " & _
"GROUP BY m.machineid, m.machinenumber, m.hostname"
"GROUP BY m.machineid, m.machinenumber, m.hostname, rt.relationshiptype " & _
"ORDER BY rt.relationshiptype, m.hostname"
Set rs2 = ExecuteParameterizedQuery(objConn, strSQL2, Array(machineid, machineid, machineid))
Dim pcHostname, pcIP, pcMachineID
Dim pcHostname, pcIP, pcMachineID, pcLocation, pcRelType
If rs2.EOF Then
Response.Write("<tr><td colspan='4' class='text-muted text-center'>No controlling PC assigned</td></tr>")
Response.Write("<tr><td colspan='4' class='text-muted text-center'>No connected PCs</td></tr>")
Else
Do While Not rs2.EOF
pcHostname = rs2("hostname") & ""
pcIP = rs2("address") & ""
pcMachineID = rs2("machineid")
pcLocation = rs2("machinenumber") & ""
pcRelType = rs2("relationshiptype") & ""
If pcHostname = "" Then pcHostname = rs2("machinenumber") & ""
If pcHostname = "" Then pcHostname = pcLocation
If pcIP = "" Then pcIP = "<span class='text-muted'>N/A</span>"
If pcLocation = "" Then pcLocation = "N/A"
' Badge color based on relationship type
Dim pcRelBadge
Select Case LCase(pcRelType)
Case "controls"
pcRelBadge = "badge-primary"
Case "dualpath"
pcRelBadge = "badge-warning"
Case "connected to"
pcRelBadge = "badge-success"
Case Else
pcRelBadge = "badge-info"
End Select
Response.Write("<tr>")
Response.Write("<td><a href='./displaypc.asp?machineid=" & pcMachineID & "'>" & Server.HTMLEncode(pcHostname) & "</a></td>")
Response.Write("<td>" & pcIP & "</td>")
Response.Write("<td class='text-center'><a href='#' class='location-link text-info' data-machineid='" & pcMachineID & "' data-name='" & Server.HTMLEncode(pcHostname) & "'><i class='zmdi zmdi-pin' style='font-size:1.2rem;'></i></a></td>")
Response.Write("<td><span class='badge badge-primary'>" & Server.HTMLEncode(rs2("relationshiptype") & "") & "</span></td>")
Response.Write("<td>" & Server.HTMLEncode(pcLocation) & " <a href='#' class='location-link text-info' data-machineid='" & pcMachineID & "' data-name='" & Server.HTMLEncode(pcHostname) & "'><i class='zmdi zmdi-pin'></i></a></td>")
Response.Write("<td><span class='badge " & pcRelBadge & "'>" & Server.HTMLEncode(pcRelType) & "</span></td>")
Response.Write("</tr>")
rs2.MoveNext
Loop