Skip to content

Commit c1e515a

Browse files
authored
Merge pull request #87 from martinum4/patch-1
Create simple_label
2 parents 60446e6 + 6520d71 commit c1e515a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{# This export template is intended to generate device-labels with a zpl-compatible printer without the need for a plugin.
2+
It is optimized for 203dpi and 2x1 inch label size, all positional pararmeters are dpi-dependend #}
3+
{% for device in queryset -%}
4+
^XA
5+
^CI28^FX UTF-8!
6+
^CF0,25
7+
^FO175,20^FD{{device.name}}^FS
8+
^CF0,15
9+
^FO175,50^FDIP/DNS: ^FS
10+
^CF0,20
11+
^FX //If there is no name use IP
12+
^FO175,70^FD{% if device.primary_ip.dns_name != ''%}{{device.primary_ip.dns_name}}{%else%}{{device.primary_ip}}{%endif%}^FS
13+
^CF0,15
14+
^FO175,155^FDID: {{device.id}}^FS
15+
^FX //Change the 15,10 (8 dots = 1mm on 203dpi) to position the label, change the 4 to change QR size
16+
^FO15,10^BQN,2,4^FDQA,https://demo.detbox.dev/dcim/devices/{{device.id}}/^FS
17+
^XZ
18+
{% endfor %}

0 commit comments

Comments
 (0)