diff --git a/netbox/core/plugins.py b/netbox/core/plugins.py index 66580c936..3775dcad4 100644 --- a/netbox/core/plugins.py +++ b/netbox/core/plugins.py @@ -47,6 +47,7 @@ class Plugin: The representation of a NetBox plugin in the catalog API. """ id: str = '' + icon_url: str = '' status: str = '' title_short: str = '' title_long: str = '' @@ -193,6 +194,7 @@ def get_catalog_plugins(): # Populate plugin data plugins[data['config_name']] = Plugin( id=data['id'], + icon_url=data['icon'], status=data['status'], title_short=data['title_short'], title_long=data['title_long'], diff --git a/netbox/core/tables/plugins.py b/netbox/core/tables/plugins.py index 96c612366..88197dd21 100644 --- a/netbox/core/tables/plugins.py +++ b/netbox/core/tables/plugins.py @@ -9,6 +9,12 @@ __all__ = ( ) +PLUGIN_NAME_TEMPLATE = """ + +{{ record.title_long }} +""" + + class PluginVersionTable(BaseTable): version = tables.Column( verbose_name=_('Version') @@ -39,8 +45,8 @@ class PluginVersionTable(BaseTable): class CatalogPluginTable(BaseTable): - title_long = tables.Column( - linkify=('core:plugin', [tables.A('config_name')]), + title_long = columns.TemplateColumn( + template_code=PLUGIN_NAME_TEMPLATE, verbose_name=_('Name') ) author = tables.Column( diff --git a/netbox/project-static/dist/netbox.css b/netbox/project-static/dist/netbox.css index f09e4637b..4bdc8cc18 100644 Binary files a/netbox/project-static/dist/netbox.css and b/netbox/project-static/dist/netbox.css differ diff --git a/netbox/project-static/styles/custom/_misc.scss b/netbox/project-static/styles/custom/_misc.scss index 7b71445d6..2ba3262f6 100644 --- a/netbox/project-static/styles/custom/_misc.scss +++ b/netbox/project-static/styles/custom/_misc.scss @@ -75,3 +75,15 @@ span.color-label { .btn-grey, .btn-gray { @extend .btn-secondary; } + +img.plugin-icon { + max-width: 1.4285em; + height: auto; +} + +body[data-bs-theme=dark] { + // Assuming icon is black/white line art, invert it and tone down brightness + img.plugin-icon { + filter: grayscale(100%) invert(100%) brightness(80%); + } +} diff --git a/netbox/templates/core/plugin.html b/netbox/templates/core/plugin.html index b833db037..5dfc20b88 100644 --- a/netbox/templates/core/plugin.html +++ b/netbox/templates/core/plugin.html @@ -4,7 +4,7 @@ {% load i18n %} {% load render_table from django_tables2 %} -{% block title %}{{ plugin.title_long }}{% endblock %} +{% block title %} {{ plugin.title_long }}{% endblock %} {% block object_identifier %} {% endblock object_identifier %}