Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML template not working anymore #94

Open
StvGdsn opened this issue Feb 10, 2025 · 0 comments
Open

HTML template not working anymore #94

StvGdsn opened this issue Feb 10, 2025 · 0 comments

Comments

@StvGdsn
Copy link

StvGdsn commented Feb 10, 2025

After upgrading from version 0.0.11 on netbox v3.7.5 to 0.0.16 on V4.2.3 my HTML label design stopped working

I configured in V0.0.11 this code and was working well:

'device': {
    'title': 'Wifi label',
    'with_qr': False,
    'url_template': '{{ obj.cf.default_qr_code }}',
    'text_align_horizontal': 'center',
    'text_align_vertical': 'middle',
    'text_template':   

'<style>.columns { display: flex; justify-content: space-between; align-items: center; } .column { padding: 0 2mm; } .column.column-2 { flex: 2; text-align: right; padding-right: 2mm; } .column.column-3 { text-align: left; padding-left: 2mm; flex: 2; } .column.column-4 { flex: 1; text-align: center; } .logo { display: inline-block; height: 18mm; width: 20mm; } .qr-code { display: inline-block; height: 16mm; width: 16mm; } .row p { margin-bottom: 0.5mm; } .row { margin-bottom: 0.5mm; } .column p { margin: 0; padding: 0; font-size: 14px; }</style>'

'<p style="font-size: 18px; margin-bottom: 0.5mm; text-align: center;">To configure this device, surf to http://some link here</p><br>'

'<div class="row"><div class="columns" style="display: flex; justify-content: space-between; margin-bottom: 1mm;">'
'<div class="column" style="text-align: center;"><div class="logo"><img src="/static/icon.png" height="100%" width="100%"></div></div>'
'<div class="column column-2"><p><strong>Router login:</strong></p><p><strong>Default wifi:</strong></p><p><strong>Password:</strong></p></div>'
'<div class="column column-3"><p>user</p><p>{{ obj.cf.default_wifi }}</p><p>{{ obj.cf.default_password }}</p></div>'
'<div class="column column-4"><div class="qr-code"><img src="data:image/png;base64,{{qrCode}}" height="100%" width="100%"/></div></div>'
'</div></div><br>'

'<p style="font-size: 14px; margin-top: 0.5mm; text-align: center; line-height: 1.2;"><strong>Need assistance?</strong>  some text here</p>'
,
                   
    'label_width': '105mm',
    'label_height': '43mm',
    'label_edge_top': '0mm',
    'label_edge_left': '0mm',
    'label_edge_right': '0mm',`

after the upgrade to 0.0.16 and NB V4.2.3 i only get 505 and 504 errors,
if i delete all this and use the default it works exept the 'url_template': '{{ obj.cf.default_qr_code }}',

does anyone have any ideas?

i tried downgrading to 0.0.11 but that doesnt work either

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant