Add eDNC-Fix API endpoints and displaypc.asp integration

API endpoints:
- logDNCEvent: Log events from eDNC-Fix PowerShell script
- getDNCStats: Get all eDNC installations and stats

Database tables (sql/ednc_tables.sql):
- ednc_logs: Event log entries
- ednc_installations: Per-hostname tracking

displaypc.asp:
- Shows eDNC-Fix stats in Applications tab if installed

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
cproudlock
2025-12-12 08:55:27 -05:00
parent de7d8faacd
commit 4e37378923
38 changed files with 261 additions and 0 deletions

41
sql/ednc_tables.sql Normal file
View File

@@ -0,0 +1,41 @@
-- ============================================================================
-- eDNC Special Character Fix - Database Tables
-- Run on PRODUCTION database to enable eDNC logging
-- Created: 2025-12-12
-- ============================================================================
-- Log individual events (cleaned, failed, started, stopped, etc.)
CREATE TABLE IF NOT EXISTS ednc_logs (
logid INT AUTO_INCREMENT PRIMARY KEY,
hostname VARCHAR(50) NOT NULL,
filename VARCHAR(255) NOT NULL,
action ENUM('cleaned', 'ok', 'failed', 'error', 'started', 'stopped') NOT NULL,
bytes_removed INT DEFAULT 0,
version VARCHAR(20),
message VARCHAR(500),
created DATETIME DEFAULT CURRENT_TIMESTAMP,
INDEX idx_hostname (hostname),
INDEX idx_created (created),
INDEX idx_action (action)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- Track installations per PC
CREATE TABLE IF NOT EXISTS ednc_installations (
installid INT AUTO_INCREMENT PRIMARY KEY,
hostname VARCHAR(50) NOT NULL UNIQUE,
version VARCHAR(20),
watch_folder VARCHAR(255),
file_filter VARCHAR(50),
first_seen DATETIME DEFAULT CURRENT_TIMESTAMP,
last_seen DATETIME DEFAULT CURRENT_TIMESTAMP,
is_active TINYINT(1) DEFAULT 1,
total_cleaned INT DEFAULT 0,
total_failed INT DEFAULT 0,
INDEX idx_hostname (hostname),
INDEX idx_active (is_active)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- Verify tables created
SELECT 'ednc_logs' AS table_name, COUNT(*) AS row_count FROM ednc_logs
UNION ALL
SELECT 'ednc_installations', COUNT(*) FROM ednc_installations;