Misc cleanup

This commit is contained in:
Jeremy Stretch 2023-11-27 14:57:57 -05:00
parent fd432e023d
commit 9038ed88fc
9 changed files with 14 additions and 26 deletions

View File

@ -1,6 +1,6 @@
# Tunnels
NetBox can model private tunnels formed among virtual termination points across your network. Typical tunnel implementations include GRE, IP-in-IP, or IPSec. A tunnel may be terminated to two or more device or virtual machine interfaces.
NetBox can model private tunnels formed among virtual termination points across your network. Typical tunnel implementations include GRE, IP-in-IP, and IPSec. A tunnel may be terminated to two or more device or virtual machine interfaces.
```mermaid
flowchart TD

View File

@ -21,7 +21,7 @@ The functional role of the attached interface. The following options are availab
!!! note
Multiple hub terminations may be attached to a tunnel.
### Interface
### Termination
The device or virtual machine interface terminated to the tunnel.

View File

@ -551,11 +551,6 @@ class BaseInterface(models.Model):
blank=True,
verbose_name=_('bridge interface')
)
tunnel_terminations = GenericRelation(
to='vpn.TunnelTermination',
content_type_field='interface_type',
object_id_field='interface_id'
)
class Meta:
abstract = True

View File

@ -26,6 +26,10 @@
<th scope="row">{% trans "Status" %}</th>
<td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
</tr>
<tr>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">{% trans "Encapsulation" %}</th>
<td>{{ object.get_encapsulation_display }}</td>
@ -34,6 +38,10 @@
<th scope="row">{% trans "IPSec profile" %}</th>
<td>{{ object.ipsec_profile|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">{% trans "Tunnel ID" %}</th>
<td>{{ object.tunnel_id|placeholder }}</td>
</tr>
<tr>
<th scope="row">{% trans "Tenant" %}</th>
<td>
@ -43,18 +51,6 @@
{{ object.tenant|linkify|placeholder }}
</td>
</tr>
<tr>
<th scope="row">{% trans "Pre-shared key" %}</th>
<td>{{ object.preshared_key|placeholder }}</td>
</tr>
<tr>
<th scope="row">{% trans "Tunnel ID" %}</th>
<td>{{ object.tunnel_id|placeholder }}</td>
</tr>
<tr>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
</table>
</div>
</div>

View File

@ -148,7 +148,7 @@ class IPSecProposalSerializer(NetBoxModelSerializer):
model = IPSecProposal
fields = (
'id', 'url', 'display', 'name', 'description', 'encryption_algorithm', 'authentication_algorithm',
'sa_lifetime_data', 'sa_lifetime_seconds', 'tags', 'custom_fields', 'created', 'last_updated',
'sa_lifetime_seconds', 'sa_lifetime_data', 'tags', 'custom_fields', 'created', 'last_updated',
)

View File

@ -145,7 +145,7 @@ class IKEPolicyFilterSet(NetBoxModelFilterSet):
class Meta:
model = IKEPolicy
fields = ['id', 'name']
fields = ['id', 'name', 'preshared_key']
def search(self, queryset, name, value):
if not value.strip():

View File

@ -70,9 +70,6 @@ class TunnelTerminationBulkEditForm(NetBoxModelBulkEditForm):
)
model = TunnelTermination
fieldsets = (
(None, ('role',)),
)
class IKEProposalBulkEditForm(NetBoxModelBulkEditForm):

View File

@ -190,7 +190,7 @@ class IPSecProposalImportForm(NetBoxModelImportForm):
class IPSecPolicyImportForm(NetBoxModelImportForm):
pfs_group = CSVChoiceField(
label=_('PFS group'),
label=_('Diffie-Hellman group for Perfect Forward Secrecy'),
choices=DHGroupChoices
)
proposals = CSVModelMultipleChoiceField(

View File

@ -48,7 +48,7 @@ class TunnelTable(TenancyColumnsMixin, NetBoxTable):
'pk', 'id', 'name', 'status', 'encapsulation', 'ipsec_profile', 'tenant', 'tenant_group', 'tunnel_id',
'termination_count', 'description', 'comments', 'tags', 'created', 'last_updated',
)
default_columns = ('pk', 'name', 'status', 'encapsulation', 'tenant', 'terminations_count')
default_columns = ('pk', 'name', 'status', 'encapsulation', 'ipsec_profile', 'tenant', 'terminations_count')
class TunnelTerminationTable(TenancyColumnsMixin, NetBoxTable):