1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Misc UI cleanup ahead of v3.0 release

This commit is contained in:
jeremystretch
2021-08-25 13:50:59 -04:00
parent 2fb1d388e3
commit 99cba25108
10 changed files with 23 additions and 18 deletions

View File

@ -1738,6 +1738,9 @@ class FrontPortTemplateCreateForm(ComponentTemplateCreateForm):
choices=PortTypeChoices, choices=PortTypeChoices,
widget=StaticSelect() widget=StaticSelect()
) )
color = ColorField(
required=False
)
rear_port_set = forms.MultipleChoiceField( rear_port_set = forms.MultipleChoiceField(
choices=[], choices=[],
label='Rear ports', label='Rear ports',

View File

@ -147,6 +147,10 @@ class RouteTargetForm(BootstrapMixin, TenancyForm, CustomFieldModelForm):
fields = [ fields = [
'name', 'description', 'tenant_group', 'tenant', 'tags', 'name', 'description', 'tenant_group', 'tenant', 'tags',
] ]
fieldsets = (
('Route Target', ('name', 'description', 'tags')),
('Tenancy', ('tenant_group', 'tenant')),
)
class RouteTargetCSVForm(CustomFieldModelCSVForm): class RouteTargetCSVForm(CustomFieldModelCSVForm):
@ -626,9 +630,8 @@ class PrefixFilterForm(BootstrapMixin, TenancyFilterForm, CustomFieldModelFilter
model = Prefix model = Prefix
field_groups = [ field_groups = [
['q', 'tag'], ['q', 'tag'],
['within_include', 'family', 'status', 'role_id'], ['within_include', 'family', 'status', 'role_id', 'mask_length', 'is_pool', 'mark_utilized'],
['vrf_id', 'present_in_vrf_id'], ['vrf_id', 'present_in_vrf_id'],
['mask_length', 'is_pool', 'mark_utilized'],
['region_id', 'site_group_id', 'site_id'], ['region_id', 'site_group_id', 'site_id'],
['tenant_group_id', 'tenant_id'] ['tenant_group_id', 'tenant_id']
] ]
@ -1270,9 +1273,8 @@ class IPAddressFilterForm(BootstrapMixin, TenancyFilterForm, CustomFieldModelFil
] ]
field_groups = [ field_groups = [
['q', 'tag'], ['q', 'tag'],
['parent', 'family', 'status', 'role'], ['parent', 'family', 'status', 'role', 'mask_length', 'assigned_to_interface'],
['vrf_id', 'present_in_vrf_id'], ['vrf_id', 'present_in_vrf_id'],
['mask_length', 'assigned_to_interface'],
['tenant_group_id', 'tenant_id'], ['tenant_group_id', 'tenant_id'],
] ]
q = forms.CharField( q = forms.CharField(

View File

@ -548,7 +548,7 @@ class VLANTable(BaseTable):
class Meta(BaseTable.Meta): class Meta(BaseTable.Meta):
model = VLAN model = VLAN
fields = ('pk', 'vid', 'site', 'group', 'name', 'tenant', 'status', 'role', 'description') fields = ('pk', 'vid', 'name', 'site', 'group', 'tenant', 'status', 'role', 'description')
row_attrs = { row_attrs = {
'class': lambda record: 'success' if not isinstance(record, VLAN) else '', 'class': lambda record: 'success' if not isinstance(record, VLAN) else '',
} }
@ -566,8 +566,8 @@ class VLANDetailTable(VLANTable):
) )
class Meta(VLANTable.Meta): class Meta(VLANTable.Meta):
fields = ('pk', 'vid', 'site', 'group', 'name', 'prefixes', 'tenant', 'status', 'role', 'description', 'tags') fields = ('pk', 'vid', 'name', 'site', 'group', 'prefixes', 'tenant', 'status', 'role', 'description', 'tags')
default_columns = ('pk', 'vid', 'site', 'group', 'name', 'prefixes', 'tenant', 'status', 'role', 'description') default_columns = ('pk', 'vid', 'name', 'site', 'group', 'prefixes', 'tenant', 'status', 'role', 'description')
class VLANMembersTable(BaseTable): class VLANMembersTable(BaseTable):

View File

@ -24,7 +24,7 @@
</tr> </tr>
<tr> <tr>
<th scope="row">Circuit ID</th> <th scope="row">Circuit ID</th>
<td><code>{{ object.cid }}</code></td> <td>{{ object.cid }}</td>
</tr> </tr>
<tr> <tr>
<th scope="row">Type</th> <th scope="row">Type</th>

View File

@ -54,9 +54,9 @@
{% endif %} {% endif %}
<a href="{{ peer.get_absolute_url }}">{{ peer }}</a> <a href="{{ peer.get_absolute_url }}">{{ peer }}</a>
{% endwith %} {% endwith %}
<div class="float-md-end mt-3 mt-md-0"> <div class="mt-1">
<a href="{% url 'circuits:circuittermination_trace' pk=termination.pk %}" class="btn btn-primary btn-sm lh-1" title="Trace"> <a href="{% url 'circuits:circuittermination_trace' pk=termination.pk %}" class="btn btn-primary btn-sm lh-1" title="Trace">
<i class="mdi mdi-transit-connection-variant" aria-hidden="true"></i> <i class="mdi mdi-transit-connection-variant" aria-hidden="true"></i> Trace
</a> </a>
{% if perms.dcim.delete_cable %} {% if perms.dcim.delete_cable %}
<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"> <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">

View File

@ -27,10 +27,10 @@
</tr> </tr>
<tr> <tr>
<th scope="row">Type</th> <th scope="row">Type</th>
<td>{{ object.get_type_display }}</td> <td>{{ object.get_type_display|placeholder }}</td>
</tr> </tr>
<tr> <tr>
<td scope="row">Speed</td> <th scope="row">Speed</th>
<td>{{ object.get_speed_display|placeholder }}</td> <td>{{ object.get_speed_display|placeholder }}</td>
</tr> </tr>
<tr> <tr>

View File

@ -26,7 +26,7 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Inventory Items</td> <th scope="row">Inventory Items</th>
<td> <td>
<a href="{% url 'dcim:inventoryitem_list' %}?manufacturer_id={{ object.pk }}">{{ inventory_item_count }}</a> <a href="{% url 'dcim:inventoryitem_list' %}?manufacturer_id={{ object.pk }}">{{ inventory_item_count }}</a>
</td> </td>

View File

@ -34,7 +34,7 @@
<tr> <tr>
<td>Utilization</td> <td>Utilization</td>
<td> <td>
{{ object.get_utilization }}% {% utilization_graph object.get_utilization %}
</td> </td>
</tr> </tr>
<tr> <tr>

View File

@ -24,10 +24,10 @@
{% render_field form.name %} {% render_field form.name %}
<div class="row"> <div class="row">
<label class="col-sm-3 col-form-label text-lg-end">Port(s)</label> <label class="col-sm-3 col-form-label text-lg-end">Port(s)</label>
<div class="col-2"> <div class="col-3">
{{ form.protocol }} {{ form.protocol }}
</div> </div>
<div class="col-7"> <div class="col-6">
{{ form.ports }} {{ form.ports }}
</div> </div>
</div> </div>

View File

@ -13,13 +13,13 @@
{% block extra_controls %} {% block extra_controls %}
{% if perms.virtualization.change_cluster and perms.virtualization.add_virtualmachine %} {% if perms.virtualization.change_cluster and perms.virtualization.add_virtualmachine %}
<a href="{% url 'virtualization:virtualmachine_add' %}?cluster_id={{ object.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-sm btn-primary"> <a href="{% url 'virtualization:virtualmachine_add' %}?cluster={{ object.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-sm btn-primary">
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add Virtual Machine <span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add Virtual Machine
</a> </a>
{% endif %} {% endif %}
{% if perms.virtualization.change_cluster %} {% if perms.virtualization.change_cluster %}
<a href="{% url 'virtualization:cluster_add_devices' pk=object.pk %}?site_id={{ object.site.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-primary btn-sm"> <a href="{% url 'virtualization:cluster_add_devices' pk=object.pk %}?site={{ object.site.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-primary btn-sm">
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Assign Device <span class="mdi mdi-plus-thick" aria-hidden="true"></span> Assign Device
</a> </a>
{% endif %} {% endif %}