Update displaypc.asp: PC Type label, WinRM text, uptime display
- Changed "Function" label to "PC Type" - Added PC Type value from pctype table (pctypename) instead of machinetype - Changed WinRM display from badge to plain text - Added uptime display showing days since last boot - Added lastboottime and uptime_days to SQL query - Added LEFT JOIN to pctype table for PC type name 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -84,8 +84,10 @@
|
||||
"machines.modelnumberid, machines.businessunitid, machines.printerid, machines.pctypeid, " & _
|
||||
"machines.loggedinuser, machines.osid, machines.machinestatusid, machines.isvnc, machines.iswinrm, " & _
|
||||
"machines.controllertypeid, machines.controllerosid, machines.requires_manual_machine_config, " & _
|
||||
"machines.lastupdated, " & _
|
||||
"machines.lastupdated, machines.lastboottime, " & _
|
||||
"DATEDIFF(NOW(), machines.lastboottime) AS uptime_days, " & _
|
||||
"machinetypes.machinetype, machinetypes.machinetypeid, " & _
|
||||
"pctype.typename AS pctypename, " & _
|
||||
"machinestatus.machinestatus, " & _
|
||||
"models.modelnumber, models.image, models.modelnumberid, " & _
|
||||
"businessunits.businessunit, businessunits.businessunitid, " & _
|
||||
@@ -101,6 +103,7 @@
|
||||
"LEFT JOIN functionalaccounts ON machinetypes.functionalaccountid = functionalaccounts.functionalaccountid " & _
|
||||
"INNER JOIN vendors ON models.vendorid = vendors.vendorid " & _
|
||||
"LEFT JOIN printers ON machines.printerid = printers.printerid " & _
|
||||
"LEFT JOIN pctype ON machines.pctypeid = pctype.pctypeid " & _
|
||||
"WHERE machines.machineid = " & CLng(machineid) & " AND machines.pctypeid IS NOT NULL"
|
||||
|
||||
Set rs = objConn.Execute(strSQL)
|
||||
@@ -214,11 +217,13 @@
|
||||
<p class="mb-2"><strong>Location:</strong></p>
|
||||
<p class="mb-2"><strong>Vendor:</strong></p>
|
||||
<p class="mb-2"><strong>Model:</strong></p>
|
||||
<p class="mb-2"><strong>Function:</strong></p>
|
||||
<p class="mb-2"><strong>PC Type:</strong></p>
|
||||
<p class="mb-2"><strong>BU:</strong></p>
|
||||
<p class="mb-2"><strong>IP Address:</strong></p>
|
||||
<p class="mb-2"><strong>MAC Address:</strong></p>
|
||||
<p class="mb-2"><strong>VNC:</strong></p>
|
||||
<p class="mb-2"><strong>WinRM:</strong></p>
|
||||
<p class="mb-2"><strong>Uptime:</strong></p>
|
||||
<p class="mb-2"><strong>Controlled Equipment:</strong></p>
|
||||
<p class="mb-2"><strong>Printer:</strong></p>
|
||||
<p>
|
||||
@@ -251,6 +256,18 @@ If modelValM = "" Then modelValM = "N/A"
|
||||
machineTypeVal = rs("machinetype") & ""
|
||||
If machineTypeVal = "" Then machineTypeVal = "N/A"
|
||||
|
||||
' Get PC Type name from pctype table
|
||||
Dim pctypeName
|
||||
pctypeName = rs("pctypename") & ""
|
||||
If pctypeName = "" Then pctypeName = "N/A"
|
||||
|
||||
' Get uptime value
|
||||
Dim uptimeDays
|
||||
uptimeDays = ""
|
||||
If Not IsNull(rs("uptime_days")) Then
|
||||
uptimeDays = rs("uptime_days") & " days"
|
||||
End If
|
||||
|
||||
buVal = rs("businessunit") & ""
|
||||
If buVal = "" Then buVal = "N/A"
|
||||
|
||||
@@ -288,7 +305,7 @@ End If
|
||||
</p>
|
||||
<p class="mb-2"><%=Server.HTMLEncode(vendorValM)%></p>
|
||||
<p class="mb-2"><%=Server.HTMLEncode(modelValM)%></p>
|
||||
<p class="mb-2"><%=Server.HTMLEncode(machineTypeVal)%></p>
|
||||
<p class="mb-2"><%=Server.HTMLEncode(pctypeName)%></p>
|
||||
<p class="mb-2"><%=Server.HTMLEncode(buVal)%></p>
|
||||
<%
|
||||
' Get primary communication (IP and MAC) from communications table
|
||||
@@ -361,11 +378,18 @@ Else
|
||||
Response.Write("<p class='mb-2'><span class='text-muted'>VNC: N/A</span></p>")
|
||||
End If
|
||||
|
||||
' Display WinRM status
|
||||
' Display WinRM status (text instead of badge)
|
||||
If hasWinRMEnabled Then
|
||||
Response.Write("<p class='mb-2'><span class='badge badge-success'>WinRM Enabled</span></p>")
|
||||
Response.Write("<p class='mb-2'>Enabled</p>")
|
||||
Else
|
||||
Response.Write("<p class='mb-2'><span class='badge badge-secondary'>WinRM: N/A</span></p>")
|
||||
Response.Write("<p class='mb-2'><span class='text-muted'>N/A</span></p>")
|
||||
End If
|
||||
|
||||
' Display uptime
|
||||
If uptimeDays <> "" Then
|
||||
Response.Write("<p class='mb-2'>" & Server.HTMLEncode(uptimeDays) & "</p>")
|
||||
Else
|
||||
Response.Write("<p class='mb-2'><span class='text-muted'>N/A</span></p>")
|
||||
End If
|
||||
|
||||
' Get controlled equipment from relationships - check both directions
|
||||
|
||||
Reference in New Issue
Block a user