Add WinRM filter, VNC IP fallback, UDC/CLM process detection

displaypcs.asp:
- Replace "All Time" filter with WinRM status filter
- Options: All, Needs WinRM (Has Equipment), Has WinRM, No WinRM
- Add VNC IP fallback when hostname unavailable

displaypc.asp:
- Add VNC IP fallback when hostname unavailable

api.asp:
- Add isactive field support for installedapps table
- UDC/CLM process detection sets isactive=1 if running, 0 if not

displaymachines.asp:
- Fix to exclude PC machine types (machinetypeid >= 33)
- PCs were incorrectly showing on equipment list

Update-ShopfloorPCs-Remote.ps1:
- Add UDC.exe and PPMon.exe (CLM) process detection
- Set isactive flag based on running process
- Add 10.134.* to TrustedHosts for IP fallback connections

Update-PC-CompleteAsset.ps1:
- Add UDC/CLM process detection for local execution
- Set isactive flag on tracked applications

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
cproudlock
2025-12-09 16:26:15 -05:00
parent 6b1ef583b4
commit 40e14520e2
6 changed files with 110 additions and 30 deletions

View File

@@ -39,9 +39,9 @@
</div>
</div>
<%
Dim currentPCStatus, recentFilter, deviceTypeFilter, pcTypeFilter, uptimeFilter, sel
Dim currentPCStatus, winrmFilter, deviceTypeFilter, pcTypeFilter, uptimeFilter, sel
currentPCStatus = Request.QueryString("pcstatus")
recentFilter = Request.QueryString("recent")
winrmFilter = Request.QueryString("winrm")
deviceTypeFilter = Request.QueryString("devicetype")
pcTypeFilter = Request.QueryString("pctype")
uptimeFilter = Request.QueryString("uptime")
@@ -107,9 +107,11 @@ rsStatus.Close
Set rsStatus = Nothing
%>
</select>
<select id="recentFilter" class="btn btn-secondary btn-sm" onchange="updateFilter('recent', this.value)">
<option value="">All Time</option>
<option value="7"<% If recentFilter = "7" Then Response.Write(" selected") End If%>>Last 7 Days</option>
<select id="winrmFilter" class="btn btn-secondary btn-sm" onchange="updateFilter('winrm', this.value)">
<option value="">All WinRM</option>
<option value="needswinrm"<% If Request.QueryString("winrm") = "needswinrm" Then Response.Write(" selected") End If%>>Needs WinRM (Has Equipment)</option>
<option value="haswinrm"<% If Request.QueryString("winrm") = "haswinrm" Then Response.Write(" selected") End If%>>Has WinRM</option>
<option value="nowinrm"<% If Request.QueryString("winrm") = "nowinrm" Then Response.Write(" selected") End If%>>No WinRM</option>
</select>
<select id="uptimeFilter" class="btn btn-secondary btn-sm" onchange="updateFilter('uptime', this.value)">
<option value="">All Uptimes</option>
@@ -117,7 +119,7 @@ Set rsStatus = Nothing
<option value="30"<% If uptimeFilter = "30" Then Response.Write(" selected") End If%>>Uptime > 30 Days</option>
<option value="90"<% If uptimeFilter = "90" Then Response.Write(" selected") End If%>>Uptime > 90 Days</option>
</select>
<% If currentPCStatus <> "" Or recentFilter <> "" Or deviceTypeFilter <> "" Or pcTypeFilter <> "" Or uptimeFilter <> "" Or Request.QueryString("needsrelationship") <> "" Then %>
<% If currentPCStatus <> "" Or winrmFilter <> "" Or deviceTypeFilter <> "" Or pcTypeFilter <> "" Or uptimeFilter <> "" Or Request.QueryString("needsrelationship") <> "" Then %>
<a href="displaypcs.asp" class="btn btn-outline-secondary btn-sm">
<i class="zmdi zmdi-close"></i> Clear
</a>
@@ -145,10 +147,10 @@ Set rsStatus = Nothing
<%
' Build query based on filters
Dim pcStatusFilter, recentDaysFilter, deviceTypeFilterSQL, pcTypeFilterSQL, uptimeFilterSQL, needsRelationshipFilter, whereClause
Dim pcStatusFilter, winrmFilterSQL, deviceTypeFilterSQL, pcTypeFilterSQL, uptimeFilterSQL, needsRelationshipFilter, whereClause
Dim displayName, hasVnc, vncHost, hasWinrm, uptimeDays
pcStatusFilter = Request.QueryString("pcstatus")
recentDaysFilter = Request.QueryString("recent")
winrmFilterSQL = Request.QueryString("winrm")
deviceTypeFilterSQL = Request.QueryString("devicetype")
pcTypeFilterSQL = Request.QueryString("pctype")
uptimeFilterSQL = Request.QueryString("uptime")
@@ -178,8 +180,15 @@ Set rsStatus = Nothing
whereClause = whereClause & " AND m.machinestatusid = " & pcStatusFilter
End If
If recentDaysFilter <> "" And IsNumeric(recentDaysFilter) Then
whereClause = whereClause & " AND m.lastupdated >= DATE_SUB(NOW(), INTERVAL " & recentDaysFilter & " DAY)"
' Filter by WinRM status
If winrmFilterSQL = "needswinrm" Then
' PCs with equipment relationships but no WinRM
whereClause = whereClause & " AND (m.iswinrm = 0 OR m.iswinrm IS NULL)" & _
" AND EXISTS (SELECT 1 FROM machinerelationships mr2 WHERE (mr2.machineid = m.machineid OR mr2.related_machineid = m.machineid) AND mr2.isactive = 1 AND mr2.relationshiptypeid = 3)"
ElseIf winrmFilterSQL = "haswinrm" Then
whereClause = whereClause & " AND m.iswinrm = 1"
ElseIf winrmFilterSQL = "nowinrm" Then
whereClause = whereClause & " AND (m.iswinrm = 0 OR m.iswinrm IS NULL)"
End If
' Filter by device type (laptop vs desktop) based on model name patterns
@@ -259,8 +268,11 @@ Set rsStatus = Nothing
If hasVnc And Not IsNull(rs("hostname")) And rs("hostname") <> "" Then
vncHost = rs("hostname") & ".logon.ds.ge.com"
Response.Write("<a href=""com.realvnc.vncviewer.connect://" & Server.HTMLEncode(vncHost) & """ title=""Connect via VNC""><span class='badge badge-success'>VNC</span></a>")
ElseIf hasVnc And Not IsNull(rs("ipaddress")) And rs("ipaddress") <> "" Then
' Fallback to IP address if no hostname
Response.Write("<a href=""com.realvnc.vncviewer.connect://" & Server.HTMLEncode(rs("ipaddress") & "") & """ title=""Connect via VNC (IP)""><span class='badge badge-info'>VNC</span></a>")
ElseIf hasVnc Then
Response.Write("<span class='badge badge-warning' title='VNC enabled but no hostname'>VNC</span>")
Response.Write("<span class='badge badge-warning' title='VNC enabled but no hostname or IP'>VNC</span>")
Else
Response.Write("<span class='text-muted'>-</span>")
End If