Fix QZ Tray library loading and add pairing keys API endpoint

- Fix QZ Tray library loading errors (net::ERR_NAME_NOT_RESOLVED) by switching from CDN to local static file
- Add /labels/api/pairing-keys endpoint to fetch valid printer pairing keys
- Update print_labels.html to use local js/qz-tray.js
- Update print_lost_labels.html to use local js/qz-tray.js
- Update print_lost_labels_new.html to use correct path js/qz-tray.js
- Update fg_scan.html to use local js/qz-tray.js
- API returns active pairing keys from qz_pairing_keys table for printer selection
This commit is contained in:
Quality App Developer
2026-02-15 13:19:19 +02:00
parent d5b043c762
commit 2b6be2ba49
5 changed files with 42 additions and 4 deletions

View File

@@ -290,8 +290,11 @@
<!-- Add html2canvas library for capturing preview as image -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
<!-- PATCHED QZ Tray library - works with custom server using pairing key authentication -->
<script src="{{ url_for('static', filename='js/qz-tray.js') }}"></script>
<!-- CDN versions (disabled):
<script src="https://qz.glyphtree.com/api/latest/qz-tray.js"></script>
<!-- Original CDN version (disabled): <script src="https://cdn.jsdelivr.net/npm/qz-tray@2.2.4/qz-tray.js"></script> -->
<script src="https://cdn.jsdelivr.net/npm/qz-tray@2.2.4/qz-tray.js"></script>
-->
<script>
// Simplified notification system