From b2168cd083ee31812f95b80fa9a207ce2d1ff7ca Mon Sep 17 00:00:00 2001 From: Scheianu Ionut Date: Mon, 22 Sep 2025 20:34:15 +0300 Subject: [PATCH] uploaded new name --- py_app/app/__pycache__/routes.cpython-312.pyc | Bin 77584 -> 77590 bytes py_app/app/routes.py | 8 +- .../static/quality_recticel_print_helper.zip | Bin 9269 -> 9269 bytes .../static/quality_recticel_print_service.zip | Bin 32075 -> 33385 bytes py_app/app/templates/print_module.html | 50 +++++++++-- .../chrome_extension/background.js | 8 +- .../chrome_extension/content.js | 20 ++--- .../chrome_extension/manifest.json | 6 +- .../chrome_extension/popup.html | 2 +- .../chrome_extension/popup.js | 6 +- .../install_native_service.bat | 12 +-- windows_print_service/install_simple.bat | 10 +-- windows_print_service/print_service.ps1 | 29 ++++--- windows_print_service/service_wrapper.bat | 2 +- windows_print_service/test_service.ps1 | 79 ++++++++++++++++++ windows_print_service/uninstall_service.bat | 12 +-- 16 files changed, 180 insertions(+), 64 deletions(-) create mode 100644 windows_print_service/test_service.ps1 diff --git a/py_app/app/__pycache__/routes.cpython-312.pyc b/py_app/app/__pycache__/routes.cpython-312.pyc index 2a6fd2a5c652eed41e7e93a2f08ef8cdcd73336f..dbbf39fcec5c3f5d909ee3a5abbb237f63813f9c 100644 GIT binary patch delta 125 zcmbPmk7e3D7T(jmyj%=G;L~w2W8y|$wj(kM%nS_53W24GIhiGu3OoISK(q ynRz9f^^cS=a=^qkZ#-JZ$5#YZ5nljOG1>OYHZhn2h49S0l>G8ysAkTqyiovzl`B>N diff --git a/py_app/app/routes.py b/py_app/app/routes.py index d40aa9b..fad8d52 100644 --- a/py_app/app/routes.py +++ b/py_app/app/routes.py @@ -999,7 +999,7 @@ def create_extension_package(): files_added += 1 # Add a README file with installation instructions - readme_content = """# Quality Recticel Print Helper Chrome Extension + readme_content = """# Quality Label Printing Helper Chrome Extension ## Installation Instructions: @@ -1011,7 +1011,7 @@ def create_extension_package(): ## Usage: -1. Go to the Print Module in the Quality Recticel application +1. Go to the Print Module in the Quality Label Printing application 2. Select an order from the table 3. Click the "šŸ–Øļø Print Direct" button 4. The label will print automatically to your default printer @@ -1083,7 +1083,7 @@ def create_service_package(): static_dir = os.path.join(current_app.root_path, 'static') os.makedirs(static_dir, exist_ok=True) - zip_filename = 'quality_recticel_print_service.zip' + zip_filename = 'quality_label_printing_service.zip' zip_path = os.path.join(static_dir, zip_filename) # Create ZIP file with Windows service package @@ -1109,7 +1109,7 @@ def create_service_package(): files_added += 1 # Add installation instructions for native PowerShell solution - installation_readme = """# Quality Recticel Windows Print Service - Native Edition + installation_readme = """# Quality Label Printing Windows Service - Native Edition ## INSTALLATION INSTRUCTIONS (Native PowerShell - Zero Dependencies!) diff --git a/py_app/app/static/quality_recticel_print_helper.zip b/py_app/app/static/quality_recticel_print_helper.zip index 349b575ee14e44972622402b56ecd41b6e340dad..d7070fb2a35112fce211e85f2c380433157f0404 100644 GIT binary patch delta 22 dcmdn$vDIV44|%3%i#Gp~|H%xbCx2CT004+O3yA;# delta 22 dcmdn$vDIV44|yiT8JmB}|6~TzlfNoE004Pn3JU-L diff --git a/py_app/app/static/quality_recticel_print_service.zip b/py_app/app/static/quality_recticel_print_service.zip index f5717a82954f4be6eed22bb86e404d8b52c56ab0..66674fa80f6431c85162f758617ff83e1d7af45a 100644 GIT binary patch delta 5643 zcmZu#XD}Q9m|d$z?}S~QVD%QgMG010ov^yqdnb#KNU+K(OAwt9y%W9nP7u*cl&B#{ z;&O90b8~a|&3ym9_h!C7@4b0rcUa$}fi+s>$gu(m3t~Kb%*i7Ffa1x&1pokEKF%I~ za9;=O_!$x$ z4;AA~#7xS9a1fwDEK=`&_aEpo-w2P5O{_v01)mZ2XYn|1O_dVmZ}e2iUv6R40wP|3 zwuc9jx9t|c_e(VPS>gBmBEISjD2?{r`&iGWCjZ7xX`XgA2`HB=3uLstNNdF-fl7DBaEF48Q{F5g@GT(J$(J9-% z?doXjid)kyZIZi$7dM_Rs@S%s3?{t`_!9S%W8s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q=CXV zlaGH!1OPn%0Fw}ZACvfh9t~AN002@&K}1bOE^TC!VSp+E22PWWfI0$+Qj_t46O-J4 zHv-FAlktHQliFVjlQMxS0u*AC@qrnWcY!Pd@NARuffJMeaSfBjfhq#`Zj { - console.log('Quality Recticel Print Service extension installed'); + console.log('Quality Label Printing Service extension installed'); checkServiceStatus(); // Set up periodic service check @@ -160,7 +160,7 @@ async function handlePrintPDF(printData) { chrome.notifications.create({ type: 'basic', iconUrl: 'icons/icon48.png', - title: 'Quality Recticel Print Service', + title: 'Quality Label Printing Service', message: 'PDF printed successfully' }); @@ -176,7 +176,7 @@ async function handlePrintPDF(printData) { chrome.notifications.create({ type: 'basic', iconUrl: 'icons/icon48.png', - title: 'Quality Recticel Print Service', + title: 'Quality Label Printing Service', message: `Print failed: ${error.message}` }); diff --git a/windows_print_service/chrome_extension/content.js b/windows_print_service/chrome_extension/content.js index ab08ae4..137a390 100644 --- a/windows_print_service/chrome_extension/content.js +++ b/windows_print_service/chrome_extension/content.js @@ -1,9 +1,9 @@ /** - * Quality Recticel Print Service - Content Script + * Quality Label Printing Service - Content Script * Injects print service functionality into web pages */ -// Only inject on Quality Recticel domains or localhost +// Only inject on Quality Label Printing domains or localhost const allowedDomains = [ 'localhost', '127.0.0.1' @@ -11,11 +11,11 @@ const allowedDomains = [ const currentDomain = window.location.hostname; if (!allowedDomains.includes(currentDomain)) { - console.log('Quality Recticel Print Service: Not injecting on', currentDomain); + console.log('Quality Label Printing Service: Not injecting on', currentDomain); // return; // Commented out for development - remove in production } -console.log('Quality Recticel Print Service: Content script loaded'); +console.log('Quality Label Printing Service: Content script loaded'); // Inject print service API into the page const printServiceAPI = { @@ -87,7 +87,7 @@ const printServiceAPI = { }, /** - * Print labels with Quality Recticel specific formatting + * Print labels with Quality Label Printing specific formatting */ async printLabels(orderData, quantity = 1) { try { @@ -118,10 +118,10 @@ window.QualityRecticelPrintService = printServiceAPI; // Inject into page context for better compatibility const script = document.createElement('script'); script.textContent = ` - // Quality Recticel Print Service API + // Quality Label Printing Service API window.QualityRecticelPrintService = ${JSON.stringify(printServiceAPI)}; - // Enhanced print function for Quality Recticel + // Enhanced print function for Quality Label Printing window.printQualityRecticelLabels = async function(orderData, quantity) { try { // Get the PDF blob from the server @@ -173,12 +173,12 @@ script.textContent = ` }); } catch (error) { - console.error('Print Quality Recticel labels error:', error); + console.error('Print Quality Label Printing labels error:', error); return { success: false, error: error.message }; } }; - console.log('Quality Recticel Print Service API injected'); + console.log('Quality Label Printing Service API injected'); `; document.documentElement.appendChild(script); @@ -229,4 +229,4 @@ document.addEventListener('DOMContentLoaded', () => { })); }); -console.log('Quality Recticel Print Service: Content script initialized'); \ No newline at end of file +console.log('Quality Label Printing Service: Content script initialized'); \ No newline at end of file diff --git a/windows_print_service/chrome_extension/manifest.json b/windows_print_service/chrome_extension/manifest.json index 46830a3..c7425b3 100644 --- a/windows_print_service/chrome_extension/manifest.json +++ b/windows_print_service/chrome_extension/manifest.json @@ -1,8 +1,8 @@ { "manifest_version": 3, - "name": "Quality Recticel Print Service", + "name": "Quality Label Printing Service", "version": "1.0.0", - "description": "Silent PDF printing service for Quality Recticel application", + "description": "Silent PDF printing service for Quality Label Printing application", "permissions": [ "activeTab", @@ -29,7 +29,7 @@ "action": { "default_popup": "popup.html", - "default_title": "Quality Recticel Print Service", + "default_title": "Quality Label Printing Service", "default_icon": { "16": "icons/icon16.png", "32": "icons/icon32.png", diff --git a/windows_print_service/chrome_extension/popup.html b/windows_print_service/chrome_extension/popup.html index e5c0a1b..f6ff5b6 100644 --- a/windows_print_service/chrome_extension/popup.html +++ b/windows_print_service/chrome_extension/popup.html @@ -160,7 +160,7 @@
-
Quality Recticel Print Service
+
Quality Label Printing Service
Version 1.0.0
diff --git a/windows_print_service/chrome_extension/popup.js b/windows_print_service/chrome_extension/popup.js index 67668ee..c948c49 100644 --- a/windows_print_service/chrome_extension/popup.js +++ b/windows_print_service/chrome_extension/popup.js @@ -1,5 +1,5 @@ /** - * Quality Recticel Print Service - Popup Script + * Quality Label Printing Service - Popup Script * Manages the extension popup interface */ @@ -224,7 +224,7 @@ document.addEventListener('DOMContentLoaded', async () => { */ function showHelp() { const helpText = ` -Quality Recticel Print Service Help +Quality Label Printing Service Help ================================== Installation: @@ -244,7 +244,7 @@ Troubleshooting: • Verify Chrome extension permissions • Check service logs: print_service.log -For support, contact the Quality Recticel development team. +For support, contact the Quality Label Printing development team. `; alert(helpText.trim()); diff --git a/windows_print_service/install_native_service.bat b/windows_print_service/install_native_service.bat index 48186a6..2cbc673 100644 --- a/windows_print_service/install_native_service.bat +++ b/windows_print_service/install_native_service.bat @@ -1,9 +1,9 @@ @echo off -REM Quality Recticel Print Service - Windows Native Installation +REM Quality Label Printing Service - Windows Native Installation REM This script creates a lightweight PowerShell-based print service echo ================================================ -echo Quality Recticel Print Service - Native Windows +echo Quality Label Printing Service - Native Windows echo ================================================ echo. @@ -20,8 +20,8 @@ echo āœ… Administrator privileges confirmed echo. REM Service configuration -set SERVICE_NAME=QualityRecticelPrintService -set SERVICE_DIR=C:\Program Files\QualityRecticel\PrintService +set SERVICE_NAME=QualityLabelPrinting +set SERVICE_DIR=C:\Program Files\QualityLabelPrinting\PrintService echo Creating service directory: %SERVICE_DIR% if not exist "%SERVICE_DIR%" ( @@ -71,7 +71,7 @@ echo Creating service: %SERVICE_NAME% echo Binary path: %SERVICE_DIR%\service_wrapper.bat echo. -sc create %SERVICE_NAME% binPath="%SERVICE_DIR%\service_wrapper.bat" start=auto DisplayName="Quality Recticel Print Service" +sc create %SERVICE_NAME% binPath="%SERVICE_DIR%\service_wrapper.bat" start=auto DisplayName="Quality Label Printing Service" REM Check if service creation succeeded sc query %SERVICE_NAME% >nul 2>&1 @@ -83,7 +83,7 @@ if errorlevel 1 ( echo āœ… Service created successfully REM Set description (may fail on older Windows, that's OK) -sc description %SERVICE_NAME% "Local HTTP service for silent PDF printing from Quality Recticel web application" >nul 2>&1 +sc description %SERVICE_NAME% "Local HTTP service for silent PDF printing from Quality Label Printing web application" >nul 2>&1 goto :service_created diff --git a/windows_print_service/install_simple.bat b/windows_print_service/install_simple.bat index a0bc800..59974ab 100644 --- a/windows_print_service/install_simple.bat +++ b/windows_print_service/install_simple.bat @@ -1,9 +1,9 @@ @echo off -REM Quality Recticel Print Service - Simple Native Installation +REM Quality Label Printing Service - Simple Native Installation REM This version uses the most basic approach to avoid command line parsing issues echo ================================================ -echo Quality Recticel Print Service - Native Windows +echo Quality Label Printing Service - Native Windows echo ================================================ echo. @@ -20,8 +20,8 @@ echo āœ… Administrator privileges confirmed echo. REM Service configuration -set SERVICE_NAME=QualityRecticelPrintService -set SERVICE_DIR=C:\Program Files\QualityRecticel\PrintService +set SERVICE_NAME=QualityLabelPrinting +set SERVICE_DIR=C:\Program Files\QualityLabelPrinting\PrintService echo Creating service directory: %SERVICE_DIR% if not exist "%SERVICE_DIR%" ( @@ -101,7 +101,7 @@ echo āœ… Service created successfully echo. echo Configuring service startup... sc config "%SERVICE_NAME%" start=auto -sc config "%SERVICE_NAME%" DisplayName="Quality Recticel Print Service" +sc config "%SERVICE_NAME%" DisplayName="Quality Label Printing Service" echo. echo Starting the service... diff --git a/windows_print_service/print_service.ps1 b/windows_print_service/print_service.ps1 index e19b119..3794ea4 100644 --- a/windows_print_service/print_service.ps1 +++ b/windows_print_service/print_service.ps1 @@ -1,9 +1,9 @@ -# Quality Recticel Print Service - PowerShell Implementation +# Quality Label Printing Service - PowerShell Implementation # Native Windows solution with no external dependencies param( [int]$Port = 8765, - [string]$LogFile = "$env:ProgramFiles\QualityRecticel\PrintService\print_service.log" + [string]$LogFile = "$env:ProgramFiles\QualityLabelPrinting\PrintService\print_service.log" ) # Ensure log directory exists @@ -109,10 +109,11 @@ function Send-HttpResponse { $Context.Response.StatusCode = $StatusCode $Context.Response.ContentType = "$ContentType; charset=utf-8" - # Add CORS headers + # Add comprehensive CORS headers $Context.Response.Headers.Add("Access-Control-Allow-Origin", "*") - $Context.Response.Headers.Add("Access-Control-Allow-Methods", "GET, POST, OPTIONS") - $Context.Response.Headers.Add("Access-Control-Allow-Headers", "Content-Type, Authorization") + $Context.Response.Headers.Add("Access-Control-Allow-Methods", "GET, POST, OPTIONS, PUT, DELETE") + $Context.Response.Headers.Add("Access-Control-Allow-Headers", "Content-Type, Authorization, Accept, Origin, X-Requested-With") + $Context.Response.Headers.Add("Access-Control-Max-Age", "86400") if ($Body) { $buffer = [System.Text.Encoding]::UTF8.GetBytes($Body) @@ -129,7 +130,7 @@ function Send-HttpResponse { # Main HTTP server function function Start-PrintService { - Write-ServiceLog "Starting Quality Recticel Print Service on port $Port" + Write-ServiceLog "Starting Quality Label Printing Service on port $Port" try { # Create HTTP listener @@ -153,12 +154,19 @@ function Start-PrintService { Write-ServiceLog "$method $url" + # Handle CORS preflight requests first + if ($method -eq "OPTIONS") { + Write-ServiceLog "Handling CORS preflight request for $url" + Send-HttpResponse -Context $context -StatusCode 200 + continue + } + # Handle different endpoints switch -Regex ($url) { "^/health$" { $healthData = @{ status = "healthy" - service = "Quality Recticel Print Service" + service = "Quality Label Printing Service" version = "1.0" timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss" platform = "Windows PowerShell" @@ -207,11 +215,6 @@ function Start-PrintService { } } - "^/options$" { - # Handle CORS preflight - Send-HttpResponse -Context $context -StatusCode 200 - } - default { $errorResponse = @{ success = $false @@ -250,7 +253,7 @@ function Start-PrintService { } # Service entry point -Write-ServiceLog "Quality Recticel Print Service starting..." +Write-ServiceLog "Quality Label Printing Service starting..." # Handle service stop gracefully Register-EngineEvent -SourceIdentifier PowerShell.Exiting -Action { diff --git a/windows_print_service/service_wrapper.bat b/windows_print_service/service_wrapper.bat index 961ac93..5f07a7c 100644 --- a/windows_print_service/service_wrapper.bat +++ b/windows_print_service/service_wrapper.bat @@ -1,4 +1,4 @@ @echo off REM Service wrapper for PowerShell print service -cd /d "C:\Program Files\QualityRecticel\PrintService" +cd /d "C:\Program Files\QualityLabelPrinting\PrintService" powershell.exe -ExecutionPolicy Bypass -NoProfile -WindowStyle Hidden -File "print_service.ps1" \ No newline at end of file diff --git a/windows_print_service/test_service.ps1 b/windows_print_service/test_service.ps1 new file mode 100644 index 0000000..18cf8d0 --- /dev/null +++ b/windows_print_service/test_service.ps1 @@ -0,0 +1,79 @@ +# Test Windows Print Service CORS and Endpoints +# Run this PowerShell script to test the service + +Write-Host "Testing Quality Label Printing Service..." -ForegroundColor Green +Write-Host "=========================================" -ForegroundColor Green + +# Test 1: Health check +Write-Host "`n1. Testing Health Endpoint..." -ForegroundColor Yellow +try { + $response = Invoke-RestMethod -Uri "http://localhost:8765/health" -Method GET -TimeoutSec 5 + Write-Host "āœ… Health check successful:" -ForegroundColor Green + $response | ConvertTo-Json -Depth 3 +} catch { + Write-Host "āŒ Health check failed: $($_.Exception.Message)" -ForegroundColor Red +} + +# Test 2: CORS preflight (OPTIONS request) +Write-Host "`n2. Testing CORS Preflight (OPTIONS)..." -ForegroundColor Yellow +try { + $headers = @{ + 'Origin' = 'http://localhost:5000' + 'Access-Control-Request-Method' = 'POST' + 'Access-Control-Request-Headers' = 'Content-Type' + } + + $response = Invoke-WebRequest -Uri "http://localhost:8765/print/silent" -Method OPTIONS -Headers $headers -TimeoutSec 5 + Write-Host "āœ… CORS preflight successful - Status: $($response.StatusCode)" -ForegroundColor Green + + # Check CORS headers + $corsHeaders = @('Access-Control-Allow-Origin', 'Access-Control-Allow-Methods', 'Access-Control-Allow-Headers') + foreach ($header in $corsHeaders) { + if ($response.Headers[$header]) { + Write-Host " $header: $($response.Headers[$header])" -ForegroundColor Cyan + } else { + Write-Host " āŒ Missing header: $header" -ForegroundColor Red + } + } +} catch { + Write-Host "āŒ CORS preflight failed: $($_.Exception.Message)" -ForegroundColor Red +} + +# Test 3: Printers endpoint +Write-Host "`n3. Testing Printers Endpoint..." -ForegroundColor Yellow +try { + $response = Invoke-RestMethod -Uri "http://localhost:8765/printers" -Method GET -TimeoutSec 5 + Write-Host "āœ… Printers endpoint successful:" -ForegroundColor Green + $response | ConvertTo-Json -Depth 3 +} catch { + Write-Host "āŒ Printers endpoint failed: $($_.Exception.Message)" -ForegroundColor Red +} + +# Test 4: Service status +Write-Host "`n4. Checking Windows Service Status..." -ForegroundColor Yellow +try { + $service = Get-Service -Name "QualityLabelPrinting" -ErrorAction Stop + Write-Host "āœ… Service Status: $($service.Status)" -ForegroundColor Green + Write-Host " Service Name: $($service.Name)" -ForegroundColor Cyan + Write-Host " Display Name: $($service.DisplayName)" -ForegroundColor Cyan +} catch { + Write-Host "āŒ Service not found or error: $($_.Exception.Message)" -ForegroundColor Red +} + +# Test 5: Check service logs +Write-Host "`n5. Recent Service Logs..." -ForegroundColor Yellow +$logPath = "C:\Program Files\QualityLabelPrinting\PrintService\print_service.log" +if (Test-Path $logPath) { + Write-Host "šŸ“‹ Last 10 log entries:" -ForegroundColor Cyan + Get-Content $logPath -Tail 10 | ForEach-Object { Write-Host " $_" -ForegroundColor White } +} else { + Write-Host "āŒ Log file not found at: $logPath" -ForegroundColor Red +} + +Write-Host "`n=========================================" -ForegroundColor Green +Write-Host "Service test completed!" -ForegroundColor Green +Write-Host "`nNext steps:" -ForegroundColor Yellow +Write-Host "1. If any tests failed, restart the service: sc restart QualityLabelPrinting" -ForegroundColor White +Write-Host "2. Check firewall settings if connection refused" -ForegroundColor White +Write-Host "3. Verify no other applications using port 8765" -ForegroundColor White +Write-Host "4. Test in browser: http://localhost:8765/health" -ForegroundColor White \ No newline at end of file diff --git a/windows_print_service/uninstall_service.bat b/windows_print_service/uninstall_service.bat index 71d7da2..699ae89 100644 --- a/windows_print_service/uninstall_service.bat +++ b/windows_print_service/uninstall_service.bat @@ -1,9 +1,9 @@ @echo off -REM Quality Recticel Print Service - Uninstaller +REM Quality Label Printing Service - Uninstaller REM This script removes the Windows print service echo ================================================ -echo Quality Recticel Print Service - Uninstaller +echo Quality Label Printing Service - Uninstaller echo ================================================ echo. @@ -20,8 +20,8 @@ echo āœ… Administrator privileges confirmed echo. REM Service configuration -set SERVICE_NAME=QualityRecticelPrintService -set SERVICE_DIR=C:\Program Files\QualityRecticel\PrintService +set SERVICE_NAME=QualityLabelPrinting +set SERVICE_DIR=C:\Program Files\QualityLabelPrinting\PrintService echo Stopping the service... sc stop "%SERVICE_NAME%" >nul 2>&1 @@ -60,10 +60,10 @@ echo ================================================ echo Uninstallation Complete! echo ================================================ echo. -echo The Quality Recticel Print Service has been removed from your system. +echo The Quality Label Printing Service has been removed from your system. echo. echo If you had any Chrome extensions installed, you may want to: -echo 1. Remove the Quality Recticel Print extension from Chrome +echo 1. Remove the Quality Label Printing extension from Chrome echo 2. Clear any remaining Chrome extension data echo. pause \ No newline at end of file