mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-19 17:59:11 -06:00
Use embedded tables for importing/export VRFs & L2VPNs under route target view
This commit is contained in:
parent
2525eefefd
commit
6e264562ee
@ -103,21 +103,6 @@ class RouteTargetListView(generic.ObjectListView):
|
|||||||
class RouteTargetView(generic.ObjectView):
|
class RouteTargetView(generic.ObjectView):
|
||||||
queryset = RouteTarget.objects.all()
|
queryset = RouteTarget.objects.all()
|
||||||
|
|
||||||
def get_extra_context(self, request, instance):
|
|
||||||
importing_vrfs_table = tables.VRFTable(
|
|
||||||
instance.importing_vrfs.all(),
|
|
||||||
orderable=False
|
|
||||||
)
|
|
||||||
exporting_vrfs_table = tables.VRFTable(
|
|
||||||
instance.exporting_vrfs.all(),
|
|
||||||
orderable=False
|
|
||||||
)
|
|
||||||
|
|
||||||
return {
|
|
||||||
'importing_vrfs_table': importing_vrfs_table,
|
|
||||||
'exporting_vrfs_table': exporting_vrfs_table,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@register_model_view(RouteTarget, 'edit')
|
@register_model_view(RouteTarget, 'edit')
|
||||||
class RouteTargetEditView(generic.ObjectEditView):
|
class RouteTargetEditView(generic.ObjectEditView):
|
||||||
|
@ -25,18 +25,54 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% include 'inc/panels/tags.html' %}
|
{% include 'inc/panels/tags.html' %}
|
||||||
{% include 'inc/panels/custom_fields.html' %}
|
|
||||||
{% include 'inc/panels/comments.html' %}
|
|
||||||
{% plugin_left_page object %}
|
{% plugin_left_page object %}
|
||||||
</div>
|
</div>
|
||||||
<div class="col col-md-6">
|
<div class="col col-md-6">
|
||||||
<div class="mb-4">
|
{% include 'inc/panels/custom_fields.html' %}
|
||||||
{% include 'inc/panel_table.html' with table=importing_vrfs_table heading="Importing VRFs" %}
|
{% include 'inc/panels/comments.html' %}
|
||||||
</div>
|
|
||||||
{% include 'inc/panel_table.html' with table=exporting_vrfs_table heading="Exporting VRFs" %}
|
|
||||||
{% plugin_right_page object %}
|
{% plugin_right_page object %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row mb-3">
|
||||||
|
<div class="col col-md-6">
|
||||||
|
<div class="card">
|
||||||
|
<h5 class="card-header">Importing VRFs</h5>
|
||||||
|
<div class="card-body htmx-container table-responsive"
|
||||||
|
hx-get="{% url 'ipam:vrf_list' %}?import_target_id={{ object.pk }}"
|
||||||
|
hx-trigger="load"
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col col-md-6">
|
||||||
|
<div class="card">
|
||||||
|
<h5 class="card-header">Exporting VRFs</h5>
|
||||||
|
<div class="card-body htmx-container table-responsive"
|
||||||
|
hx-get="{% url 'ipam:vrf_list' %}?export_target_id={{ object.pk }}"
|
||||||
|
hx-trigger="load"
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-3">
|
||||||
|
<div class="col col-md-6">
|
||||||
|
<div class="card">
|
||||||
|
<h5 class="card-header">Importing L2VPNs</h5>
|
||||||
|
<div class="card-body htmx-container table-responsive"
|
||||||
|
hx-get="{% url 'ipam:l2vpn_list' %}?import_target_id={{ object.pk }}"
|
||||||
|
hx-trigger="load"
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col col-md-6">
|
||||||
|
<div class="card">
|
||||||
|
<h5 class="card-header">Exporting L2VPNs</h5>
|
||||||
|
<div class="card-body htmx-container table-responsive"
|
||||||
|
hx-get="{% url 'ipam:l2vpn_list' %}?export_target_id={{ object.pk }}"
|
||||||
|
hx-trigger="load"
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col col-md-12">
|
<div class="col col-md-12">
|
||||||
{% plugin_full_width_page object %}
|
{% plugin_full_width_page object %}
|
||||||
|
Loading…
Reference in New Issue
Block a user