From 6898ae7106d1e1b64e961474385bea67e3259389 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Thu, 14 Oct 2021 11:36:13 -0400 Subject: [PATCH 01/17] Fixes #7544: Fix multi-value filtering of custom field objects --- docs/release-notes/version-3.0.md | 4 ++++ netbox/extras/filtersets.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/version-3.0.md b/docs/release-notes/version-3.0.md index 25295b621..f0bb726d8 100644 --- a/docs/release-notes/version-3.0.md +++ b/docs/release-notes/version-3.0.md @@ -2,6 +2,10 @@ ## v3.0.8 (FUTURE) +### Bug Fixes + +* [#7544](https://github.com/netbox-community/netbox/issues/7544) - Fix multi-value filtering of custom field objects + --- ## v3.0.7 (2021-10-08) diff --git a/netbox/extras/filtersets.py b/netbox/extras/filtersets.py index 25fd32f0d..af8d904f4 100644 --- a/netbox/extras/filtersets.py +++ b/netbox/extras/filtersets.py @@ -15,6 +15,7 @@ from .models import * __all__ = ( 'ConfigContextFilterSet', 'ContentTypeFilterSet', + 'CustomFieldFilterSet', 'CustomLinkFilterSet', 'ExportTemplateFilterSet', 'ImageAttachmentFilterSet', @@ -47,7 +48,7 @@ class WebhookFilterSet(BaseFilterSet): ] -class CustomFieldFilterSet(django_filters.FilterSet): +class CustomFieldFilterSet(BaseFilterSet): content_types = ContentTypeFilter() class Meta: From b95773938d50acdb5404a63c346ca93bee5fdbb9 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Thu, 14 Oct 2021 12:24:29 -0400 Subject: [PATCH 02/17] Fixes #7534: Avoid exception when utilizing "create and add another" twice in succession --- docs/release-notes/version-3.0.md | 1 + netbox/netbox/views/generic.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/version-3.0.md b/docs/release-notes/version-3.0.md index f0bb726d8..4e7d19cdd 100644 --- a/docs/release-notes/version-3.0.md +++ b/docs/release-notes/version-3.0.md @@ -4,6 +4,7 @@ ### Bug Fixes +* [#7534](https://github.com/netbox-community/netbox/issues/7534) - Avoid exception when utilizing "create and add another" twice in succession * [#7544](https://github.com/netbox-community/netbox/issues/7544) - Fix multi-value filtering of custom field objects --- diff --git a/netbox/netbox/views/generic.py b/netbox/netbox/views/generic.py index 4baf2e0e9..75e978e2a 100644 --- a/netbox/netbox/views/generic.py +++ b/netbox/netbox/views/generic.py @@ -282,11 +282,11 @@ class ObjectEditView(GetReturnURLMixin, ObjectPermissionRequiredMixin, View): messages.success(request, mark_safe(msg)) if '_addanother' in request.POST: - redirect_url = request.get_full_path() + redirect_url = request.path # If the object has clone_fields, pre-populate a new instance of the form if hasattr(obj, 'clone_fields'): - redirect_url += f"{'&' if '?' in redirect_url else '?'}{prepare_cloned_fields(obj)}" + redirect_url += f"?{prepare_cloned_fields(obj)}" return redirect(redirect_url) From a7b6c40596fb1291243de8b5697cc1f7f24099e2 Mon Sep 17 00:00:00 2001 From: miaow2 Date: Thu, 14 Oct 2021 20:35:21 +0300 Subject: [PATCH 03/17] Fixing display of webhook types --- netbox/templates/extras/webhook.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox/templates/extras/webhook.html b/netbox/templates/extras/webhook.html index f1cf876c1..c92ec4c99 100644 --- a/netbox/templates/extras/webhook.html +++ b/netbox/templates/extras/webhook.html @@ -47,7 +47,7 @@ Update - {% if object.type_create %} + {% if object.type_update %} {% else %} @@ -57,7 +57,7 @@ Delete - {% if object.type_create %} + {% if object.type_delete %} {% else %} From e16942dea5d6f60f099b850c15d00c3f52898fd0 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Thu, 14 Oct 2021 13:44:54 -0400 Subject: [PATCH 04/17] Fixes #7529: Restore horizontal scrolling for tables in narrow viewports --- docs/release-notes/version-3.0.md | 2 + netbox/templates/inc/table.html | 68 ++++++++++++++++--------------- 2 files changed, 37 insertions(+), 33 deletions(-) diff --git a/docs/release-notes/version-3.0.md b/docs/release-notes/version-3.0.md index 4e7d19cdd..b49eb15ae 100644 --- a/docs/release-notes/version-3.0.md +++ b/docs/release-notes/version-3.0.md @@ -4,8 +4,10 @@ ### Bug Fixes +* [#7529](https://github.com/netbox-community/netbox/issues/7529) - Restore horizontal scrolling for tables in narrow viewports * [#7534](https://github.com/netbox-community/netbox/issues/7534) - Avoid exception when utilizing "create and add another" twice in succession * [#7544](https://github.com/netbox-community/netbox/issues/7544) - Fix multi-value filtering of custom field objects +* [#7545](https://github.com/netbox-community/netbox/issues/7545) - Fix incorrect display of update/delete events for webhooks --- diff --git a/netbox/templates/inc/table.html b/netbox/templates/inc/table.html index 3710af846..c38f50222 100644 --- a/netbox/templates/inc/table.html +++ b/netbox/templates/inc/table.html @@ -1,41 +1,43 @@ {% load django_tables2 %} - +
+ {% if table.show_header %} - - - {% for column in table.columns %} - {% if column.orderable %} - {{ column.header }} - {% else %} - {{ column.header }} - {% endif %} - {% endfor %} - - + + + {% for column in table.columns %} + {% if column.orderable %} + {{ column.header }} + {% else %} + {{ column.header }} + {% endif %} + {% endfor %} + + {% endif %} - {% for row in table.page.object_list|default:table.rows %} - - {% for column, cell in row.items %} - {{ cell }} - {% endfor %} - - {% empty %} - {% if table.empty_text %} - - — {{ table.empty_text }} — - - {% endif %} - {% endfor %} + {% for row in table.page.object_list|default:table.rows %} + + {% for column, cell in row.items %} + {{ cell }} + {% endfor %} + + {% empty %} + {% if table.empty_text %} + + — {{ table.empty_text }} — + + {% endif %} + {% endfor %} {% if table.has_footer %} - - - {% for column in table.columns %} - {{ column.footer }} - {% endfor %} - - + + + {% for column in table.columns %} + {{ column.footer }} + {% endfor %} + + {% endif %} - + +
From f1f0d9cd0d4b8098a9204a9de7061e5a5349ce47 Mon Sep 17 00:00:00 2001 From: thatmattlove Date: Fri, 15 Oct 2021 15:02:50 -0700 Subject: [PATCH 05/17] Fixes #7495: Fix sidenav overlapping elements --- docs/release-notes/version-3.0.md | 1 + netbox/project-static/dist/netbox-dark.css | Bin 788267 -> 788707 bytes netbox/project-static/dist/netbox-light.css | Bin 493227 -> 493565 bytes netbox/project-static/dist/netbox-print.css | Bin 1622455 -> 1623301 bytes netbox/project-static/dist/netbox.js | Bin 322556 -> 322534 bytes netbox/project-static/dist/netbox.js.map | Bin 310813 -> 310793 bytes netbox/project-static/src/sidenav.ts | 6 ++-- netbox/project-static/styles/sidenav.scss | 30 ++++++++++++++++++-- 8 files changed, 30 insertions(+), 7 deletions(-) diff --git a/docs/release-notes/version-3.0.md b/docs/release-notes/version-3.0.md index b49eb15ae..82770e856 100644 --- a/docs/release-notes/version-3.0.md +++ b/docs/release-notes/version-3.0.md @@ -4,6 +4,7 @@ ### Bug Fixes +* [#7495](https://github.com/netbox-community/netbox/issues/7495) - Fix navigation UI issue that caused improper element overlap * [#7529](https://github.com/netbox-community/netbox/issues/7529) - Restore horizontal scrolling for tables in narrow viewports * [#7534](https://github.com/netbox-community/netbox/issues/7534) - Avoid exception when utilizing "create and add another" twice in succession * [#7544](https://github.com/netbox-community/netbox/issues/7544) - Fix multi-value filtering of custom field objects diff --git a/netbox/project-static/dist/netbox-dark.css b/netbox/project-static/dist/netbox-dark.css index 48745de125ca9d55e5264e8424d5c1a17c8fba0d..4a6912458cc957244337335aac5de2cb0470ca60 100644 GIT binary patch delta 327 zcmZ48XYhEUK|>2;3sVbo3rh=Y3tJ0&3&$4D3E9&R%CL(}_ddYQKfS+$Q+fLRJWiqM zADTE>r}H;*vQ4)*z^#Ok*nTvd^EK0Sp5JUz(>c9Zd8hA?VV6}kG{`MhNKGtG)y>S) z%`YvnE-6aPE6yy*%+J$JNzF;Dw9+#yp6*!4sXJY+fKza~cLgiYbUAZQw(UImoRK2a z&7ZR=PZwz7)Pmc~I(>Hor|I&byPg;n5Auqw?fPQ~ITpra>$6a$;3w7tHCGlF$`P&vC0C(Inf V$&7ZY?E+n#K+LsWpo?3&763E?Z^{4w delta 122 zcmV-=0EPeKkua-{Fo1*sgaU*Egam{Iga(8Mgb1_=kZYF^p9>_H5N!z&w@PdY>jIZi zN(nKSkZ=hYx7%+CY!sI-fe94@EipBh(0B(Xm%xDu5|Wc}7>Wd1u>Wd5cd>*+hJ^%m! diff --git a/netbox/project-static/dist/netbox-light.css b/netbox/project-static/dist/netbox-light.css index 6ca1d7884d19cf22c2390e609cc385b786f53998..2c5aa81f04fc95fb043f2fe60980ed77e0c7c1b3 100644 GIT binary patch delta 305 zcmZ48EBCiwuAzmog{g(Pg=GtC+`j37Wh`RTuN-ETnEq!UD?f8`e%|zl8q5eGj_GIi zv5HLR?_*`#-o1~Nm1%lm8jIBQSuhujTE_Zc)L1J=dNu`y6^<>3fVHLQ2R;78x zsaPBUbm8=gXMi^3oo5x;-g|-d0JC&KKE#byML;)}WR|5`!%Q`7PrSmqJ@E>g*Cqgj Cymcx7 delta 120 zcmV-;0Ehqmj~=Uy9)N@agaU*Egaot&UcR@%z6CM@3}k6@aBN|DI&N=nWtV}z1rwKG z!UYMpc)#9m)ph#3YRO=1sb>f a(FL3Xlj0N=mr&LPB!}451-IDM1|_oDmM?z* diff --git a/netbox/project-static/dist/netbox-print.css b/netbox/project-static/dist/netbox-print.css index a159c81ec9a89b19b6db58d0ced00165e28fdcbe..741f7ea7431acdaa8bc82267f975768d3aae91c4 100644 GIT binary patch delta 545 zcmZvYO-lk{5XZ4v+g@CC$I1jliVhLRda#2+ht5&aCvdYR1aqTZ4`!gyRM4d@!NEgs z6wwP=kg!o+x^?sm)Hevab*ml|OUT0?o*DlCnR$NZdURtunneq?U@NvEhgNJy9y_oT zyRaK=D4-o3=tQvu_bIyb*j@BwfS-IB;K{fIj%Kc5Fuw}!-)e*$1?VJW4Q#Y?3Y;ZP zyM|?uDh3Svn1tJ}M2s}lm+%~%O*uBF6X-V@bvZnZB3BQ`u!}^Mx&|-Q_ zP52j-xSR@&1vEPTviH)_Ch%q@123aAeFj2K8nRO46vTW99Q1WjTkfULBHLoiHeQ>P zL~H(}(OLaNz1t))K@+!Z-p^2GJ*>WXlJ>z$*++(8{G1V~m%;i0e~w^n=34=TYQRgr zW9a{HtM&i9lWBEXj>hyqU1=Z_N+vX=2`a`iC-=MRR6O*410ISL ifiwGx;1p;s*e&KCz`HeD1|}C%4^uBwpE+B0FLK{0-^uO( delta 195 zcmZqeO5Wa_+|a_vzBG4k(BD6(#N9FYB z58|TJKU4|}PUo!_R+^S0%rV`dN?2e!kk`jL-Fd69!t{i4VXo;0&B8s~*EI?UYD-v` z6eZ>rr{x#rT7g+Pi6yBTx`w9H8$|iVrx$Dn8nX&$j6;<$|8}3X!Z#VG8|)C~+HSv5 l*nn^Pr8I7l>8C%6i?+|-FAT&YKn!Aw0kQb@`THf(SOL%mM=JmT diff --git a/netbox/project-static/dist/netbox.js b/netbox/project-static/dist/netbox.js index cc12e4855709dd686515e62961911c0a21a59033..6a60ff56def395459f1244adc618e97ed9a518a2 100644 GIT binary patch delta 28 kcmex!UHI8`;f5B*7N!>FEiC8nP5*e6MQ^+CeU_Iz0L$tPUjP6A delta 51 zcmaEMUHH#+;f5B*7N!>FEiC8n2^6Q6gk#=DVEdnY HEU$O~J*E{q diff --git a/netbox/project-static/dist/netbox.js.map b/netbox/project-static/dist/netbox.js.map index a67c6cbd814471217b565895629019f22877c9f2..ba7d8cd2f7dca3b93a9f961f1393011110461af4 100644 GIT binary patch delta 46 zcmV+}0MY-Q{1S=$5`csOgaU*Ev;<$cmu|QO90E^Nw~@F65di}^Q)rh@y95@uySW5n E1gd-y0{{R3 delta 60 zcmeDDBQ*DqP(ur23sVd87MA!OeBq9c;X0m { - this.bodyRemove('hide'); - this.bodyAdd('hidden'); - }, 300); + this.bodyRemove('hide'); + this.bodyAdd('hidden'); } } diff --git a/netbox/project-static/styles/sidenav.scss b/netbox/project-static/styles/sidenav.scss index ffc366c16..9dfdd855a 100644 --- a/netbox/project-static/styles/sidenav.scss +++ b/netbox/project-static/styles/sidenav.scss @@ -105,6 +105,11 @@ // Navbar brand .sidenav-brand { margin-right: 0; + transition: opacity 0.1s ease-in-out; + } + + .sidenav-brand-icon { + transition: opacity 0.1s ease-in-out; } .sidenav-inner { @@ -141,7 +146,17 @@ } .sidenav-toggle { - display: none; + // The sidenav toggle's default state is "hidden". Because modifying the `display` property + // isn't ideal for smooth transitions, combine opacity 0 (transparent) and position absolute + // to yield a similar result. + position: absolute; + display: inline-block; + opacity: 0; + // The transition itself is largely irrelevant, but CSS needs *something* to transition in + // order to apply a delay. + transition: opacity 10ms ease-in-out; + // Offset the transition delay so the icon isn't visible during the logo transition. + transition-delay: 0.1s; } .sidenav-collapse { @@ -350,13 +365,21 @@ .sidenav-brand { position: absolute; opacity: 0; - transform: translateX(-150%); } .sidenav-brand-icon { opacity: 1; } + .sidenav-toggle { + // Immediately hide the toggle when the sidenav is closed, so it doesn't linger and overlap + // with the logo elements. + opacity: 0; + position: absolute; + transition: unset; + transition-delay: 0ms; + } + .navbar-nav > .nav-item { > .nav-link { &:after { @@ -402,7 +425,8 @@ @include media-breakpoint-up(lg) { .sidenav-toggle { - display: inline-block; + position: relative; + opacity: 1; } } } From 84c14aadc7c9329a426e6598af55f6c61129b8e8 Mon Sep 17 00:00:00 2001 From: thatmattlove Date: Fri, 15 Oct 2021 17:07:54 -0700 Subject: [PATCH 06/17] Fixes #7300: Fix incorrect Device LLDP interface row coloring & improve related JS --- docs/release-notes/version-3.0.md | 1 + netbox/project-static/dist/lldp.js | Bin 109095 -> 109291 bytes netbox/project-static/dist/lldp.js.map | Bin 106320 -> 106584 bytes netbox/project-static/src/device/lldp.ts | 98 +++++++++++++++++------ 4 files changed, 74 insertions(+), 25 deletions(-) diff --git a/docs/release-notes/version-3.0.md b/docs/release-notes/version-3.0.md index 82770e856..70a9a0dac 100644 --- a/docs/release-notes/version-3.0.md +++ b/docs/release-notes/version-3.0.md @@ -4,6 +4,7 @@ ### Bug Fixes +* [#7300](https://github.com/netbox-community/netbox/issues/7300) - Fix incorrect Device LLDP interface row coloring * [#7495](https://github.com/netbox-community/netbox/issues/7495) - Fix navigation UI issue that caused improper element overlap * [#7529](https://github.com/netbox-community/netbox/issues/7529) - Restore horizontal scrolling for tables in narrow viewports * [#7534](https://github.com/netbox-community/netbox/issues/7534) - Avoid exception when utilizing "create and add another" twice in succession diff --git a/netbox/project-static/dist/lldp.js b/netbox/project-static/dist/lldp.js index 7fac1012a96c1fbfd21177b565f29c9a2cb3fe7c..2b3934742c7a3b9294c91b81efcf0817e51c021a 100644 GIT binary patch delta 6474 zcmZWu33wD$p8x)p1CaX&3E@hbCRRhG!yz(sY(kDs$bBb}5JGiz^^sJ%nyTt_I-Q6P z4sys5p2PD1Mg_%PXWYed?Ac{-U{&r{ur`na&dY8DIU@Y{X%l>)Ic>!6YB zVCLe;XP9iLC2ugRp@~dSnumxDe|yRLBsQ&9VI6)}5LsWg-5->sf=-2X>W?OkO@Si) z$mqkPphd5m^bREVdpQ^R=h20_XUfx~pj4lf`C)qUS}zwMwUcV}@+GI{LbE=pAu_h4 zSjboWR#jAdyyWW_?NvhTWQ~H|B?_`jY;GtomU{xSU-WBStzZ}ZKSM+0bjMv#OvbI> zI5{L(IK}R_#wQO9G?HEGj}+7hteaCTmccx3S{1nuAITT!pN4OLeb2~*=3kO8mouy^lP5xkyQ&da^n$3YY$D>^g z=HHY~AJKY$4>kINP&q&e`PT#Kp~W574} zd|=cvi>(3eyr7$Wylp0|CMnyuBGxkX(vm$!`y4lUEO9pojkLz$37hL=M`>vBML{akQZ~ z4(2kr?LQv703Q9_#|vS!Byxh^Vv|Vrp~d+B9uhGus+dX9Gp3?b*dG+vbpi=idITc`|9(gLy z_&jrD=NKp>D~__al_`Ukm;%?3?xV|ZTQf}7>%Tqf0;ty~>l0yKn_^!q-pN%MpQT*4 z&u-Eb-mm%$R~7v(6Q`-9_<0rD^yu@C1Bhhp3!gxRUJ}g%MpO0RA2O1_M|K@MhQAem z{0KyS>G9bBep3Hpx=B{;dF!m!1$mr;Et_qfYoR%hEArXV;n(`@i#e5Se{nJJ`X66B zYshWrWH$)<^^*%3#4In*hjhQnnM@csU3R5FP%&_bTuhqcD<7khYfn8rT8@q2RQ<3~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}dxYrFEGWtinynLFQ;~oESUGm4KO)=1@M5A*qKj&tv$32N_^h_N? iUFe$idZ``!{_otHdvK5H&H<%BsyLtw!K-~SZSxIf)Oc3_ diff --git a/netbox/project-static/src/device/lldp.ts b/netbox/project-static/src/device/lldp.ts index 6baaa9b38..ebf71138c 100644 --- a/netbox/project-static/src/device/lldp.ts +++ b/netbox/project-static/src/device/lldp.ts @@ -1,6 +1,17 @@ import { createToast } from '../bs'; import { getNetboxData, apiGetBase, hasError, isTruthy, toggleLoader } from '../util'; +// Match an interface name that begins with a capital letter and is followed by at least one other +// alphabetic character, and ends with a forward-slash-separated numeric sequence such as 0/1/2. +const CISCO_IOS_PATTERN = new RegExp(/^([A-Z][A-Za-z]+)[^0-9]*([0-9/]+)$/); + +// Mapping of overrides to default Cisco IOS interface alias behavior (default behavior is to use +// the first two characters). +const CISCO_IOS_OVERRIDES = new Map([ + // Cisco IOS abbreviates 25G (TwentyFiveGigE) interfaces as 'Twe'. + ['TwentyFiveGigE', 'Twe'], +]); + /** * Get an attribute from a row's cell. * @@ -12,6 +23,40 @@ function getData(row: HTMLTableRowElement, query: string, attr: string): string return row.querySelector(query)?.getAttribute(attr) ?? null; } +/** + * Get preconfigured alias for given interface. Primarily for matching long-form Cisco IOS + * interface names with short-form Cisco IOS interface names. For example, `GigabitEthernet0/1/2` + * would become `Gi0/1/2`. + * + * This should probably be replaced with something in the primary application (Django), such as + * a database field attached to given interface types. However, this is a temporary measure to + * replace the functionality of this one-liner: + * + * @see https://github.com/netbox-community/netbox/blob/9cc4992fad2fe04ef0211d998c517414e8871d8c/netbox/templates/dcim/device/lldp_neighbors.html#L69 + * + * @param name Long-form/original interface name. + */ +function getInterfaceAlias(name: string | null): string | null { + if (name === null) { + return name; + } + if (name.match(CISCO_IOS_PATTERN)) { + // Extract the base name and numeric portions of the interface. For example, an input interface + // of `GigabitEthernet0/0/1` would result in an array of `['GigabitEthernet', '0/0/1']`. + const [base, numeric] = (name.match(CISCO_IOS_PATTERN) ?? []).slice(1, 3); + + if (isTruthy(base) && isTruthy(numeric)) { + // Check the override map and use its value if the base name is present in the map. + // Otherwise, use the first two characters of the base name. For example, + // `GigabitEthernet0/0/1` would become `Gi0/0/1`, but `TwentyFiveGigE0/0/1` would become + // `Twe0/0/1`. + const aliasBase = CISCO_IOS_OVERRIDES.get(base) || base.slice(0, 2); + return `${aliasBase}${numeric}`; + } + } + return name; +} + /** * Update row styles based on LLDP neighbor data. */ @@ -23,38 +68,41 @@ function updateRowStyle(data: LLDPNeighborDetail) { if (row !== null) { for (const neighbor of neighbors) { - const cellDevice = row.querySelector('td.device'); - const cellInterface = row.querySelector('td.interface'); - const cDevice = getData(row, 'td.configured_device', 'data'); - const cChassis = getData(row, 'td.configured_chassis', 'data-chassis'); - const cInterface = getData(row, 'td.configured_interface', 'data'); + const deviceCell = row.querySelector('td.device'); + const interfaceCell = row.querySelector('td.interface'); + const configuredDevice = getData(row, 'td.configured_device', 'data'); + const configuredChassis = getData(row, 'td.configured_chassis', 'data-chassis'); + const configuredIface = getData(row, 'td.configured_interface', 'data'); - let cInterfaceShort = null; - if (isTruthy(cInterface)) { - cInterfaceShort = cInterface.replace(/^([A-Z][a-z])[^0-9]*([0-9/]+)$/, '$1$2'); + const interfaceAlias = getInterfaceAlias(configuredIface); + + const remoteName = neighbor.remote_system_name ?? ''; + const remotePort = neighbor.remote_port ?? ''; + const [neighborDevice] = remoteName.split('.'); + const [neighborIface] = remotePort.split('.'); + + if (deviceCell !== null) { + deviceCell.innerText = neighborDevice; } - const nHost = neighbor.remote_system_name ?? ''; - const nPort = neighbor.remote_port ?? ''; - const [nDevice] = nHost.split('.'); - const [nInterface] = nPort.split('.'); - - if (cellDevice !== null) { - cellDevice.innerText = nDevice; + if (interfaceCell !== null) { + interfaceCell.innerText = neighborIface; } - if (cellInterface !== null) { - cellInterface.innerText = nInterface; - } + // Interface has an LLDP neighbor, but the neighbor is not configured in NetBox. + const nonConfiguredDevice = !isTruthy(configuredDevice) && isTruthy(neighborDevice); - if (!isTruthy(cDevice) && isTruthy(nDevice)) { + // NetBox device or chassis matches LLDP neighbor. + const validNode = + configuredDevice === neighborDevice || configuredChassis === neighborDevice; + + // NetBox configured interface matches LLDP neighbor interface. + const validInterface = + configuredIface === neighborIface || interfaceAlias === neighborIface; + + if (nonConfiguredDevice) { row.classList.add('info'); - } else if ( - (cDevice === nDevice || cChassis === nDevice) && - cInterfaceShort === nInterface - ) { - row.classList.add('success'); - } else if (cDevice === nDevice || cChassis === nDevice) { + } else if (validNode && validInterface) { row.classList.add('success'); } else { row.classList.add('danger'); From 811c21ec7e57575390f86bb1a146a5304371aad2 Mon Sep 17 00:00:00 2001 From: thatmattlove Date: Fri, 15 Oct 2021 17:21:36 -0700 Subject: [PATCH 07/17] Minor Style Improvement: Add vertical spacing to Device Type component navigation & fix inconsistent component active color --- netbox/project-static/dist/netbox-dark.css | Bin 788707 -> 788707 bytes netbox/project-static/styles/theme-dark.scss | 1 + netbox/templates/dcim/devicetype.html | 2 +- 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/netbox/project-static/dist/netbox-dark.css b/netbox/project-static/dist/netbox-dark.css index 4a6912458cc957244337335aac5de2cb0470ca60..4bdce502af23e8d6896603b8f092ac2ba0aec533 100644 GIT binary patch delta 115 zcmaDn(ctk!gN7Ey7N!>F7M3lniP_UVMHpqK-*;zJnI4eI%CdcFHtRCa=@QnAVv`$A zNP{J|FWAaj9EB=2y?~dEfBFXjHsk3NF7M3lniP_U5`x(V2H(X+!e&3x@WqLp+E6et!*{sVvCr8MM zO>Q_L4Hn_E%`#GF9PwSA8OxB3qN DS9dFR diff --git a/netbox/project-static/styles/theme-dark.scss b/netbox/project-static/styles/theme-dark.scss index c7c0cd76e..c5fb5dcf1 100644 --- a/netbox/project-static/styles/theme-dark.scss +++ b/netbox/project-static/styles/theme-dark.scss @@ -74,6 +74,7 @@ $btn-link-disabled-color: $gray-300; // Forms $component-active-bg: $primary; +$component-active-color: $black; $form-text-color: $text-muted; $input-bg: $gray-900; $input-disabled-bg: $gray-700; diff --git a/netbox/templates/dcim/devicetype.html b/netbox/templates/dcim/devicetype.html index 2a9f4a93b..bb5743ace 100644 --- a/netbox/templates/dcim/devicetype.html +++ b/netbox/templates/dcim/devicetype.html @@ -137,7 +137,7 @@
-
{{ block.super }} {% endblock %} From 96015aa59031bbbb96b1ef634c684c52d0ac2e83 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Tue, 19 Oct 2021 15:31:07 -0400 Subject: [PATCH 12/17] Fixes #7582: Fix rendering of CustomLink context data table --- docs/customization/custom-links.md | 1 - mkdocs.yml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 docs/customization/custom-links.md diff --git a/docs/customization/custom-links.md b/docs/customization/custom-links.md deleted file mode 100644 index 1ee366cfd..000000000 --- a/docs/customization/custom-links.md +++ /dev/null @@ -1 +0,0 @@ -{!models/extras/customlink.md!} diff --git a/mkdocs.yml b/mkdocs.yml index 7244c36d6..d12ef734f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -65,7 +65,7 @@ nav: - Customization: - Custom Fields: 'customization/custom-fields.md' - Custom Validation: 'customization/custom-validation.md' - - Custom Links: 'customization/custom-links.md' + - Custom Links: 'models/extras/customlink.md' - Export Templates: 'customization/export-templates.md' - Custom Scripts: 'customization/custom-scripts.md' - Reports: 'customization/reports.md' From 39430e01de814ef21ea7dc71f6f84cc3776e771f Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Tue, 19 Oct 2021 15:41:19 -0400 Subject: [PATCH 13/17] Fixes #7550: Fix rendering of UTF8-encoded data in change records --- docs/release-notes/version-3.0.md | 1 + netbox/templates/extras/objectchange.html | 10 +++++----- netbox/utilities/templatetags/helpers.py | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/release-notes/version-3.0.md b/docs/release-notes/version-3.0.md index 77da55606..9497f1c7a 100644 --- a/docs/release-notes/version-3.0.md +++ b/docs/release-notes/version-3.0.md @@ -10,6 +10,7 @@ * [#7534](https://github.com/netbox-community/netbox/issues/7534) - Avoid exception when utilizing "create and add another" twice in succession * [#7544](https://github.com/netbox-community/netbox/issues/7544) - Fix multi-value filtering of custom field objects * [#7545](https://github.com/netbox-community/netbox/issues/7545) - Fix incorrect display of update/delete events for webhooks +* [#7550](https://github.com/netbox-community/netbox/issues/7550) - Fix rendering of UTF8-encoded data in change records * [#7556](https://github.com/netbox-community/netbox/issues/7556) - Fix display of version when new release is available * [#7584](https://github.com/netbox-community/netbox/issues/7584) - Fix alignment of object identifier under object view diff --git a/netbox/templates/extras/objectchange.html b/netbox/templates/extras/objectchange.html index b7bc12446..e8d72810e 100644 --- a/netbox/templates/extras/objectchange.html +++ b/netbox/templates/extras/objectchange.html @@ -130,12 +130,12 @@
{% if object.postchange_data %} -
{% for k, v in object.postchange_data.items %}{% spaceless %}
-                    {{ k }}: {{ v|render_json }}
-                    {% endspaceless %}{% endfor %}
-                
+
{% for k, v in object.postchange_data.items %}{% spaceless %}
+                        {{ k }}: {{ v|render_json }}
+                        {% endspaceless %}{% endfor %}
+                    
{% else %} - None + None {% endif %}
diff --git a/netbox/utilities/templatetags/helpers.py b/netbox/utilities/templatetags/helpers.py index a900d59e2..1695c8257 100644 --- a/netbox/utilities/templatetags/helpers.py +++ b/netbox/utilities/templatetags/helpers.py @@ -58,7 +58,7 @@ def render_json(value): """ Render a dictionary as formatted JSON. """ - return json.dumps(value, indent=4, sort_keys=True) + return json.dumps(value, ensure_ascii=False, indent=4, sort_keys=True) @register.filter() From eb4b4a6c8d238530e51df7455a179e404404ab90 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Tue, 19 Oct 2021 15:51:39 -0400 Subject: [PATCH 14/17] Closes #7561: Add a utilization column to the IP ranges table --- docs/release-notes/version-3.0.md | 4 ++++ netbox/ipam/tables/ip.py | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/docs/release-notes/version-3.0.md b/docs/release-notes/version-3.0.md index 9497f1c7a..f27a23f2c 100644 --- a/docs/release-notes/version-3.0.md +++ b/docs/release-notes/version-3.0.md @@ -2,6 +2,10 @@ ## v3.0.8 (FUTURE) +### Enhancements + +* [#7561](https://github.com/netbox-community/netbox/issues/7561) - Add a utilization column to the IP ranges table + ### Bug Fixes * [#7300](https://github.com/netbox-community/netbox/issues/7300) - Fix incorrect Device LLDP interface row coloring diff --git a/netbox/ipam/tables/ip.py b/netbox/ipam/tables/ip.py index 485e4a123..ddad6c573 100644 --- a/netbox/ipam/tables/ip.py +++ b/netbox/ipam/tables/ip.py @@ -260,11 +260,16 @@ class IPRangeTable(BaseTable): linkify=True ) tenant = TenantColumn() + utilization = UtilizationColumn( + accessor='utilization', + orderable=False + ) class Meta(BaseTable.Meta): model = IPRange fields = ( 'pk', 'start_address', 'end_address', 'size', 'vrf', 'status', 'role', 'tenant', 'description', + 'utilization', ) default_columns = ( 'pk', 'start_address', 'end_address', 'size', 'vrf', 'status', 'role', 'tenant', 'description', From 73f2f9fc6375e7a6d97d5a776dcb7775eec9006e Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Tue, 19 Oct 2021 15:57:02 -0400 Subject: [PATCH 15/17] Closes #7551: Add UI field to filter interfaces by kind --- docs/release-notes/version-3.0.md | 1 + netbox/dcim/choices.py | 12 ++++++++++++ netbox/dcim/forms/filtersets.py | 7 ++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/version-3.0.md b/docs/release-notes/version-3.0.md index f27a23f2c..d50c511b5 100644 --- a/docs/release-notes/version-3.0.md +++ b/docs/release-notes/version-3.0.md @@ -4,6 +4,7 @@ ### Enhancements +* [#7551](https://github.com/netbox-community/netbox/issues/7551) - Add UI field to filter interfaces by kind * [#7561](https://github.com/netbox-community/netbox/issues/7561) - Add a utilization column to the IP ranges table ### Bug Fixes diff --git a/netbox/dcim/choices.py b/netbox/dcim/choices.py index acea294f8..2f6228751 100644 --- a/netbox/dcim/choices.py +++ b/netbox/dcim/choices.py @@ -685,6 +685,18 @@ class PowerOutletFeedLegChoices(ChoiceSet): # Interfaces # +class InterfaceKindChoices(ChoiceSet): + KIND_PHYSICAL = 'physical' + KIND_VIRTUAL = 'virtual' + KIND_WIRELESS = 'wireless' + + CHOICES = ( + (KIND_PHYSICAL, 'Physical'), + (KIND_VIRTUAL, 'Virtual'), + (KIND_WIRELESS, 'Wireless'), + ) + + class InterfaceTypeChoices(ChoiceSet): # Virtual diff --git a/netbox/dcim/forms/filtersets.py b/netbox/dcim/forms/filtersets.py index 95ff9aa3d..4ef53c469 100644 --- a/netbox/dcim/forms/filtersets.py +++ b/netbox/dcim/forms/filtersets.py @@ -957,9 +957,14 @@ class InterfaceFilterForm(DeviceComponentFilterForm): model = Interface field_groups = [ ['q', 'tag'], - ['name', 'label', 'type', 'enabled', 'mgmt_only', 'mac_address'], + ['name', 'label', 'kind', 'type', 'enabled', 'mgmt_only', 'mac_address'], ['region_id', 'site_group_id', 'site_id', 'location_id', 'device_id'], ] + kind = forms.MultipleChoiceField( + choices=InterfaceKindChoices, + required=False, + widget=StaticSelectMultiple() + ) type = forms.MultipleChoiceField( choices=InterfaceTypeChoices, required=False, From fc5a23cc88f04dcfea756b2a761df70a89487692 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Wed, 20 Oct 2021 09:31:12 -0400 Subject: [PATCH 16/17] Release v3.0.8 --- .github/ISSUE_TEMPLATE/bug_report.yaml | 2 +- .github/ISSUE_TEMPLATE/feature_request.yaml | 2 +- docs/release-notes/version-3.0.md | 2 +- netbox/netbox/settings.py | 2 +- requirements.txt | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 2a1ecd5d0..318a9b7ad 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -17,7 +17,7 @@ body: What version of NetBox are you currently running? (If you don't have access to the most recent NetBox release, consider testing on our [demo instance](https://demo.netbox.dev/) before opening a bug report to see if your issue has already been addressed.) - placeholder: v3.0.7 + placeholder: v3.0.8 validations: required: true - type: dropdown diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index 6a3f81e1e..be89acfad 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -14,7 +14,7 @@ body: attributes: label: NetBox version description: What version of NetBox are you currently running? - placeholder: v3.0.7 + placeholder: v3.0.8 validations: required: true - type: dropdown diff --git a/docs/release-notes/version-3.0.md b/docs/release-notes/version-3.0.md index d50c511b5..83299dc86 100644 --- a/docs/release-notes/version-3.0.md +++ b/docs/release-notes/version-3.0.md @@ -1,6 +1,6 @@ # NetBox v3.0 -## v3.0.8 (FUTURE) +## v3.0.8 (2021-10-20) ### Enhancements diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index 3df9a855a..515ca5709 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -16,7 +16,7 @@ from django.core.validators import URLValidator # Environment setup # -VERSION = '3.0.8-dev' +VERSION = '3.0.8' # Hostname HOSTNAME = platform.node() diff --git a/requirements.txt b/requirements.txt index 8aa3b8a5c..7cad262b7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,11 +18,11 @@ gunicorn==20.1.0 Jinja2==3.0.2 Markdown==3.3.4 markdown-include==0.6.0 -mkdocs-material==7.3.2 +mkdocs-material==7.3.4 netaddr==0.8.0 -Pillow==8.3.2 +Pillow==8.4.0 psycopg2-binary==2.9.1 -PyYAML==5.4.1 +PyYAML==6.0 svgwrite==1.4.1 tablib==3.0.0 From 090df051934c88a0ed118694e082afb540b5bb4e Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Wed, 20 Oct 2021 09:59:33 -0400 Subject: [PATCH 17/17] PRVB --- docs/release-notes/version-3.0.md | 4 ++++ netbox/netbox/settings.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/version-3.0.md b/docs/release-notes/version-3.0.md index 83299dc86..69d8b8456 100644 --- a/docs/release-notes/version-3.0.md +++ b/docs/release-notes/version-3.0.md @@ -1,5 +1,9 @@ # NetBox v3.0 +## v3.0.9 (FUTURE) + +--- + ## v3.0.8 (2021-10-20) ### Enhancements diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index 515ca5709..35e0c6714 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -16,7 +16,7 @@ from django.core.validators import URLValidator # Environment setup # -VERSION = '3.0.8' +VERSION = '3.0.9-dev' # Hostname HOSTNAME = platform.node()