Fix network device description/machinenotes display and edit
- Fix ADO cursor issue where reading rs("description") twice caused
empty values (IsNull check consumed the field value)
- Change all device pages to read description field once using
`description = rs("description") & ""` pattern
- Add deviceDescription variable in displaydevice.asp
- Fix machinetypeid mapping: IDF=17, Camera=18 (was swapped)
- Add model dropdown fix to include currently assigned model
- Add server application tracking feature
- Various other improvements and fixes
Files affected:
- displaydevice.asp, displaylocationdevice.asp
- deviceaccesspoint.asp, deviceserver.asp, deviceswitch.asp
- devicecamera.asp, deviceidf.asp
- savenetworkdevice.asp, networkdevices.asp
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -23,11 +23,11 @@
|
||||
|
||||
' If editing, fetch existing data
|
||||
Dim rs, accesspointname, modelid, serialnumber, ipaddress, fqdn, description, maptop, mapleft, isactive
|
||||
Dim vendorname, modelnumber
|
||||
Dim vendorname, modelnumber, logicmonitorurl
|
||||
If Not isNewRecord Then
|
||||
Dim strSQL
|
||||
strSQL = "SELECT mac.machineid, mac.alias AS apname, mac.modelnumberid AS modelid, " & _
|
||||
"mac.serialnumber, mac.fqdn, mac.machinenotes AS description, mac.maptop, mac.mapleft, mac.isactive, " & _
|
||||
"mac.serialnumber, mac.fqdn, mac.logicmonitorurl, mac.machinenotes AS description, mac.maptop, mac.mapleft, mac.isactive, " & _
|
||||
"m.modelnumber, v.vendor, c.address AS ipaddress " & _
|
||||
"FROM machines mac " & _
|
||||
"LEFT JOIN models m ON mac.modelnumberid = m.modelnumberid " & _
|
||||
@@ -49,8 +49,9 @@
|
||||
Else
|
||||
ipaddress = ""
|
||||
End If
|
||||
If Not IsNull(rs("fqdn")) Then fqdn = rs("fqdn") Else fqdn = ""
|
||||
If Not IsNull(rs("description")) Then description = rs("description") Else description = ""
|
||||
If Not IsNull(rs("fqdn")) Then fqdn = rs("fqdn") & "" Else fqdn = ""
|
||||
If Not IsNull(rs("logicmonitorurl")) Then logicmonitorurl = rs("logicmonitorurl") & "" Else logicmonitorurl = ""
|
||||
description = rs("description") & ""
|
||||
If Not IsNull(rs("maptop")) Then maptop = rs("maptop") Else maptop = ""
|
||||
If Not IsNull(rs("mapleft")) Then mapleft = rs("mapleft") Else mapleft = ""
|
||||
If Not IsNull(rs("isactive")) Then isactive = rs("isactive") Else isactive = 1
|
||||
@@ -66,6 +67,7 @@
|
||||
serialnumber = ""
|
||||
ipaddress = ""
|
||||
fqdn = ""
|
||||
logicmonitorurl = ""
|
||||
description = ""
|
||||
maptop = ""
|
||||
mapleft = ""
|
||||
@@ -138,12 +140,13 @@
|
||||
<select name="modelid" id="modelid" class="form-control">
|
||||
<option value="">-- Select Model --</option>
|
||||
<%
|
||||
Dim strSQL2, rsModels
|
||||
' Filter models to only show Access Point models (machinetypeid = 16)
|
||||
Dim strSQL2, rsModels, currentModelId
|
||||
' Show Access Point models (machinetypeid = 16) plus currently assigned model
|
||||
If IsNumeric(modelid) Then currentModelId = CLng(modelid) Else currentModelId = 0
|
||||
strSQL2 = "SELECT m.modelnumberid, m.modelnumber, v.vendor " & _
|
||||
"FROM models m " & _
|
||||
"INNER JOIN vendors v ON m.vendorid = v.vendorid " & _
|
||||
"WHERE m.isactive = 1 AND m.machinetypeid = 16 " & _
|
||||
"WHERE m.isactive = 1 AND (m.machinetypeid = 16 OR m.modelnumberid = " & currentModelId & ") " & _
|
||||
"ORDER BY v.vendor, m.modelnumber"
|
||||
Set rsModels = objConn.Execute(strSQL2)
|
||||
Do While Not rsModels.EOF
|
||||
@@ -304,6 +307,19 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 col-form-label">Logic Monitor URL</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="url" name="logicmonitorurl" class="form-control"
|
||||
value="<%=Server.HTMLEncode(logicmonitorurl)%>"
|
||||
maxlength="512"
|
||||
placeholder="e.g., https://company.logicmonitor.com/santaba/uiv3/...">
|
||||
<small class="form-text text-muted">
|
||||
Link to this device in Logic Monitor (optional)
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 col-form-label">Description</label>
|
||||
<div class="col-sm-9">
|
||||
|
||||
Reference in New Issue
Block a user