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

Feat Request: Print multiple QR Codes at once #1

Open
ndom91 opened this issue Sep 18, 2020 · 9 comments
Open

Feat Request: Print multiple QR Codes at once #1

ndom91 opened this issue Sep 18, 2020 · 9 comments
Labels
enhancement New feature or request

Comments

@ndom91
Copy link

ndom91 commented Sep 18, 2020

How about being able to print multiple QR Codes at once, like on a whole page of stickers?

Is this possible currently? If not, I'd be happy to help!

@k01ek
Copy link
Collaborator

k01ek commented Oct 12, 2020

Hi @ndom91! Sorry for late response, I have missed notification.
I was thinking about this functionality, but I did not want to complexify the plugin.
For this feature you need to add new view with new template or modify existing view or template.
Now I have no time for this work, so if you want to do this - welcome!

@ndom91
Copy link
Author

ndom91 commented Oct 12, 2020

Okay thanks for the feedback. I'll see what I can do ;)

@warriorsoul15
Copy link

Out of curiosity what is the intention of the Print function? does it setup to print to a particular label size or label printer at all?

@k01ek
Copy link
Collaborator

k01ek commented Mar 23, 2021

The goal of the print function is to provide the ability to run the print wizard directly from Netbox.

@LHBL2003
Copy link
Contributor

LHBL2003 commented May 18, 2022

Unfortunately, I'm not completely familiar with github. But do I understand correctly that the functions were never provided by Jasonlin1198?

I have no plugin menu etc. in Netbox (v3.2.2).

Also, the whole source code of Jasonlin1198 does not exist in the main version, if I see it correctly.

@LHBL2003
Copy link
Contributor

I have just seen that the marged on the branch develop has been executed.

So I never get it as a normal user during the installation.
When will the new features from last year be distributed to everyone? Or are there still problems with the things from Jasonlin1198?

@brandan-schmitz
Copy link

I am wondering upon the state of this? It seems that there was work put in originally, and that the feature got merged into the development branch in #16 however it has never been released. I would really like to see this added. I have over 170 racks that I need to print labels for, as well as over 2,000 cables and 500 devices and it is simply unrealistic to be able to do that one by one.

I feel like this should also take into consideration #43 as when we go to print these, we will likely be using label tape as well.

@LHBL2003
Copy link
Contributor

As far as I know, the branch is outdated and needs to be completely revised.

@FlorianHeigl
Copy link

I made an exemplary workflow (means, it is manually calling the steps and passing results, but each is pulling a datasource or processing without interventions) for printing to my Avery label printer. It has some ZPL bugs and one of them is I can't write QR codes, but it might still help some of you get a grip on either solving stuff themselves or finding a good path to revive this. I'd of course also hope for the latter.

I'll try to make some video example on the weeked, or since i'll probably be too exhausted anyway, here's the examples

infoset="hostname,IMM (IMM),switchstack:0,ge-0/0/23
hostname,pNIC1-Port1 (1),switchstack:0,ge-0/0/20
hostname,IMM (IMM),switchstack:0,ge-0/0/22
hostname,pNIC1-Port1 (1),switchstack:1,ge-1/0/22
hostname,pNIC1-Port2 (2),otherhostname,pNIC1-Port2
hostname,pNIC2-Port1 (1),otherhostnamepNIC2-Port1
hostname,pNIC2-Port2 (2),otherhostname,pNIC2-Port2"

# .[] | [.label, .a_terminations[0].object.device.name, .a_terminations[0].object.display, .b_terminations[0].object.device.name, .b_terminations[0].object.name]|  join(";")



OIFS=${IFS}
IFS=\,
echo "$infoset" |
while read _host _port _rhost _rport ; do
    if [ ${#_host} -gt 15 ]; then
        _host=${_host//[_-]/} 
        _host=${_host:0:6}?${_host: -16}
    fi
    if [ ${#_rhost} -gt 15 ]; then
        _rhost=${_rhost//[_-]/} 
        _rhost=${_rhost:0:6}?${_rhost: -16}
    fi
    echo "^XA

^FX Hostname, LAN Port ID
^CF0,30
^FO95,72^FD${_host}^FS
^CF0,25
^FO100,40^FD${_port}^FS


^FX Uplink Switch und Port
^CF0,30
^FO90,160^FWI^FD${_rhost}^FS
^CF0,25
^FO100,125^FD${_rport}^FS

^XZ"


done | /usr/local/bin/lprint -d avery -o print-speed=50mm -o print-quality=high -o print-content-optimize=graphic -o media=oe_cable-label_2.76x0.94in

notes

  • i had to find a way to shorten the 30 char hostnames of the switches (duh) and found that the least information was lost (due to locality in space where you read the label and the item referred to) is by cutting out some bits in the middle
  • the zpl code has some oddities due to my printer that has a different native protocol and has flaws in zpl parsing (i.e. i had to fip things that should not be flipped)
  • you can use any of the better online zpl generators to test making QR codes of this
  • the string output by # .[] | [.label, .a_terminations[0].object.device.name, .a_terminations[0].object.display, .b_terminations[0].object.device.name, .b_terminations[0].object.name]| join(";") is specifically intended to be that.
  • meaning you need to have a M:M match of this string in the netbox cable label and what you print in the visible text on the label
  • you can't survive (imo) with only the cable id from netbox
  • when playing around with QR codes, error tolerance settings etc, it does not(!) hurt to start by encoding images (i mean photography, clip art, memes etc)
  • i gathered the data using nbcli

none of this is to say I don't hope that netbox-qrcode sees a revival, I'm just trying to say 'if you're stuck with this and 2000 missing cable labels that you can't print and stick on as fast as they are missing, and so you never get a reference point where shit is right then PLEASE DO REMEMBER you can use CSV and pipe it into your label printer and you can create this bit of csv, too"

also, I use fs.com patch cables for a lot now with a usb barcode scanner, so i can at least feel safe in this limbo.

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

No branches or pull requests

6 participants