-
Notifications
You must be signed in to change notification settings - Fork 31
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
TEXT_FIELDS #42
Comments
you can use this fields:
|
Hello, I'm confused here. You state 'a_terminations.device' where the Install process of the plugin says: {'text_fields': ['_termination_a_device', 'termination_a', '_termination_b_device', 'termination_b',]} |
You can use only text fields of object. Role, location, site, tenant are not text fields, this fields are Object type. If you need those fields you can use text_template: |
Hmmm I'm sorry I'm absolutely new to J2 and so still can't understand yet all the things about it. I tried, lets take an example for the site:
But can't get the data I only have that rack name on it even if I didn't put the name object on my text_templates. Also I put 'text_template' in the rack sub-bracket and in the root netbox-qrcode bracket (not in the same time, I commented one while using the other one) but still I only got the rack name... I am obviously doing something wrong but can't get what... (sorry I'm temporarily in japan due to time zone I may reply late) That's my whole plugin config: 'netbox-qrcode': {
'with_text': True,
# 'text_fields': ['name', 'serial'],
# 'text_template': '{{ obj.site }}',
# 'font': 'CourierNewBold',
'font': 'ComicSanMS',
'custom_text': 'Property of someOne\nTel: +aCertainNumber',
'text_location': 'up',
'qr_version': 1,
'qr_error_correction': 2,
'qr_box_size': 6,
'qr_border': 4,
'cable': {
'text_fileds': [
'id',
'label',
'_termination_a_device',
'termination_a',
'_termination_b_device',
'termination_b'
]
},
# 'rack': {
# 'text_template': '{{ obj.name }} {{ obj.role }} {{ obj.location }} {{ obj.site }} {{ obj.tenant }}'
# 'text_template': '{{ obj.site }}'
# 'text_template': '{{ dcim.site }}'
# },
'device': {
'text_fields': [
'name',
'ip_address',
'role',
'manufacturer',
'type',
'rack',
'location',
'site',
'tenant'
]
}
} |
I don't know what are you doing wrong, but its work for me: |
I backed up my conf and imported yours to try it. Do I need to do something else than modifying the configuration.py and restart the netbox service? |
PLUGINS_CONFIG = { |
PLUGINS_CONFIG = { |
I feel stupid now. That was the things... Thank you very much for your time and your eyes. Have a nice day/evening. |
I was wrong, you also can use this fields if they can be represented as string |
Oh you're right I used text_template on rack and text_fields on location and both worked. I am wondering how to name things like "Rack Role" or "Tenant Group". Maybe plurial? In "groups"? Edit1: I tried with combination of no char, a dot, a hypen and a underscore and each of them with one then the other then both in plurial (tenants group / tenant groups / tenants groups). My next move is to try them in text_template instead of text_fields.
EDIT2: BINGO |
hi guys apologies if I missed the answer- In the devices category I have a network switch, and in netbox under the management heading there are status role platform etc, and what I want to place next to the barcode is the Primary IPv4 ipaddress. Any idea if I can display that? |
If you are in text_fields you should be able to use "ip_address". |
thank you for such a fast reply! I tried both those options to no avail. using text template I can display out everything except ip address. Could it matter that primary ip is associated with a vlan? |
Hmm I wonder... I will be able to test it today and give you an answer. But when I tried in Aug I created the whole chain and so my IP had a VLAN. |
I agree with you. |
ok thank you for confirming! was also working on the links feature and there it would only accept object spelled out and not obj- but that has also changed over time. This is all quite confusing for a beginner to be sure. Anyway if anyone knows of a way to get the primary ip next to a device barcode please chime in |
Raah I tried really lots of combination and still can't figure out the ipv4... I even tried from this other issue |
Hi, i have the same problem when I try to use cables, it won't show Termination A and Termination B on the QR-CODE, just the QR-CODE itself, Rack, devices work just fine. but the cable, just the QR-CODE with a sample text that i used.
Update: I figure it out how to do something useful now i can put this on the cable to trace it |
Does not generate qr code for cables, no error log. SETTINGS: |
Can you explain how it was resolved? Can you share your file with config? |
I'm having trouble finding the text_fields to customize the labels in the cables section.
I'm not able to pull device A or B, only the ports.
'cable': {
'text_fields':['a_terminations', 'a_device', 'b_terminations', ''],
},
Is there any library to fetch these text fields?
The text was updated successfully, but these errors were encountered: