mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 20:12:00 -06:00
PowerFeed list improvements
This commit is contained in:
parent
7b6c104768
commit
92567137a5
@ -3425,7 +3425,7 @@ class PowerPanelFilterForm(BootstrapMixin, CustomFieldFilterForm):
|
||||
api_url="/api/dcim/sites/",
|
||||
value_field="slug",
|
||||
filter_for={
|
||||
'rack_id': 'site',
|
||||
'rack_group_id': 'site',
|
||||
}
|
||||
)
|
||||
)
|
||||
|
@ -189,6 +189,10 @@ CABLE_LENGTH = """
|
||||
{% if record.length %}{{ record.length }} {{ record.get_length_unit_display }}{% else %}—{% endif %}
|
||||
"""
|
||||
|
||||
POWERPANEL_POWERFEED_COUNT = """
|
||||
<a href="{% url 'dcim:powerfeed_list' %}?power_panel_id={{ record.pk }}">{{ value }}</a>
|
||||
"""
|
||||
|
||||
|
||||
#
|
||||
# Regions
|
||||
@ -804,7 +808,8 @@ class PowerPanelTable(BaseTable):
|
||||
viewname='dcim:site',
|
||||
args=[Accessor('site.slug')]
|
||||
)
|
||||
powerfeed_count = tables.Column(
|
||||
powerfeed_count = tables.TemplateColumn(
|
||||
template_code=POWERPANEL_POWERFEED_COUNT,
|
||||
verbose_name='Feeds'
|
||||
)
|
||||
|
||||
|
@ -13,8 +13,6 @@ from django.urls import reverse
|
||||
from django.utils.html import escape
|
||||
from django.utils.http import is_safe_url
|
||||
from django.utils.safestring import mark_safe
|
||||
from django.utils.decorators import method_decorator
|
||||
from django.views.decorators.cache import cache_page
|
||||
from django.views.generic import View
|
||||
|
||||
from circuits.models import Circuit
|
||||
|
Loading…
Reference in New Issue
Block a user