Add USB checkout system and SSO profile page
New Features: - USB Device checkout/check-in system with barcode scanning - displayusb.asp: List all USB devices with status - addusb.asp: Add new USB devices via barcode scan - checkout_usb.asp/savecheckout_usb.asp: Check out USB to SSO - checkin_usb.asp/savecheckin_usb.asp: Check in with wipe confirmation - usb_history.asp: Full checkout history with filters - api_usb.asp: JSON API for AJAX lookups - displayprofile.asp: SSO profile page showing user info and USB history - Date/time format changed to 12-hour (MM/DD/YYYY h:mm AM/PM) - SSO links in USB history now link to profile page via search Database: - New machinetypeid 44 for USB devices - New usb_checkouts table for tracking checkouts Cleanup: - Removed v2 folder (duplicate/old files) - Removed old debug/test files - Removed completed migration documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -290,7 +290,7 @@
|
||||
<div>
|
||||
<h5 class="card-title"><i class='zmdi zmdi-collection-image text-yellow'></i> Supplies Alert Report</h5>
|
||||
<p class="text-muted" style="font-size:13px; margin-top:5px; margin-bottom:0;">
|
||||
Monitors: Toner/Ink <20%, Drums <20%, Maintenance Kits <20%, Waste >80% (Xerox EC series: <20% inverted)
|
||||
Monitors: Toner/Ink ≤5%, Drums ≤5%, Maintenance Kits ≤5%, Waste ≥95% (Xerox EC series: ≤5% inverted)
|
||||
</p>
|
||||
</div>
|
||||
<div style="display:flex; gap:10px; align-items:center;">
|
||||
@@ -546,22 +546,22 @@
|
||||
If isSupplyItem And itemStatus = "0" And itemState = "0" Then
|
||||
If isWasteItem Then
|
||||
' Waste cartridge logic - MODEL SPECIFIC!
|
||||
' Standard (HP, etc.): 0% = empty/ok, 100% = full/bad (alert when >80%)
|
||||
' Xerox EC series (EC8036, etc.): 0% = full/bad, 100% = empty/ok (INVERTED - alert when <20%)
|
||||
' Standard (HP, etc.): 0% = empty/ok, 100% = full/bad (alert when >=95%)
|
||||
' Xerox EC series (EC8036, etc.): 0% = full/bad, 100% = empty/ok (INVERTED - alert when <=5%)
|
||||
If isXeroxPrinter Then
|
||||
' Xerox EC series waste: alert when BELOW 20% (inverted - low % means full)
|
||||
If numericValue < 20 And numericValue >= 0 Then
|
||||
' Xerox EC series waste: alert when at or BELOW 5% (inverted - low % means full)
|
||||
If numericValue <= 5 And numericValue >= 0 Then
|
||||
showItem = True
|
||||
End If
|
||||
Else
|
||||
' Standard waste: alert when ABOVE 80% (nearly full)
|
||||
If numericValue > 80 And numericValue <= 100 Then
|
||||
' Standard waste: alert when at or ABOVE 95% (nearly full)
|
||||
If numericValue >= 95 And numericValue <= 100 Then
|
||||
showItem = True
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
' Regular supplies: alert when BELOW 20% (running low)
|
||||
If numericValue < 20 And numericValue >= 0 Then
|
||||
' Regular supplies: alert when at or below 5% (running low)
|
||||
If numericValue <= 5 And numericValue >= 0 Then
|
||||
showItem = True
|
||||
End If
|
||||
End If
|
||||
@@ -605,18 +605,15 @@
|
||||
End If
|
||||
Else
|
||||
' Regular supply status (low % = bad)
|
||||
If numericValue <= 5 Then
|
||||
' 0% = Critical (red), 1-5% = Warning (orange)
|
||||
If numericValue = 0 Then
|
||||
statusIcon = "zmdi-alert-circle"
|
||||
statusColor = "#ff0000"
|
||||
statusText = "Critical"
|
||||
ElseIf numericValue <= 10 Then
|
||||
Else
|
||||
statusIcon = "zmdi-alert-triangle"
|
||||
statusColor = "#ff6600"
|
||||
statusText = "Very Low"
|
||||
Else
|
||||
statusIcon = "zmdi-info"
|
||||
statusColor = "#ffaa00"
|
||||
statusText = "Low"
|
||||
statusText = "Warning"
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -830,7 +827,7 @@
|
||||
|
||||
Response.Write("<tr data-vendor='" & Server.HTMLEncode(outputItem(1)) & "'>")
|
||||
Response.Write("<td><a href='./displayprinter.asp?printerid=" & outputItem(2) & "'>" & Server.HTMLEncode(outputItem(3)) & "</a></td>")
|
||||
Response.Write("<td><span class='location-link' data-machineid='" & outputItem(4) & "' style='cursor:pointer; color:#007bff;'><i class='zmdi zmdi-pin' style='margin-right:4px;'></i>" & Server.HTMLEncode(outputItem(5)) & "</span></td>")
|
||||
Response.Write("<td><span class='location-link' data-type='printer' data-id='" & outputItem(2) & "' style='cursor:pointer; color:#007bff;'><i class='zmdi zmdi-pin' style='margin-right:4px;'></i>" & Server.HTMLEncode(outputItem(5)) & "</span></td>")
|
||||
Response.Write("<td>" & Server.HTMLEncode(outputItem(6)) & "</td>")
|
||||
Response.Write("<td><strong style='color:" & outputItem(8) & ";'>" & Round(CDbl(outputItem(7)), 1) & "%</strong></td>")
|
||||
Response.Write("<td>" & outputItem(9) & "</td>")
|
||||
@@ -854,7 +851,7 @@
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<small class="text-muted">
|
||||
<i class="zmdi zmdi-info-outline"></i> This report shows printers with low supplies (<20%) or waste cartridges near full (>80%, Xerox EC series inverted <20%).
|
||||
<i class="zmdi zmdi-info-outline"></i> This report shows printers with low supplies (≤5%) or waste cartridges near full (≥95%, Xerox EC series inverted ≤5%).
|
||||
Data refreshed from Zabbix every 5 minutes.
|
||||
</small>
|
||||
</div>
|
||||
@@ -1011,17 +1008,18 @@
|
||||
var currentMachineId = null;
|
||||
|
||||
// Function to show popup with smart positioning
|
||||
function showLocationPopup(machineId, locationName, mouseEvent) {
|
||||
function showLocationPopup(deviceType, deviceId, locationName, mouseEvent) {
|
||||
// Don't reload if same location
|
||||
if (currentMachineId === machineId && $popup.is(':visible')) {
|
||||
var locationKey = deviceType + '_' + deviceId;
|
||||
if (currentMachineId === locationKey && $popup.is(':visible')) {
|
||||
return;
|
||||
}
|
||||
|
||||
currentMachineId = machineId;
|
||||
currentMachineId = locationKey;
|
||||
$title.text(locationName);
|
||||
|
||||
// Load iframe
|
||||
$iframe.attr('src', './displaylocation.asp?machineid=' + machineId);
|
||||
// Load iframe - use type and id parameters for printer-specific location
|
||||
$iframe.attr('src', './displaylocation.asp?type=' + deviceType + '&id=' + deviceId);
|
||||
|
||||
// Position popup
|
||||
var popupWidth = 440;
|
||||
@@ -1088,7 +1086,8 @@
|
||||
// Hover handler for location links
|
||||
$(document).on('mouseenter', '.location-link', function(e) {
|
||||
var $link = $(this);
|
||||
var machineId = $link.data('machineid');
|
||||
var deviceType = $link.data('type') || 'machine';
|
||||
var deviceId = $link.data('id') || $link.data('machineid');
|
||||
var locationName = $link.text().trim();
|
||||
var mouseEvent = e;
|
||||
|
||||
@@ -1097,7 +1096,7 @@
|
||||
}
|
||||
|
||||
hoverTimer = setTimeout(function() {
|
||||
showLocationPopup(machineId, locationName, mouseEvent);
|
||||
showLocationPopup(deviceType, deviceId, locationName, mouseEvent);
|
||||
}, 300);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user