Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

17169 use config_name for matching in plugin catalog #17172

Merged
merged 2 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions netbox/core/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ def get_local_plugins(plugins=None):
plugin_config: PluginConfig = plugin.config

local_plugins[plugin_config.name] = Plugin(
slug=plugin_config.name,
config_name=plugin_config.name,
title_short=plugin_config.verbose_name,
title_long=plugin_config.verbose_name,
tag_line=plugin_config.description,
description_short=plugin_config.description,
is_local=True,
Expand Down Expand Up @@ -181,7 +182,7 @@ def make_plugin_dict():
author = None

# Populate plugin data
plugins[data['slug']] = Plugin(
plugins[data['config_name']] = Plugin(
id=data['id'],
status=data['status'],
title_short=data['title_short'],
Expand Down
8 changes: 4 additions & 4 deletions netbox/core/tables/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class Meta(BaseTable.Meta):


class CatalogPluginTable(BaseTable):
title_short = tables.Column(
linkify=('core:plugin', [tables.A('slug')]),
title_long = tables.Column(
linkify=('core:plugin', [tables.A('config_name')]),
verbose_name=_('Name')
)
author = tables.Column(
Expand Down Expand Up @@ -69,11 +69,11 @@ class CatalogPluginTable(BaseTable):
class Meta(BaseTable.Meta):
empty_text = _('No plugin data found')
fields = (
'title_short', 'author', 'is_local', 'is_installed', 'is_certified', 'created_at', 'updated_at',
'title_long', 'author', 'is_local', 'is_installed', 'is_certified', 'created_at', 'updated_at',
'installed_version',
)
default_columns = (
'title_short', 'author', 'is_local', 'is_installed', 'is_certified', 'created_at', 'updated_at',
'title_long', 'author', 'is_local', 'is_installed', 'is_certified', 'created_at', 'updated_at',
)
# List installed plugins first, then certified plugins, then
# everything else (with each tranche ordered alphabetically)
Expand Down
4 changes: 2 additions & 2 deletions netbox/templates/core/plugin.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% load form_helpers %}
{% load i18n %}

{% block title %}{{ plugin.title_short }}{% endblock %}
{% block title %}{{ plugin.title_long }}{% endblock %}

{% block object_identifier %}
{% endblock object_identifier %}
Expand Down Expand Up @@ -51,7 +51,7 @@ <h2 class="card-header">{% trans "Plugin Details" %}</h2>
<table class="table table-hover attr-table">
<tr>
<th scope="row">{% trans "Name" %}</th>
<td>{{ plugin.title_short }}</td>
<td>{{ plugin.title_long }}</td>
</tr>
<tr>
<th scope="row">{% trans "Summary" %}</th>
Expand Down