zebra-day 0.0.37__py3-none-any.whl → 1.0.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. zebra_day/__init__.py +35 -0
  2. zebra_day/bin/__init__.py +0 -0
  3. zebra_day/bin/fetch_zebra_config.py +15 -0
  4. zebra_day/bin/generate_coord_grid_zpl.py +50 -0
  5. zebra_day/bin/print_zpl_from_file.py +21 -0
  6. zebra_day/bin/probe_new_label_dimensions.py +75 -0
  7. zebra_day/bin/scan_for_networed_zebra_printers_arp_scan.sh +1 -0
  8. zebra_day/bin/scan_for_networed_zebra_printers_curl.sh +30 -0
  9. zebra_day/bin/zserve.py +701 -259
  10. zebra_day/cli/__init__.py +240 -0
  11. zebra_day/cli/cognito.py +121 -0
  12. zebra_day/cli/gui.py +255 -0
  13. zebra_day/cli/printer.py +168 -0
  14. zebra_day/cli/template.py +176 -0
  15. zebra_day/cmd_mgr.py +35 -0
  16. zebra_day/etc/Monoid-Regular-HalfTight-Dollar-0-1-l.ttf +0 -0
  17. zebra_day/etc/label_styles/blank.zpl +0 -0
  18. zebra_day/etc/label_styles/cornersStripOf4Squares_1inX1in.zpl +55 -0
  19. zebra_day/etc/label_styles/corners_1inX2in.zpl +28 -0
  20. zebra_day/etc/label_styles/corners_20cmX30cm.zpl +6 -0
  21. zebra_day/etc/label_styles/corners_smallTube.zpl +7 -0
  22. zebra_day/etc/label_styles/corners_unspecifiedDimensions.zpl +15 -0
  23. zebra_day/etc/label_styles/generic_2inX1in.zpl +21 -0
  24. zebra_day/etc/label_styles/plate_1inX0.25in.zpl +9 -0
  25. zebra_day/etc/label_styles/plate_1inX0.25inHD.zpl +9 -0
  26. zebra_day/etc/label_styles/smallTubeWdotHD_prod.zpl +8 -0
  27. zebra_day/etc/label_styles/smallTubeWdot_corners.zpl +7 -0
  28. zebra_day/etc/label_styles/smallTubeWdot_prod.zpl +8 -0
  29. zebra_day/etc/label_styles/smallTubeWdot_prodAlt1.zpl +6 -0
  30. zebra_day/etc/label_styles/smallTubeWdot_prodAlt1b.zpl +3 -0
  31. zebra_day/etc/label_styles/smallTubeWdot_prodV2.zpl +8 -0
  32. zebra_day/etc/label_styles/smallTubeWdot_reagent.zpl +29 -0
  33. zebra_day/etc/label_styles/stripOf4Squares_1inX1in.zpl +32 -0
  34. zebra_day/etc/label_styles/test_800dX800dCoordinateArray.zpl +1 -0
  35. zebra_day/etc/label_styles/tmps/.hold +0 -0
  36. zebra_day/etc/label_styles/tmps/tmp_zpl_templates.here +0 -0
  37. zebra_day/etc/label_styles/tube_20mmX30mmA.zpl +7 -0
  38. zebra_day/etc/label_styles/tube_2inX0.3in.zpl +15 -0
  39. zebra_day/etc/label_styles/tube_2inX0.5in.zpl +15 -0
  40. zebra_day/etc/label_styles/tube_2inX0.5inHD.zpl +15 -0
  41. zebra_day/etc/label_styles/tube_2inX1in.zpl +25 -0
  42. zebra_day/etc/label_styles/tube_2inX1inHD.zpl +22 -0
  43. zebra_day/etc/label_styles/tube_2inX1inHDv3.zpl +21 -0
  44. zebra_day/etc/old_printer_config/.hold +0 -0
  45. zebra_day/etc/old_printer_config/2026-02-01_01:50:25.022846_printer_config.json +1 -0
  46. zebra_day/etc/old_printer_config/2026-02-01_01:50:25.033657_printer_config.json +1 -0
  47. zebra_day/etc/old_printer_config/2026-02-01_01:50:25.039597_printer_config.json +3 -0
  48. zebra_day/etc/old_printer_config/2026-02-01_01:50:25.047295_printer_config.json +1 -0
  49. zebra_day/etc/old_printer_config/2026-02-01_01:50:25.055804_printer_config.json +1 -0
  50. zebra_day/etc/old_printer_config/2026-02-01_01:50:25.061337_printer_config.json +3 -0
  51. zebra_day/etc/old_printer_config/2026-02-01_01:51:24.073326_printer_config.json +1 -0
  52. zebra_day/etc/old_printer_config/2026-02-01_01:51:24.081950_printer_config.json +1 -0
  53. zebra_day/etc/old_printer_config/2026-02-01_01:51:24.088251_printer_config.json +3 -0
  54. zebra_day/etc/old_printer_config/2026-02-01_01:51:24.096501_printer_config.json +1 -0
  55. zebra_day/etc/old_printer_config/2026-02-01_01:51:24.104767_printer_config.json +1 -0
  56. zebra_day/etc/old_printer_config/2026-02-01_01:51:24.110364_printer_config.json +3 -0
  57. zebra_day/etc/old_printer_config/2026-02-01_01:51:24.118239_printer_config.json +1 -0
  58. zebra_day/etc/old_printer_config/2026-02-01_01:51:24.125950_printer_config.json +1 -0
  59. zebra_day/etc/old_printer_config/2026-02-01_01:51:24.349866_printer_config.json +1 -0
  60. zebra_day/etc/old_printer_config/2026-02-01_01:51:24.361085_printer_config.json +3 -0
  61. zebra_day/etc/old_printer_config/2026-02-01_01:51:24.558323_printer_config.json +1 -0
  62. zebra_day/etc/old_printer_config/2026-02-01_01:51:24.565756_printer_config.json +3 -0
  63. zebra_day/etc/old_printer_config/2026-02-01_01:51:29.739070_printer_config.json +16 -0
  64. zebra_day/etc/old_printer_config/2026-02-01_01:51:29.753796_printer_config.json +1 -0
  65. zebra_day/etc/old_printer_config/2026-02-01_01:51:29.760201_printer_config.json +3 -0
  66. zebra_day/etc/old_printer_config/2026-02-01_01:51:29.768747_printer_config.json +1 -0
  67. zebra_day/etc/old_printer_config/2026-02-01_01:51:29.775312_printer_config.json +3 -0
  68. zebra_day/etc/old_printer_config/2026-02-01_01:51:29.782533_printer_config.json +1 -0
  69. zebra_day/etc/old_printer_config/2026-02-01_01:51:29.789287_printer_config.json +1 -0
  70. zebra_day/etc/old_printer_config/2026-02-01_01:51:29.794230_printer_config.json +3 -0
  71. zebra_day/etc/old_printer_config/2026-02-01_01:51:29.800021_printer_config.json +5 -0
  72. zebra_day/etc/printer_config.json +16 -0
  73. zebra_day/etc/printer_config.template.json +16 -0
  74. zebra_day/etc/tmp_printers0.json +5 -0
  75. zebra_day/etc/tmp_printers374.json +5 -0
  76. zebra_day/etc/tmp_printers383.json +5 -0
  77. zebra_day/etc/tmp_printers450.json +5 -0
  78. zebra_day/etc/tmp_printers504.json +5 -0
  79. zebra_day/etc/tmp_printers608.json +5 -0
  80. zebra_day/etc/tmp_printers657.json +5 -0
  81. zebra_day/etc/tmp_printers838.json +5 -0
  82. zebra_day/etc/tmp_printers839.json +5 -0
  83. zebra_day/etc/tmp_printers933.json +5 -0
  84. zebra_day/etc/tmp_printers957.json +5 -0
  85. zebra_day/exceptions.py +88 -0
  86. zebra_day/files/.hold +0 -0
  87. zebra_day/files/hold +0 -0
  88. zebra_day/files/test_png_17696.png +0 -0
  89. zebra_day/files/test_png_23477.png +0 -0
  90. zebra_day/files/test_png_28157.png +0 -0
  91. zebra_day/files/test_png_35832.png +0 -0
  92. zebra_day/files/test_png_36400.png +0 -0
  93. zebra_day/files/test_png_40816.png +0 -0
  94. zebra_day/files/test_png_49564.png +0 -0
  95. zebra_day/files/test_png_53848.png +0 -0
  96. zebra_day/files/test_png_62542.png +0 -0
  97. zebra_day/files/test_png_91597.png +0 -0
  98. zebra_day/files/test_png_93633.png +0 -0
  99. zebra_day/files/tmpbjo3k7q1.png +0 -0
  100. zebra_day/files/tmpigtr4pwy.png +0 -0
  101. zebra_day/files/zpl_label_tube_2inX1in_2026-02-01_01:51:24.370964.png +0 -0
  102. zebra_day/logging_config.py +74 -0
  103. zebra_day/logs/.hold +0 -0
  104. zebra_day/logs/print_requests.log +2 -0
  105. zebra_day/paths.py +143 -0
  106. zebra_day/print_mgr.py +487 -103
  107. zebra_day/static/datschund.css +140 -0
  108. zebra_day/static/datschund.png +0 -0
  109. zebra_day/static/daylily.png +0 -0
  110. zebra_day/static/favicon.svg +20 -0
  111. zebra_day/static/general.css +99 -0
  112. zebra_day/static/js/zebra_modern.js +172 -0
  113. zebra_day/static/lsmc.css +354 -0
  114. zebra_day/static/moon.jpeg +0 -0
  115. zebra_day/static/oakland.css +197 -0
  116. zebra_day/static/petrichor.css +150 -0
  117. zebra_day/static/popday_daylily.css +140 -0
  118. zebra_day/static/style.css +183 -0
  119. zebra_day/static/triangles.css +122 -0
  120. zebra_day/static/tron.css +277 -0
  121. zebra_day/static/zebra_modern.css +771 -0
  122. zebra_day/static/zebras.css +176 -0
  123. zebra_day/templates/base.html +36 -0
  124. zebra_day/templates/bpr.html +72 -0
  125. zebra_day/templates/build_new_config.html +36 -0
  126. zebra_day/templates/build_print_request.html +32 -0
  127. zebra_day/templates/chg_ui_style.html +19 -0
  128. zebra_day/templates/edit_template.html +128 -0
  129. zebra_day/templates/edit_zpl.html +37 -0
  130. zebra_day/templates/index.html +82 -0
  131. zebra_day/templates/legacy/base.html +37 -0
  132. zebra_day/templates/legacy/bpr.html +72 -0
  133. zebra_day/templates/legacy/build_new_config.html +36 -0
  134. zebra_day/templates/legacy/build_print_request.html +32 -0
  135. zebra_day/templates/legacy/chg_ui_style.html +19 -0
  136. zebra_day/templates/legacy/edit_template.html +128 -0
  137. zebra_day/templates/legacy/edit_zpl.html +37 -0
  138. zebra_day/templates/legacy/index.html +82 -0
  139. zebra_day/templates/legacy/list_prior_configs.html +24 -0
  140. zebra_day/templates/legacy/print_result.html +30 -0
  141. zebra_day/templates/legacy/printer_details.html +25 -0
  142. zebra_day/templates/legacy/printer_status.html +70 -0
  143. zebra_day/templates/legacy/save_result.html +17 -0
  144. zebra_day/templates/legacy/send_print_request.html +34 -0
  145. zebra_day/templates/legacy/simple_print.html +94 -0
  146. zebra_day/templates/legacy/view_pstation_json.html +29 -0
  147. zebra_day/templates/list_prior_configs.html +24 -0
  148. zebra_day/templates/modern/base.html +98 -0
  149. zebra_day/templates/modern/config.html +141 -0
  150. zebra_day/templates/modern/dashboard.html +160 -0
  151. zebra_day/templates/modern/print_request.html +141 -0
  152. zebra_day/templates/modern/print_result.html +88 -0
  153. zebra_day/templates/modern/printer_detail.html +117 -0
  154. zebra_day/templates/modern/printers.html +133 -0
  155. zebra_day/templates/modern/save_result.html +46 -0
  156. zebra_day/templates/modern/template_editor.html +172 -0
  157. zebra_day/templates/modern/templates.html +122 -0
  158. zebra_day/templates/print_result.html +30 -0
  159. zebra_day/templates/printer_details.html +25 -0
  160. zebra_day/templates/printer_status.html +70 -0
  161. zebra_day/templates/save_result.html +17 -0
  162. zebra_day/templates/send_print_request.html +34 -0
  163. zebra_day/templates/simple_print.html +94 -0
  164. zebra_day/templates/view_pstation_json.html +29 -0
  165. zebra_day/web/__init__.py +9 -0
  166. zebra_day/web/app.py +171 -0
  167. zebra_day/web/auth.py +172 -0
  168. zebra_day/web/middleware.py +159 -0
  169. zebra_day/web/routers/__init__.py +2 -0
  170. zebra_day/web/routers/api.py +163 -0
  171. zebra_day/web/routers/ui.py +1051 -0
  172. zebra_day/zpl_renderer.py +273 -0
  173. zebra_day-1.0.2.dist-info/METADATA +786 -0
  174. zebra_day-1.0.2.dist-info/RECORD +179 -0
  175. {zebra_day-0.0.37.dist-info → zebra_day-1.0.2.dist-info}/WHEEL +1 -1
  176. zebra_day-1.0.2.dist-info/entry_points.txt +4 -0
  177. zebra_day/bin/te.py +0 -905
  178. zebra_day-0.0.37.dist-info/METADATA +0 -1177
  179. zebra_day-0.0.37.dist-info/RECORD +0 -10
  180. {zebra_day-0.0.37.dist-info → zebra_day-1.0.2.dist-info/licenses}/LICENSE +0 -0
  181. {zebra_day-0.0.37.dist-info → zebra_day-1.0.2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,172 @@
1
+ {% extends "modern/base.html" %}
2
+
3
+ {% block title %}Edit: {{ filename }} - Zebra Day{% endblock %}
4
+
5
+ {% block extra_head %}
6
+ <style>
7
+ .editor-container { display: grid; grid-template-columns: 1fr 1fr; gap: var(--spacing-lg); }
8
+ .editor-textarea { min-height: 500px; font-family: var(--font-mono); font-size: 14px; }
9
+ .preview-frame { background: var(--color-white); border-radius: var(--radius-md); padding: var(--spacing-lg); min-height: 300px; }
10
+ @media (max-width: 1024px) { .editor-container { grid-template-columns: 1fr; } }
11
+ </style>
12
+ {% endblock %}
13
+
14
+ {% block content %}
15
+ <div class="page-header">
16
+ <h1 class="page-title">Edit: {{ filename }}</h1>
17
+ <p class="page-subtitle">{% if dtype %}Draft template{% else %}Stable template{% endif %}</p>
18
+ </div>
19
+
20
+ <!-- Breadcrumb -->
21
+ <div class="mb-lg">
22
+ <a href="/" class="text-muted">Dashboard</a>
23
+ <span class="text-muted"> / </span>
24
+ <a href="/templates">Templates</a>
25
+ <span class="text-muted"> / </span>
26
+ <span>{{ filename }}</span>
27
+ </div>
28
+
29
+ <form id="editor-form" action="/save" method="post">
30
+ <input type="hidden" name="filename" value="{{ filename }}">
31
+
32
+ <div class="editor-container">
33
+ <!-- Editor Panel -->
34
+ <div class="card">
35
+ <div class="card-header">
36
+ <h3 class="card-title"><i class="fas fa-code"></i> ZPL Code</h3>
37
+ <button type="button" class="btn btn-outline btn-sm" onclick="previewTemplate()">
38
+ <i class="fas fa-eye"></i> Preview
39
+ </button>
40
+ </div>
41
+ <textarea name="content" id="zpl-editor" class="form-control editor-textarea">{{ content }}</textarea>
42
+ </div>
43
+
44
+ <!-- Preview Panel -->
45
+ <div class="card">
46
+ <div class="card-header">
47
+ <h3 class="card-title"><i class="fas fa-image"></i> Preview</h3>
48
+ <span class="badge badge-info" id="preview-status">Ready</span>
49
+ </div>
50
+ <div class="preview-frame" id="preview-container">
51
+ <div class="empty-state">
52
+ <i class="fas fa-image"></i>
53
+ <p>Click Preview to generate</p>
54
+ </div>
55
+ </div>
56
+ </div>
57
+ </div>
58
+
59
+ <!-- Save Options -->
60
+ <div class="card mt-lg">
61
+ <div class="card-header">
62
+ <h3 class="card-title">Save Options</h3>
63
+ </div>
64
+ <div class="grid grid-3">
65
+ <div class="form-group mb-0">
66
+ <label class="form-label">Draft Tag</label>
67
+ <input type="text" name="ftag" class="form-control" value="draft" placeholder="Tag for draft version">
68
+ </div>
69
+ <div class="form-group mb-0">
70
+ <label class="form-label">Test Lab</label>
71
+ <select name="lab" class="form-control" id="test-lab" onchange="updateTestPrinters()">
72
+ <option value="">Select lab...</option>
73
+ {% for lab in labs %}
74
+ <option value="{{ lab }}">{{ lab }}</option>
75
+ {% endfor %}
76
+ </select>
77
+ </div>
78
+ <div class="form-group mb-0">
79
+ <label class="form-label">Test Printer</label>
80
+ <select name="printer" class="form-control" id="test-printer">
81
+ <option value="">Select printer...</option>
82
+ </select>
83
+ </div>
84
+ </div>
85
+ </div>
86
+
87
+ <!-- Actions -->
88
+ <div class="card mt-lg">
89
+ <div class="d-flex" style="justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--spacing-md);">
90
+ <a href="/templates" class="btn btn-outline">
91
+ <i class="fas fa-arrow-left"></i> Cancel
92
+ </a>
93
+ <div class="d-flex gap-md">
94
+ <button type="button" class="btn btn-outline" onclick="testPrint()">
95
+ <i class="fas fa-print"></i> Test Print
96
+ </button>
97
+ <button type="submit" class="btn btn-primary">
98
+ <i class="fas fa-save"></i> Save as Draft
99
+ </button>
100
+ </div>
101
+ </div>
102
+ </div>
103
+ </form>
104
+ {% endblock %}
105
+
106
+ {% block extra_scripts %}
107
+ <script>
108
+ var labsDict = {{ labs_dict | safe }};
109
+
110
+ function updateTestPrinters() {
111
+ var labSelect = document.getElementById('test-lab');
112
+ var printerSelect = document.getElementById('test-printer');
113
+ var lab = labSelect.value;
114
+
115
+ printerSelect.innerHTML = '<option value="">Select printer...</option>';
116
+ if (lab && labsDict[lab]) {
117
+ for (var printer in labsDict[lab]) {
118
+ var option = document.createElement('option');
119
+ option.value = printer;
120
+ option.text = printer;
121
+ printerSelect.appendChild(option);
122
+ }
123
+ }
124
+ }
125
+
126
+ async function previewTemplate() {
127
+ var statusBadge = document.getElementById('preview-status');
128
+ var container = document.getElementById('preview-container');
129
+ var content = document.getElementById('zpl-editor').value;
130
+
131
+ statusBadge.textContent = 'Loading...';
132
+ statusBadge.className = 'badge badge-warning';
133
+
134
+ try {
135
+ var response = await fetch('/api/v1/preview_zpl', {
136
+ method: 'POST',
137
+ headers: { 'Content-Type': 'application/json' },
138
+ body: JSON.stringify({ zpl_content: content })
139
+ });
140
+ var data = await response.json();
141
+ if (data.png_url) {
142
+ container.innerHTML = '<img src="' + data.png_url + '" alt="Preview" style="max-width: 100%;">';
143
+ statusBadge.textContent = 'Ready';
144
+ statusBadge.className = 'badge badge-success';
145
+ } else {
146
+ throw new Error(data.error || 'Preview failed');
147
+ }
148
+ } catch (err) {
149
+ container.innerHTML = '<div class="empty-state"><i class="fas fa-exclamation-triangle"></i><p>' + err.message + '</p></div>';
150
+ statusBadge.textContent = 'Error';
151
+ statusBadge.className = 'badge badge-error';
152
+ }
153
+ }
154
+
155
+ function testPrint() {
156
+ var lab = document.getElementById('test-lab').value;
157
+ var printer = document.getElementById('test-printer').value;
158
+ if (!lab || !printer) {
159
+ showToast('warning', 'Select Printer', 'Please select a lab and printer for test print.');
160
+ return;
161
+ }
162
+ var content = document.getElementById('zpl-editor').value;
163
+ var form = document.createElement('form');
164
+ form.method = 'POST';
165
+ form.action = '/api/v1/print_raw_zpl';
166
+ form.innerHTML = '<input name="lab" value="' + lab + '"><input name="printer" value="' + printer + '"><textarea name="zpl_content">' + content + '</textarea>';
167
+ document.body.appendChild(form);
168
+ form.submit();
169
+ }
170
+ </script>
171
+ {% endblock %}
172
+
@@ -0,0 +1,122 @@
1
+ {% extends "modern/base.html" %}
2
+
3
+ {% block title %}Templates - Zebra Day{% endblock %}
4
+
5
+ {% block content %}
6
+ <div class="page-header">
7
+ <h1 class="page-title">ZPL Templates</h1>
8
+ <p class="page-subtitle">Manage label templates and styles</p>
9
+ </div>
10
+
11
+ <div class="grid grid-2">
12
+ <!-- Stable Templates -->
13
+ <div class="card">
14
+ <div class="card-header">
15
+ <h3 class="card-title">
16
+ <i class="fas fa-check-circle text-success"></i> Stable Templates
17
+ </h3>
18
+ <span class="badge badge-success">{{ stable_templates | length }}</span>
19
+ </div>
20
+ {% if stable_templates %}
21
+ <div class="table-container" style="box-shadow: none;">
22
+ <table class="table">
23
+ <thead>
24
+ <tr>
25
+ <th>Template Name</th>
26
+ <th>Actions</th>
27
+ </tr>
28
+ </thead>
29
+ <tbody>
30
+ {% for template in stable_templates %}
31
+ <tr>
32
+ <td>
33
+ <i class="fas fa-file-code text-muted"></i>
34
+ <strong>{{ template }}</strong>
35
+ </td>
36
+ <td>
37
+ <a href="/templates/edit?filename={{ template }}" class="btn btn-sm btn-outline">
38
+ <i class="fas fa-edit"></i> Edit
39
+ </a>
40
+ <a href="/templates/preview?filename={{ template }}" class="btn btn-sm btn-primary">
41
+ <i class="fas fa-eye"></i> Preview
42
+ </a>
43
+ </td>
44
+ </tr>
45
+ {% endfor %}
46
+ </tbody>
47
+ </table>
48
+ </div>
49
+ {% else %}
50
+ <div class="empty-state">
51
+ <i class="fas fa-file-code"></i>
52
+ <p>No stable templates found</p>
53
+ </div>
54
+ {% endif %}
55
+ </div>
56
+
57
+ <!-- Draft Templates -->
58
+ <div class="card">
59
+ <div class="card-header">
60
+ <h3 class="card-title">
61
+ <i class="fas fa-pencil-alt text-warning"></i> Draft Templates
62
+ </h3>
63
+ <span class="badge badge-warning">{{ draft_templates | length }}</span>
64
+ </div>
65
+ {% if draft_templates %}
66
+ <div class="table-container" style="box-shadow: none;">
67
+ <table class="table">
68
+ <thead>
69
+ <tr>
70
+ <th>Template Name</th>
71
+ <th>Actions</th>
72
+ </tr>
73
+ </thead>
74
+ <tbody>
75
+ {% for template in draft_templates %}
76
+ <tr>
77
+ <td>
78
+ <i class="fas fa-file-alt text-muted"></i>
79
+ <strong>{{ template }}</strong>
80
+ </td>
81
+ <td>
82
+ <a href="/templates/edit?filename={{ template }}&dtype=tmps" class="btn btn-sm btn-outline">
83
+ <i class="fas fa-edit"></i> Edit
84
+ </a>
85
+ <a href="/templates/preview?filename={{ template }}&dtype=tmps" class="btn btn-sm btn-primary">
86
+ <i class="fas fa-eye"></i> Preview
87
+ </a>
88
+ </td>
89
+ </tr>
90
+ {% endfor %}
91
+ </tbody>
92
+ </table>
93
+ </div>
94
+ {% else %}
95
+ <div class="empty-state">
96
+ <i class="fas fa-pencil-alt"></i>
97
+ <p>No draft templates yet</p>
98
+ <small class="text-muted">Edit a stable template to create a draft</small>
99
+ </div>
100
+ {% endif %}
101
+ </div>
102
+ </div>
103
+
104
+ <!-- Format Keys Reference -->
105
+ <div class="card mt-lg">
106
+ <div class="card-header">
107
+ <h3 class="card-title">Template Format Keys</h3>
108
+ </div>
109
+ <p class="text-muted mb-lg">Use these placeholders in your ZPL templates to insert dynamic data:</p>
110
+ <div class="grid grid-4">
111
+ <div><code>{uid_barcode}</code> - Barcode value</div>
112
+ <div><code>{alt_a}</code> - Custom field A</div>
113
+ <div><code>{alt_b}</code> - Custom field B</div>
114
+ <div><code>{alt_c}</code> - Custom field C</div>
115
+ <div><code>{alt_d}</code> - Custom field D</div>
116
+ <div><code>{alt_e}</code> - Custom field E</div>
117
+ <div><code>{alt_f}</code> - Custom field F</div>
118
+ <div><code>{rec_date}</code> - Record date</div>
119
+ </div>
120
+ </div>
121
+ {% endblock %}
122
+
@@ -0,0 +1,30 @@
1
+ {% extends "base.html" %}
2
+
3
+ {% block title %}{{ title }}{% endblock %}
4
+
5
+ {% block content %}
6
+ <h1>Label Print Request Sent</h1>
7
+ <small><a href="/">home</a></small>
8
+ <hr>
9
+
10
+ {% if success %}
11
+ {% if png_url %}
12
+ <h2>Successfully Created PNG</h2>
13
+ <img src="{{ png_url }}" alt="Label Preview">
14
+ <br><br>
15
+ <a href="{{ png_url }}" download>Download PNG</a>
16
+ {% else %}
17
+ <h2>Success - Label Printed</h2>
18
+ {% endif %}
19
+ {% else %}
20
+ <h2 style="color: red;">Error Printing Label</h2>
21
+ {% endif %}
22
+
23
+ <hr>
24
+ <p><small>The URL for this print request (which you can edit and use in curl) is:</small></p>
25
+ <code>{{ full_url }}</code>
26
+
27
+ <br><br>
28
+ <a href="/">Home</a>
29
+ {% endblock %}
30
+
@@ -0,0 +1,25 @@
1
+ {% extends "base.html" %}
2
+
3
+ {% block title %}{{ title }}{% endblock %}
4
+
5
+ {% block content %}
6
+ <h1>Printer Information For {{ printer_name }} In Lab {{ lab }}</h1>
7
+ <ul>
8
+ <small><a href="/">HOME</a> ... <a href="/printer_status?lab={{ lab }}">printer status report</a></small>
9
+ <hr>
10
+
11
+ <h2>JSON Stored Data</h2>
12
+ <ul>
13
+ {% for key, value in printer_info.items() %}
14
+ <li><strong>{{ key }}</strong>: {{ value }}</li>
15
+ {% endfor %}
16
+ </ul>
17
+
18
+ <br>
19
+ <h2>Configuration Retrieved From The Zebra Printer</h2>
20
+ <ul>
21
+ <pre>{{ printer_config }}</pre>
22
+ </ul>
23
+ </ul>
24
+ {% endblock %}
25
+
@@ -0,0 +1,70 @@
1
+ {% extends "base.html" %}
2
+
3
+ {% block title %}{{ title }}{% endblock %}
4
+
5
+ {% block content %}
6
+ <h1>Printer Status Summary For {{ lab }}</h1>
7
+ <small><a href="/">BACK HOME</a></small>
8
+ <ul>
9
+ <hr>
10
+ <br>
11
+ <table border="1">
12
+ <tr>
13
+ <th>Printer Name</th>
14
+ <th>Printer IP</th>
15
+ <th>Label Styles Available</th>
16
+ <th>Status on Network</th>
17
+ </tr>
18
+ {% for printer in printers %}
19
+ <tr>
20
+ <td>
21
+ {{ printer.name }}<br>
22
+ <small>{{ printer.model }}<br>{{ printer.serial }}</small>
23
+ </td>
24
+ <td>
25
+ {% if printer.ip_address != 'dl_png' %}
26
+ <a href="http://{{ printer.ip_address }}" target="_blank">{{ printer.ip_address }}</a>
27
+ {% else %}
28
+ {{ printer.ip_address }}
29
+ {% endif %}
30
+ <br><small>{{ printer.arp_data }}</small>
31
+ </td>
32
+ <td>
33
+ {% for style in printer.label_zpl_styles %}
34
+ <small>
35
+ <a href="/edit_zpl">{{ style }}</a>
36
+ (<a href="/_print_label?lab={{ lab }}&printer={{ printer.name }}&label_zpl_style={{ style }}&uid_barcode={{ printer.ip_address }}&alt_a={{ printer.model }}&alt_b={{ printer.serial }}&alt_c={{ lab }}&alt_d={{ lab }}" target="_blank">test</a>)
37
+ </small><br>
38
+ {% endfor %}
39
+ </td>
40
+ <td>
41
+ {{ printer.status }}
42
+ <br><small><a href="/printer_details?printer_name={{ printer.name }}&lab={{ lab }}" target="_blank">...printer details</a></small>
43
+ </td>
44
+ </tr>
45
+ {% endfor %}
46
+ </table>
47
+ </ul>
48
+
49
+ <br><hr>
50
+ <h2>Build New Printers Config JSON // Scan Network</h2>
51
+ <ul>
52
+ <p>This will probe for printers, and with all discovered printers will create a new printers JSON and overwrite the current fleet data for this lab.</p>
53
+ <form id="myForm" action="/probe_zebra_printers_add_to_printers_json">
54
+ <label>Enter IP Root To Scan:</label>
55
+ <input type="text" value="{{ ip_root }}" name="ip_stub">
56
+ <br>
57
+ <label>Select (or enter new) lab:</label>
58
+ <input type="text" name="lab" list="lab_names" value="{{ lab }}">
59
+ <datalist id="lab_names">
60
+ {% for lab_name in labs %}
61
+ <option value="{{ lab_name }}">{{ lab_name }}</option>
62
+ {% endfor %}
63
+ </datalist>
64
+ <br>
65
+ <input type="submit" value="Scan Network">
66
+ </form>
67
+ <small><a href="/list_prior_printer_config_files">The current printers JSON will be backed up and can be found here.</a></small>
68
+ </ul>
69
+ {% endblock %}
70
+
@@ -0,0 +1,17 @@
1
+ {% extends "base.html" %}
2
+
3
+ {% block title %}{{ title }}{% endblock %}
4
+
5
+ {% block content %}
6
+ <h1>Template Saved</h1>
7
+ <small><a href="/">home</a></small>
8
+ <hr>
9
+
10
+ <p>Changes saved to temp file: <strong>{{ new_filename }}</strong></p>
11
+
12
+ <ul>
13
+ <li><a href="/edit_zpl">Go back to the ZPL file list</a></li>
14
+ <li><a href="/">Go home</a></li>
15
+ </ul>
16
+ {% endblock %}
17
+
@@ -0,0 +1,34 @@
1
+ {% extends "base.html" %}
2
+
3
+ {% block title %}{{ title }}{% endblock %}
4
+
5
+ {% block content %}
6
+ <h1>Send Print Request</h1>
7
+ <small><a href="/">home</a></small>
8
+ <hr>
9
+
10
+ {% for lab_name, printers in labs.items() %}
11
+ <h2>Lab: {{ lab_name }}</h2>
12
+ <table border="1" width="90%">
13
+ <tr>
14
+ <th>Printer</th>
15
+ <th>Available Label Styles</th>
16
+ </tr>
17
+ {% for printer_name, printer_info in printers.items() %}
18
+ <tr>
19
+ <td>
20
+ <strong>{{ printer_name }}</strong><br>
21
+ <small>{{ printer_info.ip_address }}</small>
22
+ </td>
23
+ <td>
24
+ {% for style in printer_info.label_zpl_styles %}
25
+ <a href="/build_print_request?lab={{ lab_name }}&printer={{ printer_name }}&printer_ip={{ printer_info.ip_address }}&label_zpl_style={{ style }}">{{ style }}</a><br>
26
+ {% endfor %}
27
+ </td>
28
+ </tr>
29
+ {% endfor %}
30
+ </table>
31
+ <br>
32
+ {% endfor %}
33
+ {% endblock %}
34
+
@@ -0,0 +1,94 @@
1
+ {% extends "base.html" %}
2
+
3
+ {% block title %}{{ title }}{% endblock %}
4
+
5
+ {% block content %}
6
+ <h1>Send Label Print Request</h1>
7
+ <ul>
8
+ <small><a href="/">home</a></small>
9
+ <hr>
10
+
11
+ <form id="myForm" action="/_print_label" method="get">
12
+ <ul>
13
+ <li>
14
+ <label>UID for Barcode:</label>
15
+ <input type="text" name="uid_barcode">
16
+ </li>
17
+ <li>
18
+ <label>ALT-A:</label>
19
+ <input type="text" name="alt_a">
20
+ </li>
21
+ <li>
22
+ <label>ALT-B:</label>
23
+ <input type="text" name="alt_b">
24
+ </li>
25
+ <li>
26
+ <label>ALT-C:</label>
27
+ <input type="text" name="alt_c">
28
+ </li>
29
+ <li>
30
+ <label>ALT-D:</label>
31
+ <input type="text" name="alt_d">
32
+ </li>
33
+ <li>
34
+ <label>ALT-E:</label>
35
+ <input type="text" name="alt_e">
36
+ </li>
37
+ <li>
38
+ <label>ALT-F:</label>
39
+ <input type="text" name="alt_f">
40
+ </li>
41
+ <li>
42
+ <label>Select Lab:</label>
43
+ <select id="labSelect" name="lab" onchange="updatePrinters()">
44
+ <option value="">Select a Lab</option>
45
+ {% for lab in labs %}
46
+ <option value="{{ lab }}">{{ lab }}</option>
47
+ {% endfor %}
48
+ </select>
49
+ </li>
50
+ <li>
51
+ <label>Select Printer:</label>
52
+ <select id="printerSelect" name="printer">
53
+ <option value="">Select a Printer</option>
54
+ </select>
55
+ </li>
56
+ <li>
57
+ <label>Label ZPL Style:</label>
58
+ <select name="label_zpl_style">
59
+ {% for template in templates %}
60
+ <option value="{{ template }}">{{ template }}</option>
61
+ {% endfor %}
62
+ </select>
63
+ </li>
64
+ </ul>
65
+ <br>
66
+ <input type="submit" value="Print Label">
67
+ </form>
68
+ </ul>
69
+ {% endblock %}
70
+
71
+ {% block extra_scripts %}
72
+ <script>
73
+ var labsAndPrinters = {{ labs_and_printers | safe }};
74
+
75
+ function updatePrinters() {
76
+ var labSelect = document.getElementById('labSelect');
77
+ var printerSelect = document.getElementById('printerSelect');
78
+ var selectedLab = labSelect.value;
79
+
80
+ // Clear current printer options
81
+ printerSelect.innerHTML = '<option value="">Select a Printer</option>';
82
+
83
+ if (selectedLab in labsAndPrinters) {
84
+ labsAndPrinters[selectedLab].forEach(function(printer) {
85
+ var option = document.createElement('option');
86
+ option.value = printer;
87
+ option.text = printer;
88
+ printerSelect.appendChild(option);
89
+ });
90
+ }
91
+ }
92
+ </script>
93
+ {% endblock %}
94
+
@@ -0,0 +1,29 @@
1
+ {% extends "base.html" %}
2
+
3
+ {% block title %}{{ title }}{% endblock %}
4
+
5
+ {% block content %}
6
+ <h1>View and Edit Printer Config JSON</h1>
7
+ <small><a href="/">home</a></small>
8
+ <hr>
9
+
10
+ {% if error_msg %}
11
+ <p style="color: red; font-weight: bold;">{{ error_msg }}</p>
12
+ {% endif %}
13
+
14
+ <form action="/save_pstation_json" method="post">
15
+ <textarea name="json_data" rows="45" cols="80">{{ config_data }}</textarea>
16
+ <br>
17
+ <input type="submit" value="Save New Printers Config JSON & Make Active">
18
+ </form>
19
+
20
+ <hr>
21
+ <ul>
22
+ <li><a href="/list_prior_printer_config_files">View backed up printers JSON config files</a></li>
23
+ <hr>
24
+ <li><a href="/reset_pstation_json">Restore Printer Settings From Default JSON (THIS WILL DELETE YOUR CURRENT FILE!)</a></li>
25
+ <hr>
26
+ <li><a href="/clear_printers_json">CLEAR contents of current printers.json file (This Cannot Be Undone)</a></li>
27
+ </ul>
28
+ {% endblock %}
29
+
@@ -0,0 +1,9 @@
1
+ """
2
+ zebra_day web application module.
3
+
4
+ FastAPI-based web interface for managing Zebra printers and label templates.
5
+ """
6
+ from zebra_day.web.app import create_app
7
+
8
+ __all__ = ["create_app"]
9
+