From e382a3246eea145c91e4f0f91e67196061b88f17 Mon Sep 17 00:00:00 2001 From: cproudlock Date: Tue, 3 Feb 2026 10:44:55 -0500 Subject: [PATCH] Fix dualpath propagation, getShopfloorPCs filtering, USB management, and printer features - Fix dualpath PC propagation direction (Equipment->PC) in api.asp and db_helpers.asp - Fix early exit in CreatePCMachineRelationship preventing propagation - Fix getShopfloorPCs to filter machinetypeid IN (33,34,35) instead of >= 33 - Fix getShopfloorPCs to show equipment numbers via GROUP_CONCAT subquery - Add detailed PropagateDP logging for dualpath debugging - Default "Show on Shopfloor Dashboard" checkbox to checked in addnotification.asp - Add USB label batch printing, single USB labels, and USB history pages - Add printer supplies tracking and toner report enhancements - Add uptime map visualization page - Add dashboard/lobby display SQL migration - Update CLAUDE.md with IIS 401 workaround documentation - Update TODO.md Co-Authored-By: Claude Opus 4.5 --- CLAUDE.md | 25 + TODO.md | 8 +- addnotification.asp | 2 +- addusb.asp | 133 +++++- api.asp | 77 ++- displaydevice.asp | 18 +- displayknowledgebase.asp | 2 +- displaymachine.asp | 42 +- displaymachines.asp | 4 +- displaypc.asp | 37 +- displayprinter.asp | 10 +- displayprinters.asp | 14 +- displayusb.asp | 6 + includes/db_helpers.asp | 34 +- includes/printer_supplies.asp | 181 +++++++ includes/wjf_employees-sql.asp | 27 +- includes/zabbix_all_supplies_cached.asp | 57 +-- printerqrbatch.asp | 1 + savecheckinusb.asp | 1 + savecheckoutusb.asp | 1 + saveusbdirect.asp | 1 + sql/add_dashboard_lobbydisplay.sql | 22 + tonerreport.asp | 355 ++++++++------ uptimemap.asp | 595 ++++++++++++++++++++++++ usbhistory.asp | 4 +- usblabelbatch.asp | 329 +++++++++++++ usbsingle.asp | 195 ++++++++ 27 files changed, 1926 insertions(+), 255 deletions(-) create mode 100644 includes/printer_supplies.asp create mode 100644 sql/add_dashboard_lobbydisplay.sql create mode 100644 uptimemap.asp create mode 100644 usblabelbatch.asp create mode 100644 usbsingle.asp diff --git a/CLAUDE.md b/CLAUDE.md index 96bbcee..3ed3873 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -154,6 +154,31 @@ PCs are in the machines table, identified by: - `pctypeid IS NOT NULL` - `machinetypeid IN (33, 34, 35)` +### IIS 401 Error on New ASP Files + +**Problem:** When creating new ASP files from scratch, they may return HTTP 200 on the first request but HTTP 401 Unauthorized on all subsequent requests. + +**Symptoms:** +- First curl/browser request to new .asp file returns 200 +- All following requests return 401 Unauthorized +- Existing files (like printerqrbatch.asp) work fine with consistent 200 responses +- Adding `<%@ Language=VBScript %>` directive alone does NOT fix it + +**Solution:** Instead of creating new ASP files from scratch, **copy an existing working ASP file** to the new filename, then modify its contents: + +```bash +# DON'T do this (creates file from scratch - will get 401 errors): +# Write tool to create newfile.asp + +# DO this instead (copy existing working file): +cp printerqrbatch.asp newfile.asp +# Then use Edit tool to replace the content +``` + +**Why this works:** The exact root cause is unclear, but appears related to how IIS handles file metadata/permissions for newly created files vs. copied files. Copying preserves whatever attributes IIS needs to serve the file correctly. + +**Verified fix:** Files created by copying printerqrbatch.asp consistently return 200 on multiple sequential requests. + ## API Endpoints **Base URL:** `http://192.168.122.151:8080/api.asp` diff --git a/TODO.md b/TODO.md index 1a02d0d..c9dea6c 100644 --- a/TODO.md +++ b/TODO.md @@ -1,15 +1,12 @@ # ShopDB - Future TODO List **Created:** 2025-11-25 -**Last Updated:** 2025-11-25 +**Last Updated:** 2026-01-16 --- ## High Priority -### Outstanding Bugs -- [ ] Fix displaysubnet.asp - Runtime error (subscript out of range) - ### Uncommitted Changes - [ ] Review and commit pending changes: - api.asp @@ -68,6 +65,9 @@ ## Completed (Reference) +### December 2025 +- [x] Fix displaysubnet.asp runtime error - Phase 2 schema update (Dec 29) + ### November 2025 - [x] Phase 1: Schema changes (Nov 6) - [x] Phase 2: PC migration (Nov 10) diff --git a/addnotification.asp b/addnotification.asp index 32708c1..0b57cd3 100644 --- a/addnotification.asp +++ b/addnotification.asp @@ -311,7 +311,7 @@
- +
Check this to display on the shopfloor TV dashboard (72-hour window) diff --git a/addusb.asp b/addusb.asp index a6b745d..0483593 100644 --- a/addusb.asp +++ b/addusb.asp @@ -3,6 +3,8 @@ + + <% @@ -60,15 +62,22 @@ End If
- +
+ +
+ +
+
@@ -106,6 +115,25 @@ Set rsBU = Nothing
+ + +