Add machine map editor and fix machine map display

- Create machine_map_editor.asp for bulk position editing
  - Draggable Leaflet markers for repositioning machines
  - Sidebar with filterable machine list
  - Pending changes tracking with save/reset functionality
  - Proper Y-axis coordinate conversion (2550 - top)

- Update machine_map.asp
  - Reduce marker size from 20px to 12px to reduce overlap
  - Filter out network devices (16-20) and PCs (33+) from display
  - Show equipment only (machinetypeid 2-15)

- Add updateMachinePositions API endpoint in api.asp
  - Accepts JSON array of position changes
  - Updates mapleft/maptop for multiple machines

🤖 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 18:28:09 -05:00
parent 7b6ae1ad4c
commit f54d4bd5cb
3 changed files with 600 additions and 6 deletions

View File

@@ -128,7 +128,7 @@ Do While Not rsLegend.EOF
Case Else: legendColor = "#FFC107"
End Select
Response.Write("<div style='margin:8px 0; display:flex; align-items:center;'>")
Response.Write("<span style='display:inline-block; width:16px; height:16px; background:" & legendColor & "; border-radius:50%; margin-right:10px; border:2px solid #fff; box-shadow:0 2px 5px rgba(0,0,0,0.5);'></span>")
Response.Write("<span style='display:inline-block; width:12px; height:12px; background:" & legendColor & "; border-radius:50%; margin-right:10px; border:1px solid #fff; box-shadow:0 1px 3px rgba(0,0,0,0.5);'></span>")
Response.Write("<span style='font-size:13px; color:#fff;'>" & Server.HTMLEncode(rsLegend("machinetype")) & "</span>")
Response.Write("</div>")
rsLegend.MoveNext
@@ -297,6 +297,8 @@ strSQL = "SELECT m.machineid, m.machinenumber, m.alias, m.serialnumber, " &_
"AND m.isactive = 1 " &_
"AND m.mapleft IS NOT NULL " &_
"AND m.maptop IS NOT NULL " &_
"AND mt.machinetypeid NOT IN (1, 16, 17, 18, 19, 20) " &_
"AND mt.machinetypeid < 33 " &_
"ORDER BY mt.machinetype, m.machinenumber ASC"
Set rs = objConn.Execute(strSQL)
@@ -385,12 +387,12 @@ Do While Not rs.EOF
// Get color for this machine type
var color = machineTypeColors[machineTypeId] || machineTypeColors['default'];
// Create custom marker icon
// Create custom marker icon (12px for less overlap)
var icon = L.divIcon({
html: '<div style="background:' + color + '; width:20px; height:20px; border-radius:50%; border:2px solid #fff; box-shadow:0 2px 5px rgba(0,0,0,0.5);"></div>',
iconSize: [20, 20],
iconAnchor: [10, 10],
popupAnchor: [0, -5],
html: '<div style="background:' + color + '; width:12px; height:12px; border-radius:50%; border:1px solid #fff; box-shadow:0 1px 3px rgba(0,0,0,0.5);"></div>',
iconSize: [12, 12],
iconAnchor: [6, 6],
popupAnchor: [0, -3],
className: 'custom-marker'
});