Skip to content

Commit e8b3d19

Browse files
committed
Merge branch 'feature' into feature-apiselect-queryparams
2 parents 89b7f3f + 58203db commit e8b3d19

30 files changed

+191
-110
lines changed

netbox/dcim/forms.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,6 +1738,9 @@ class FrontPortTemplateCreateForm(ComponentTemplateCreateForm):
17381738
choices=PortTypeChoices,
17391739
widget=StaticSelect()
17401740
)
1741+
color = ColorField(
1742+
required=False
1743+
)
17411744
rear_port_set = forms.MultipleChoiceField(
17421745
choices=[],
17431746
label='Rear ports',

netbox/dcim/tables/devices.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,10 @@ class ConsolePortTable(DeviceComponentTable, PathEndpointTable):
288288
class Meta(DeviceComponentTable.Meta):
289289
model = ConsolePort
290290
fields = (
291-
'pk', 'device', 'name', 'label', 'type', 'speed', 'description', 'mark_connected', 'cable', 'cable_color',
291+
'pk', 'name', 'device', 'label', 'type', 'speed', 'description', 'mark_connected', 'cable', 'cable_color',
292292
'cable_peer', 'connection', 'tags',
293293
)
294-
default_columns = ('pk', 'device', 'name', 'label', 'type', 'speed', 'description')
294+
default_columns = ('pk', 'name', 'device', 'label', 'type', 'speed', 'description')
295295

296296

297297
class DeviceConsolePortTable(ConsolePortTable):
@@ -332,10 +332,10 @@ class ConsoleServerPortTable(DeviceComponentTable, PathEndpointTable):
332332
class Meta(DeviceComponentTable.Meta):
333333
model = ConsoleServerPort
334334
fields = (
335-
'pk', 'device', 'name', 'label', 'type', 'speed', 'description', 'mark_connected', 'cable', 'cable_color',
335+
'pk', 'name', 'device', 'label', 'type', 'speed', 'description', 'mark_connected', 'cable', 'cable_color',
336336
'cable_peer', 'connection', 'tags',
337337
)
338-
default_columns = ('pk', 'device', 'name', 'label', 'type', 'speed', 'description')
338+
default_columns = ('pk', 'name', 'device', 'label', 'type', 'speed', 'description')
339339

340340

341341
class DeviceConsoleServerPortTable(ConsoleServerPortTable):
@@ -377,10 +377,10 @@ class PowerPortTable(DeviceComponentTable, PathEndpointTable):
377377
class Meta(DeviceComponentTable.Meta):
378378
model = PowerPort
379379
fields = (
380-
'pk', 'device', 'name', 'label', 'type', 'description', 'mark_connected', 'maximum_draw', 'allocated_draw',
380+
'pk', 'name', 'device', 'label', 'type', 'description', 'mark_connected', 'maximum_draw', 'allocated_draw',
381381
'cable', 'cable_color', 'cable_peer', 'connection', 'tags',
382382
)
383-
default_columns = ('pk', 'device', 'name', 'label', 'type', 'maximum_draw', 'allocated_draw', 'description')
383+
default_columns = ('pk', 'name', 'device', 'label', 'type', 'maximum_draw', 'allocated_draw', 'description')
384384

385385

386386
class DevicePowerPortTable(PowerPortTable):
@@ -428,10 +428,10 @@ class PowerOutletTable(DeviceComponentTable, PathEndpointTable):
428428
class Meta(DeviceComponentTable.Meta):
429429
model = PowerOutlet
430430
fields = (
431-
'pk', 'device', 'name', 'label', 'type', 'description', 'power_port', 'feed_leg', 'mark_connected', 'cable',
431+
'pk', 'name', 'device', 'label', 'type', 'description', 'power_port', 'feed_leg', 'mark_connected', 'cable',
432432
'cable_color', 'cable_peer', 'connection', 'tags',
433433
)
434-
default_columns = ('pk', 'device', 'name', 'label', 'type', 'power_port', 'feed_leg', 'description')
434+
default_columns = ('pk', 'name', 'device', 'label', 'type', 'power_port', 'feed_leg', 'description')
435435

436436

437437
class DevicePowerOutletTable(PowerOutletTable):
@@ -490,11 +490,11 @@ class InterfaceTable(DeviceComponentTable, BaseInterfaceTable, PathEndpointTable
490490
class Meta(DeviceComponentTable.Meta):
491491
model = Interface
492492
fields = (
493-
'pk', 'device', 'name', 'label', 'enabled', 'type', 'mgmt_only', 'mtu', 'mode', 'mac_address',
493+
'pk', 'name', 'device', 'label', 'enabled', 'type', 'mgmt_only', 'mtu', 'mode', 'mac_address',
494494
'description', 'mark_connected', 'cable', 'cable_color', 'cable_peer', 'connection', 'tags', 'ip_addresses',
495495
'untagged_vlan', 'tagged_vlans',
496496
)
497-
default_columns = ('pk', 'device', 'name', 'label', 'enabled', 'type', 'description')
497+
default_columns = ('pk', 'name', 'device', 'label', 'enabled', 'type', 'description')
498498

499499

500500
class DeviceInterfaceTable(InterfaceTable):
@@ -559,11 +559,11 @@ class FrontPortTable(DeviceComponentTable, CableTerminationTable):
559559
class Meta(DeviceComponentTable.Meta):
560560
model = FrontPort
561561
fields = (
562-
'pk', 'device', 'name', 'label', 'type', 'color', 'rear_port', 'rear_port_position', 'description',
562+
'pk', 'name', 'device', 'label', 'type', 'color', 'rear_port', 'rear_port_position', 'description',
563563
'mark_connected', 'cable', 'cable_color', 'cable_peer', 'tags',
564564
)
565565
default_columns = (
566-
'pk', 'device', 'name', 'label', 'type', 'color', 'rear_port', 'rear_port_position', 'description',
566+
'pk', 'name', 'device', 'label', 'type', 'color', 'rear_port', 'rear_port_position', 'description',
567567
)
568568

569569

@@ -610,10 +610,10 @@ class RearPortTable(DeviceComponentTable, CableTerminationTable):
610610
class Meta(DeviceComponentTable.Meta):
611611
model = RearPort
612612
fields = (
613-
'pk', 'device', 'name', 'label', 'type', 'color', 'positions', 'description', 'mark_connected', 'cable',
613+
'pk', 'name', 'device', 'label', 'type', 'color', 'positions', 'description', 'mark_connected', 'cable',
614614
'cable_color', 'cable_peer', 'tags',
615615
)
616-
default_columns = ('pk', 'device', 'name', 'label', 'type', 'color', 'description')
616+
default_columns = ('pk', 'name', 'device', 'label', 'type', 'color', 'description')
617617

618618

619619
class DeviceRearPortTable(RearPortTable):
@@ -662,8 +662,8 @@ class DeviceBayTable(DeviceComponentTable):
662662

663663
class Meta(DeviceComponentTable.Meta):
664664
model = DeviceBay
665-
fields = ('pk', 'device', 'name', 'label', 'status', 'installed_device', 'description', 'tags')
666-
default_columns = ('pk', 'device', 'name', 'label', 'status', 'installed_device', 'description')
665+
fields = ('pk', 'name', 'device', 'label', 'status', 'installed_device', 'description', 'tags')
666+
default_columns = ('pk', 'name', 'device', 'label', 'status', 'installed_device', 'description')
667667

668668

669669
class DeviceDeviceBayTable(DeviceBayTable):
@@ -708,10 +708,10 @@ class InventoryItemTable(DeviceComponentTable):
708708
class Meta(BaseTable.Meta):
709709
model = InventoryItem
710710
fields = (
711-
'pk', 'device', 'name', 'label', 'manufacturer', 'part_id', 'serial', 'asset_tag', 'description',
711+
'pk', 'name', 'device', 'label', 'manufacturer', 'part_id', 'serial', 'asset_tag', 'description',
712712
'discovered', 'tags',
713713
)
714-
default_columns = ('pk', 'device', 'name', 'label', 'manufacturer', 'part_id', 'serial', 'asset_tag')
714+
default_columns = ('pk', 'name', 'device', 'label', 'manufacturer', 'part_id', 'serial', 'asset_tag')
715715

716716

717717
class DeviceInventoryItemTable(InventoryItemTable):

netbox/ipam/forms.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ class Meta:
147147
fields = [
148148
'name', 'description', 'tenant_group', 'tenant', 'tags',
149149
]
150+
fieldsets = (
151+
('Route Target', ('name', 'description', 'tags')),
152+
('Tenancy', ('tenant_group', 'tenant')),
153+
)
150154

151155

152156
class RouteTargetCSVForm(CustomFieldModelCSVForm):
@@ -626,9 +630,8 @@ class PrefixFilterForm(BootstrapMixin, TenancyFilterForm, CustomFieldModelFilter
626630
model = Prefix
627631
field_groups = [
628632
['q', 'tag'],
629-
['within_include', 'family', 'status', 'role_id'],
633+
['within_include', 'family', 'status', 'role_id', 'mask_length', 'is_pool', 'mark_utilized'],
630634
['vrf_id', 'present_in_vrf_id'],
631-
['mask_length', 'is_pool', 'mark_utilized'],
632635
['region_id', 'site_group_id', 'site_id'],
633636
['tenant_group_id', 'tenant_id']
634637
]
@@ -1270,9 +1273,8 @@ class IPAddressFilterForm(BootstrapMixin, TenancyFilterForm, CustomFieldModelFil
12701273
]
12711274
field_groups = [
12721275
['q', 'tag'],
1273-
['parent', 'family', 'status', 'role'],
1276+
['parent', 'family', 'status', 'role', 'mask_length', 'assigned_to_interface'],
12741277
['vrf_id', 'present_in_vrf_id'],
1275-
['mask_length', 'assigned_to_interface'],
12761278
['tenant_group_id', 'tenant_id'],
12771279
]
12781280
q = forms.CharField(

netbox/ipam/tables.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ class VLANTable(BaseTable):
548548

549549
class Meta(BaseTable.Meta):
550550
model = VLAN
551-
fields = ('pk', 'vid', 'site', 'group', 'name', 'tenant', 'status', 'role', 'description')
551+
fields = ('pk', 'vid', 'name', 'site', 'group', 'tenant', 'status', 'role', 'description')
552552
row_attrs = {
553553
'class': lambda record: 'success' if not isinstance(record, VLAN) else '',
554554
}
@@ -566,8 +566,8 @@ class VLANDetailTable(VLANTable):
566566
)
567567

568568
class Meta(VLANTable.Meta):
569-
fields = ('pk', 'vid', 'site', 'group', 'name', 'prefixes', 'tenant', 'status', 'role', 'description', 'tags')
570-
default_columns = ('pk', 'vid', 'site', 'group', 'name', 'prefixes', 'tenant', 'status', 'role', 'description')
569+
fields = ('pk', 'vid', 'name', 'site', 'group', 'prefixes', 'tenant', 'status', 'role', 'description', 'tags')
570+
default_columns = ('pk', 'vid', 'name', 'site', 'group', 'prefixes', 'tenant', 'status', 'role', 'description')
571571

572572

573573
class VLANMembersTable(BaseTable):

netbox/project-static/dist/netbox-dark.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

netbox/project-static/dist/netbox-light.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

netbox/project-static/dist/netbox-print.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

netbox/project-static/styles/netbox.scss

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ table {
243243

244244
&.attr-table {
245245
th {
246+
font-weight: normal;
246247
width: 25%;
247248
}
248249
}
@@ -723,10 +724,6 @@ div.paginator > form > div.input-group {
723724
width: fit-content;
724725
}
725726

726-
div.field-group:not(:first-of-type) {
727-
margin-top: $spacer * 3;
728-
}
729-
730727
label.required {
731728
font-weight: $font-weight-bold;
732729

netbox/templates/circuits/circuit.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ <h5 class="card-header">
2424
</tr>
2525
<tr>
2626
<th scope="row">Circuit ID</th>
27-
<td><code>{{ object.cid }}</code></td>
27+
<td>{{ object.cid }}</td>
2828
</tr>
2929
<tr>
3030
<th scope="row">Type</th>

netbox/templates/circuits/circuittermination_edit.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{% block title %}{{ obj.circuit.provider }} {{ obj.circuit }} - Side {{ form.term_side.value }}{% endblock %}
66

77
{% block form %}
8-
<div class="field-group">
8+
<div class="field-group my-4">
99
<div class="row mb-2">
1010
<h5 class="offset-sm-3">Circuit Termination</h5>
1111
</div>
@@ -41,7 +41,7 @@ <h5 class="offset-sm-3">Circuit Termination</h5>
4141
</ul>
4242
</div>
4343
</div>
44-
<div class="tab-content p-0">
44+
<div class="tab-content p-0 border-0">
4545
<div class="tab-pane{% if not providernetwork_tab_active %} active{% endif %}" id="site">
4646
{% render_field form.region %}
4747
{% render_field form.site_group %}
@@ -53,7 +53,9 @@ <h5 class="offset-sm-3">Circuit Termination</h5>
5353
</div>
5454
{% endwith %}
5555
</div>
56-
<div class="field-group">
56+
<hr />
57+
58+
<div class="field-group my-4">
5759
<div class="row mb-2">
5860
<h5 class="offset-sm-3">Termination Details</h5>
5961
</div>

netbox/templates/circuits/inc/circuit_termination.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@
5454
{% endif %}
5555
<a href="{{ peer.get_absolute_url }}">{{ peer }}</a>
5656
{% endwith %}
57-
<div class="float-md-end mt-3 mt-md-0">
57+
<div class="mt-1">
5858
<a href="{% url 'circuits:circuittermination_trace' pk=termination.pk %}" class="btn btn-primary btn-sm lh-1" title="Trace">
59-
<i class="mdi mdi-transit-connection-variant" aria-hidden="true"></i>
59+
<i class="mdi mdi-transit-connection-variant" aria-hidden="true"></i> Trace
6060
</a>
6161
{% if perms.dcim.delete_cable %}
6262
<a href="{% url 'dcim:cable_delete' pk=termination.cable.pk %}?return_url={{ termination.circuit.get_absolute_url }}" title="Remove cable" class="btn btn-danger btn-sm lh-1">

netbox/templates/dcim/consoleserverport.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ <h5 class="card-header">
2727
</tr>
2828
<tr>
2929
<th scope="row">Type</th>
30-
<td>{{ object.get_type_display }}</td>
30+
<td>{{ object.get_type_display|placeholder }}</td>
3131
</tr>
3232
<tr>
33-
<td scope="row">Speed</td>
33+
<th scope="row">Speed</th>
3434
<td>{{ object.get_speed_display|placeholder }}</td>
3535
</tr>
3636
<tr>

netbox/templates/dcim/device_edit.html

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@
44
{% block form %}
55
{% render_errors form %}
66

7-
<div class="field-group">
7+
<div class="field-group my-4">
88
<div class="row mb-2">
99
<h5 class="offset-sm-3">Device</h5>
1010
</div>
1111
{% render_field form.name %}
1212
{% render_field form.device_role %}
1313
{% render_field form.tags %}
1414
</div>
15+
<hr />
1516

16-
<div class="field-group">
17+
<div class="field-group my-4">
1718
<div class="row mb-2">
1819
<h5 class="offset-sm-3">Hardware</h5>
1920
</div>
@@ -22,8 +23,9 @@ <h5 class="offset-sm-3">Hardware</h5>
2223
{% render_field form.serial %}
2324
{% render_field form.asset_tag %}
2425
</div>
26+
<hr />
2527

26-
<div class="field-group">
28+
<div class="field-group my-4">
2729
<div class="row mb-2">
2830
<h5 class="offset-sm-3">Location</h5>
2931
</div>
@@ -56,8 +58,9 @@ <h5 class="offset-sm-3">Location</h5>
5658
{% render_field form.position %}
5759
{% endif %}
5860
</div>
61+
<hr />
5962

60-
<div class="field-group">
63+
<div class="field-group my-4">
6164
<div class="row mb-2">
6265
<h5 class="offset-sm-3">Management</h5>
6366
</div>
@@ -68,38 +71,43 @@ <h5 class="offset-sm-3">Management</h5>
6871
{% render_field form.primary_ip6 %}
6972
{% endif %}
7073
</div>
74+
<hr />
7175

72-
<div class="field-group">
76+
<div class="field-group my-4">
7377
<div class="row mb-2">
7478
<h5 class="offset-sm-3">Virtualization</h5>
7579
</div>
7680
{% render_field form.cluster_group %}
7781
{% render_field form.cluster %}
7882
</div>
83+
<hr />
7984

80-
<div class="field-group">
85+
<div class="field-group my-4">
8186
<div class="row mb-2">
8287
<h5 class="offset-sm-3">Tenancy</h5>
8388
</div>
8489
{% render_field form.tenant_group %}
8590
{% render_field form.tenant %}
8691
</div>
92+
<hr />
8793

88-
{% if form.custom_fields %}
89-
<div class="field-group">
94+
{% if form.custom_fields %}
95+
<div class="field-group my-4">
9096
<div class="row mb-2">
9197
<h5 class="offset-sm-3">Custom Fields</h5>
9298
</div>
9399
{% render_custom_fields form %}
94-
</div>
100+
</div>
101+
<hr />
102+
{% endif %}
95103

96-
{% endif %}
97-
<div class="field-group">
104+
<div class="field-group my-4">
98105
<h5 class="text-center">Local Config Context Data</h5>
99106
{% render_field form.local_context_data %}
100107
</div>
108+
<hr />
101109

102-
<div class="field-group">
110+
<div class="field-group my-4">
103111
{% render_field form.comments label='Comments' %}
104112
</div>
105113

netbox/templates/dcim/inc/cable_form.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@
1616
</div>
1717
{% render_field form.tags %}
1818
{% if form.custom_fields %}
19+
<hr />
1920
<div class="field-group">
20-
<h4>Custom Fields</h4>
21-
{% render_custom_fields form %}
21+
<div class="row mb-2">
22+
<h5 class="offset-sm-3">Custom Fields</h5>
23+
</div>
24+
{% render_custom_fields form %}
2225
</div>
2326
{% endif %}

0 commit comments

Comments
 (0)