Merge branch 'feature' into feature-apiselect-queryparams

This commit is contained in:
thatmattlove 2021-08-26 00:15:29 -07:00
commit e8b3d191e6
30 changed files with 188 additions and 107 deletions

View File

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

View File

@ -288,10 +288,10 @@ class ConsolePortTable(DeviceComponentTable, PathEndpointTable):
class Meta(DeviceComponentTable.Meta):
model = ConsolePort
fields = (
'pk', 'device', 'name', 'label', 'type', 'speed', 'description', 'mark_connected', 'cable', 'cable_color',
'pk', 'name', 'device', 'label', 'type', 'speed', 'description', 'mark_connected', 'cable', 'cable_color',
'cable_peer', 'connection', 'tags',
)
default_columns = ('pk', 'device', 'name', 'label', 'type', 'speed', 'description')
default_columns = ('pk', 'name', 'device', 'label', 'type', 'speed', 'description')
class DeviceConsolePortTable(ConsolePortTable):
@ -332,10 +332,10 @@ class ConsoleServerPortTable(DeviceComponentTable, PathEndpointTable):
class Meta(DeviceComponentTable.Meta):
model = ConsoleServerPort
fields = (
'pk', 'device', 'name', 'label', 'type', 'speed', 'description', 'mark_connected', 'cable', 'cable_color',
'pk', 'name', 'device', 'label', 'type', 'speed', 'description', 'mark_connected', 'cable', 'cable_color',
'cable_peer', 'connection', 'tags',
)
default_columns = ('pk', 'device', 'name', 'label', 'type', 'speed', 'description')
default_columns = ('pk', 'name', 'device', 'label', 'type', 'speed', 'description')
class DeviceConsoleServerPortTable(ConsoleServerPortTable):
@ -377,10 +377,10 @@ class PowerPortTable(DeviceComponentTable, PathEndpointTable):
class Meta(DeviceComponentTable.Meta):
model = PowerPort
fields = (
'pk', 'device', 'name', 'label', 'type', 'description', 'mark_connected', 'maximum_draw', 'allocated_draw',
'pk', 'name', 'device', 'label', 'type', 'description', 'mark_connected', 'maximum_draw', 'allocated_draw',
'cable', 'cable_color', 'cable_peer', 'connection', 'tags',
)
default_columns = ('pk', 'device', 'name', 'label', 'type', 'maximum_draw', 'allocated_draw', 'description')
default_columns = ('pk', 'name', 'device', 'label', 'type', 'maximum_draw', 'allocated_draw', 'description')
class DevicePowerPortTable(PowerPortTable):
@ -428,10 +428,10 @@ class PowerOutletTable(DeviceComponentTable, PathEndpointTable):
class Meta(DeviceComponentTable.Meta):
model = PowerOutlet
fields = (
'pk', 'device', 'name', 'label', 'type', 'description', 'power_port', 'feed_leg', 'mark_connected', 'cable',
'pk', 'name', 'device', 'label', 'type', 'description', 'power_port', 'feed_leg', 'mark_connected', 'cable',
'cable_color', 'cable_peer', 'connection', 'tags',
)
default_columns = ('pk', 'device', 'name', 'label', 'type', 'power_port', 'feed_leg', 'description')
default_columns = ('pk', 'name', 'device', 'label', 'type', 'power_port', 'feed_leg', 'description')
class DevicePowerOutletTable(PowerOutletTable):
@ -490,11 +490,11 @@ class InterfaceTable(DeviceComponentTable, BaseInterfaceTable, PathEndpointTable
class Meta(DeviceComponentTable.Meta):
model = Interface
fields = (
'pk', 'device', 'name', 'label', 'enabled', 'type', 'mgmt_only', 'mtu', 'mode', 'mac_address',
'pk', 'name', 'device', 'label', 'enabled', 'type', 'mgmt_only', 'mtu', 'mode', 'mac_address',
'description', 'mark_connected', 'cable', 'cable_color', 'cable_peer', 'connection', 'tags', 'ip_addresses',
'untagged_vlan', 'tagged_vlans',
)
default_columns = ('pk', 'device', 'name', 'label', 'enabled', 'type', 'description')
default_columns = ('pk', 'name', 'device', 'label', 'enabled', 'type', 'description')
class DeviceInterfaceTable(InterfaceTable):
@ -559,11 +559,11 @@ class FrontPortTable(DeviceComponentTable, CableTerminationTable):
class Meta(DeviceComponentTable.Meta):
model = FrontPort
fields = (
'pk', 'device', 'name', 'label', 'type', 'color', 'rear_port', 'rear_port_position', 'description',
'pk', 'name', 'device', 'label', 'type', 'color', 'rear_port', 'rear_port_position', 'description',
'mark_connected', 'cable', 'cable_color', 'cable_peer', 'tags',
)
default_columns = (
'pk', 'device', 'name', 'label', 'type', 'color', 'rear_port', 'rear_port_position', 'description',
'pk', 'name', 'device', 'label', 'type', 'color', 'rear_port', 'rear_port_position', 'description',
)
@ -610,10 +610,10 @@ class RearPortTable(DeviceComponentTable, CableTerminationTable):
class Meta(DeviceComponentTable.Meta):
model = RearPort
fields = (
'pk', 'device', 'name', 'label', 'type', 'color', 'positions', 'description', 'mark_connected', 'cable',
'pk', 'name', 'device', 'label', 'type', 'color', 'positions', 'description', 'mark_connected', 'cable',
'cable_color', 'cable_peer', 'tags',
)
default_columns = ('pk', 'device', 'name', 'label', 'type', 'color', 'description')
default_columns = ('pk', 'name', 'device', 'label', 'type', 'color', 'description')
class DeviceRearPortTable(RearPortTable):
@ -662,8 +662,8 @@ class DeviceBayTable(DeviceComponentTable):
class Meta(DeviceComponentTable.Meta):
model = DeviceBay
fields = ('pk', 'device', 'name', 'label', 'status', 'installed_device', 'description', 'tags')
default_columns = ('pk', 'device', 'name', 'label', 'status', 'installed_device', 'description')
fields = ('pk', 'name', 'device', 'label', 'status', 'installed_device', 'description', 'tags')
default_columns = ('pk', 'name', 'device', 'label', 'status', 'installed_device', 'description')
class DeviceDeviceBayTable(DeviceBayTable):
@ -708,10 +708,10 @@ class InventoryItemTable(DeviceComponentTable):
class Meta(BaseTable.Meta):
model = InventoryItem
fields = (
'pk', 'device', 'name', 'label', 'manufacturer', 'part_id', 'serial', 'asset_tag', 'description',
'pk', 'name', 'device', 'label', 'manufacturer', 'part_id', 'serial', 'asset_tag', 'description',
'discovered', 'tags',
)
default_columns = ('pk', 'device', 'name', 'label', 'manufacturer', 'part_id', 'serial', 'asset_tag')
default_columns = ('pk', 'name', 'device', 'label', 'manufacturer', 'part_id', 'serial', 'asset_tag')
class DeviceInventoryItemTable(InventoryItemTable):

View File

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

View File

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

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -243,6 +243,7 @@ table {
&.attr-table {
th {
font-weight: normal;
width: 25%;
}
}
@ -723,10 +724,6 @@ div.paginator > form > div.input-group {
width: fit-content;
}
div.field-group:not(:first-of-type) {
margin-top: $spacer * 3;
}
label.required {
font-weight: $font-weight-bold;

View File

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

View File

@ -5,7 +5,7 @@
{% block title %}{{ obj.circuit.provider }} {{ obj.circuit }} - Side {{ form.term_side.value }}{% endblock %}
{% block form %}
<div class="field-group">
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Circuit Termination</h5>
</div>
@ -41,7 +41,7 @@
</ul>
</div>
</div>
<div class="tab-content p-0">
<div class="tab-content p-0 border-0">
<div class="tab-pane{% if not providernetwork_tab_active %} active{% endif %}" id="site">
{% render_field form.region %}
{% render_field form.site_group %}
@ -53,7 +53,9 @@
</div>
{% endwith %}
</div>
<div class="field-group">
<hr />
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Termination Details</h5>
</div>

View File

@ -54,9 +54,9 @@
{% endif %}
<a href="{{ peer.get_absolute_url }}">{{ peer }}</a>
{% 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">
<i class="mdi mdi-transit-connection-variant" aria-hidden="true"></i>
<i class="mdi mdi-transit-connection-variant" aria-hidden="true"></i> Trace
</a>
{% 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">

View File

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

View File

@ -4,7 +4,7 @@
{% block form %}
{% render_errors form %}
<div class="field-group">
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Device</h5>
</div>
@ -12,8 +12,9 @@
{% render_field form.device_role %}
{% render_field form.tags %}
</div>
<hr />
<div class="field-group">
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Hardware</h5>
</div>
@ -22,8 +23,9 @@
{% render_field form.serial %}
{% render_field form.asset_tag %}
</div>
<hr />
<div class="field-group">
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Location</h5>
</div>
@ -56,8 +58,9 @@
{% render_field form.position %}
{% endif %}
</div>
<hr />
<div class="field-group">
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Management</h5>
</div>
@ -68,38 +71,43 @@
{% render_field form.primary_ip6 %}
{% endif %}
</div>
<hr />
<div class="field-group">
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Virtualization</h5>
</div>
{% render_field form.cluster_group %}
{% render_field form.cluster %}
</div>
<hr />
<div class="field-group">
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Tenancy</h5>
</div>
{% render_field form.tenant_group %}
{% render_field form.tenant %}
</div>
<hr />
{% if form.custom_fields %}
<div class="field-group">
{% if form.custom_fields %}
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Custom Fields</h5>
</div>
{% render_custom_fields form %}
</div>
</div>
<hr />
{% endif %}
{% endif %}
<div class="field-group">
<div class="field-group my-4">
<h5 class="text-center">Local Config Context Data</h5>
{% render_field form.local_context_data %}
</div>
<hr />
<div class="field-group">
<div class="field-group my-4">
{% render_field form.comments label='Comments' %}
</div>

View File

@ -16,8 +16,11 @@
</div>
{% render_field form.tags %}
{% if form.custom_fields %}
<hr />
<div class="field-group">
<h4>Custom Fields</h4>
{% render_custom_fields form %}
<div class="row mb-2">
<h5 class="offset-sm-3">Custom Fields</h5>
</div>
{% render_custom_fields form %}
</div>
{% endif %}

View File

@ -2,7 +2,7 @@
{% load form_helpers %}
{% block form %}
<div class="field-group">
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Interface</h5>
</div>
@ -27,7 +27,9 @@
{% render_field form.mgmt_only %}
{% render_field form.mark_connected %}
</div>
<div class="field-group">
<hr />
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">802.1Q Switching</h5>
</div>
@ -36,13 +38,15 @@
{% render_field form.untagged_vlan %}
{% render_field form.tagged_vlans %}
</div>
{% if form.custom_fields %}
<div class="field-group">
<div class="row mb-2">
<h5 class="offset-sm-3">Custom Fields</h5>
</div>
{% render_custom_fields form %}
<hr />
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Custom Fields</h5>
</div>
{% render_custom_fields form %}
</div>
{% endif %}
{% endblock %}

View File

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

View File

@ -2,7 +2,7 @@
{% load form_helpers %}
{% block form %}
<div class="field-group">
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Rack</h5>
</div>
@ -15,7 +15,9 @@
{% render_field form.role %}
{% render_field form.tags %}
</div>
<div class="field-group">
<hr />
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Inventory Control</h5>
</div>
@ -23,14 +25,18 @@
{% render_field form.serial %}
{% render_field form.asset_tag %}
</div>
<div class="field-group">
<hr />
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Tenancy</h5>
</div>
{% render_field form.tenant_group %}
{% render_field form.tenant %}
</div>
<div class="field-group">
<hr />
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Dimensions</h5>
</div>
@ -54,15 +60,19 @@
</div>
{% render_field form.desc_units %}
</div>
<hr />
{% if form.custom_fields %}
<div class="field-group">
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Custom Fields</h5>
</div>
{% render_custom_fields form %}
</div>
{% render_custom_fields form %}
</div>
<hr />
{% endif %}
<div class="field-group">
<div class="field-group my-4">
{% render_field form.comments label='Comments' %}
</div>
{% endblock %}

View File

@ -209,7 +209,14 @@
Locations
</h5>
<div class='card-body'>
{% if locations %}
<table class="table table-hover">
<tr>
<th>Location</th>
<th>Racks</th>
<th>Devices</th>
<th></th>
</tr>
{% for location in locations %}
<tr>
<td style="padding-left: {{ location.level }}8px">
@ -230,6 +237,9 @@
</tr>
{% endfor %}
</table>
{% else %}
<span class="text-muted">None</span>
{% endif %}
</div>
</div>
<div class="card">

View File

@ -2,7 +2,7 @@
{% load form_helpers %}
{% block form %}
<div class="field-group">
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Virtual Chassis</h5>
</div>
@ -10,7 +10,9 @@
{% render_field form.domain %}
{% render_field form.tags %}
</div>
<div class="field-group">
<hr />
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Member Devices</h5>
</div>
@ -21,8 +23,10 @@
{% render_field form.members %}
{% render_field form.initial_position %}
</div>
{% if form.custom_fields %}
<div class="field-group">
<hr />
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Custom Fields</h5>
</div>

View File

@ -11,7 +11,7 @@
{% csrf_token %}
{{ pk_form.pk }}
{{ formset.management_form }}
<div class="field-group">
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Virtual Chassis</h5>
</div>
@ -20,14 +20,18 @@
{% render_field vc_form.master %}
{% render_field vc_form.tags %}
</div>
<hr />
{% if vc_form.custom_fields %}
<div class="field-group">
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Custom Fields</h5>
</div>
{% render_custom_fields vc_form %}
</div>
<hr />
{% endif %}
<div class="field-group mb-5">
<h5 class="text-center">Members</h5>
<table class="table">

View File

@ -42,7 +42,7 @@
{# Render grouped fields according to Form #}
{% for group, fields in form.Meta.fieldsets %}
<div class="field-group">
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">{{ group }}</h5>
</div>
@ -50,11 +50,15 @@
{% render_field form|getfield:name %}
{% endfor %}
</div>
{% if not forloop.last %}
<hr />
{% endif %}
{% endfor %}
{% if form.custom_fields %}
<div class="field-group">
<div class="row mb-1">
<hr />
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Custom Fields</h5>
</div>
{% render_custom_fields form %}
@ -62,14 +66,15 @@
{% endif %}
{% if form.comments %}
<div class="field-group">
<hr />
<div class="field-group my-4">
{% render_field form.comments label='Comments' %}
</div>
{% endif %}
{% else %}
{# Render all fields in a single group #}
<div class="field-group">
<div class="field-group my-4">
{% block form_fields %}{% render_form form %}{% endblock %}
</div>
{% endif %}

View File

@ -48,7 +48,7 @@
<i class="mdi mdi-backspace"></i> Reset
</button>
<button type="submit" class="btn btn-sm btn-primary m-1">
<i class="mdi mdi-filter-variant"></i> Filter
<i class="mdi mdi-magnify"></i> Search
</button>
</div>
</div>

View File

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

View File

@ -9,8 +9,10 @@
{% endblock %}
{% block form %}
<div class="field-group">
<h5 class="text-center">IP Addresses</h5>
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">IP Addresses</h5>
</div>
{% render_field form.pattern %}
{% render_field model_form.status %}
{% render_field model_form.role %}
@ -18,14 +20,21 @@
{% render_field model_form.description %}
{% render_field model_form.tags %}
</div>
<div class="field-group">
<h5 class="text-center">Tenancy</h5>
<hr />
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Tenancy</h5>
</div>
{% render_field model_form.tenant_group %}
{% render_field model_form.tenant %}
</div>
{% if model_form.custom_fields %}
<div class="field-group">
<h5 class="text-center">Custom Fields</h5>
<hr />
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Custom Fields</h5>
</div>
{% render_custom_fields model_form %}
</div>
{% endif %}

View File

@ -8,7 +8,7 @@
{% endblock tabs %}
{% block form %}
<div class="field-group">
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">IP Address</h5>
</div>
@ -20,14 +20,18 @@
{% render_field form.description %}
{% render_field form.tags %}
</div>
<div class="field-group">
<hr />
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Tenancy</h5>
</div>
{% render_field form.tenant_group %}
{% render_field form.tenant %}
</div>
<div class="field-group">
<hr />
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Interface Assignment</h5>
</div>
@ -64,7 +68,7 @@
</ul>
</div>
</div>
<div class="tab-content p-0">
<div class="tab-content p-0 border-0">
<div class="tab-pane {% if not vm_tab_active %}active{% endif %}" id="device" role="tabpanel" aria-labeled-by="device_tab">
{% render_field form.device %}
{% render_field form.interface %}
@ -77,7 +81,9 @@
</div>
{% endwith %}
</div>
<div class="field-group">
<hr />
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">NAT IP (Inside)</h5>
</div>
@ -126,7 +132,7 @@
</ul>
</div>
</div>
<div class="tab-content p-0">
<div class="tab-content p-0 border-0">
<div class="tab-pane active" id="by_device" aria-labelledby="device_tab" role="tabpanel">
{% render_field form.nat_region %}
{% render_field form.nat_site_group %}
@ -144,8 +150,10 @@
{% render_field form.nat_inside %}
</div>
</div>
{% if form.custom_fields %}
<div class="field-group">
<hr />
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Custom Fields</h5>
</div>

View File

@ -2,7 +2,7 @@
{% load form_helpers %}
{% block form %}
<div class="field-group">
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Service</h5>
</div>
@ -24,10 +24,10 @@
{% render_field form.name %}
<div class="row">
<label class="col-sm-3 col-form-label text-lg-end">Port(s)</label>
<div class="col-2">
<div class="col-3">
{{ form.protocol }}
</div>
<div class="col-7">
<div class="col-6">
{{ form.ports }}
</div>
</div>
@ -41,7 +41,9 @@
{% render_field form.description %}
{% render_field form.tags %}
</div>
{% if form.custom_fields %}
<hr />
<div class="row mb-2">
<h5 class="offset-sm-3">Custom Fields</h5>
</div>

View File

@ -4,7 +4,7 @@
{% load helpers %}
{% block form %}
<div class="field-group mb-3">
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">VLAN</h5>
</div>
@ -15,14 +15,18 @@
{% render_field form.description %}
{% render_field form.tags %}
</div>
<div class="field-group mb-3">
<hr />
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Tenancy</h5>
</div>
{% render_field form.tenant_group %}
{% render_field form.tenant %}
</div>
<div class="field-group mb-3">
<hr />
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Assignment</h5>
</div>
@ -39,7 +43,7 @@
</ul>
</div>
</div>
<div class="tab-content p-0">
<div class="tab-content p-0 border-0">
<div class="tab-pane{% if not site_tab_active %} active{% endif %}" id="group">
{% render_field form.scope_type %}
{% render_field form.group %}
@ -52,8 +56,10 @@
</div>
{% endwith %}
</div>
{% if form.custom_fields %}
<div class="field-group">
<hr />
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Custom Fields</h5>
</div>

View File

@ -13,13 +13,13 @@
{% block extra_controls %}
{% 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
</a>
{% endif %}
{% 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
</a>
{% endif %}

View File

@ -2,7 +2,7 @@
{% load form_helpers %}
{% block form %}
<div class="field-group">
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Interface</h5>
</div>
@ -22,7 +22,9 @@
{% render_field form.description %}
{% render_field form.tags %}
</div>
<div class="field-group">
<hr />
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">802.1Q Switching</h5>
</div>
@ -31,8 +33,10 @@
{% render_field form.untagged_vlan %}
{% render_field form.tagged_vlans %}
</div>
{% if form.custom_fields %}
<div class="field-group">
<hr />
<div class="field-group my-4">
<div class="row mb-2">
<h5 class="offset-sm-3">Custom Fields</h5>
</div>

View File

@ -180,10 +180,10 @@ class VMInterfaceTable(BaseInterfaceTable):
class Meta(BaseTable.Meta):
model = VMInterface
fields = (
'pk', 'virtual_machine', 'name', 'enabled', 'parent', 'mac_address', 'mtu', 'mode', 'description', 'tags',
'pk', 'name', 'virtual_machine', 'enabled', 'parent', 'mac_address', 'mtu', 'mode', 'description', 'tags',
'ip_addresses', 'untagged_vlan', 'tagged_vlans',
)
default_columns = ('pk', 'virtual_machine', 'name', 'enabled', 'parent', 'description')
default_columns = ('pk', 'name', 'virtual_machine', 'enabled', 'parent', 'description')
class VirtualMachineVMInterfaceTable(VMInterfaceTable):