Просмотр исходного кода

17169 use config_name for matching in plugin catalog (#17172)

* 17169 use config_name for matching

* 17169 remove cache buster
Arthur Hanson 1 год назад
Родитель
Сommit
93a13ce311
3 измененных файлов с 9 добавлено и 8 удалено
  1. 3 2
      netbox/core/plugins.py
  2. 4 4
      netbox/core/tables/plugins.py
  3. 2 2
      netbox/templates/core/plugin.html

+ 3 - 2
netbox/core/plugins.py

@@ -81,8 +81,9 @@ def get_local_plugins(plugins=None):
         plugin_config: PluginConfig = plugin.config
         plugin_config: PluginConfig = plugin.config
 
 
         local_plugins[plugin_config.name] = Plugin(
         local_plugins[plugin_config.name] = Plugin(
-            slug=plugin_config.name,
+            config_name=plugin_config.name,
             title_short=plugin_config.verbose_name,
             title_short=plugin_config.verbose_name,
+            title_long=plugin_config.verbose_name,
             tag_line=plugin_config.description,
             tag_line=plugin_config.description,
             description_short=plugin_config.description,
             description_short=plugin_config.description,
             is_local=True,
             is_local=True,
@@ -181,7 +182,7 @@ def get_catalog_plugins():
                     author = None
                     author = None
 
 
                 # Populate plugin data
                 # Populate plugin data
-                plugins[data['slug']] = Plugin(
+                plugins[data['config_name']] = Plugin(
                     id=data['id'],
                     id=data['id'],
                     status=data['status'],
                     status=data['status'],
                     title_short=data['title_short'],
                     title_short=data['title_short'],

+ 4 - 4
netbox/core/tables/plugins.py

@@ -39,8 +39,8 @@ class PluginVersionTable(BaseTable):
 
 
 
 
 class CatalogPluginTable(BaseTable):
 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')
         verbose_name=_('Name')
     )
     )
     author = tables.Column(
     author = tables.Column(
@@ -69,11 +69,11 @@ class CatalogPluginTable(BaseTable):
     class Meta(BaseTable.Meta):
     class Meta(BaseTable.Meta):
         empty_text = _('No plugin data found')
         empty_text = _('No plugin data found')
         fields = (
         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',
             'installed_version',
         )
         )
         default_columns = (
         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
         # List installed plugins first, then certified plugins, then
         # everything else (with each tranche ordered alphabetically)
         # everything else (with each tranche ordered alphabetically)

+ 2 - 2
netbox/templates/core/plugin.html

@@ -3,7 +3,7 @@
 {% load form_helpers %}
 {% load form_helpers %}
 {% load i18n %}
 {% load i18n %}
 
 
-{% block title %}{{ plugin.title_short }}{% endblock %}
+{% block title %}{{ plugin.title_long }}{% endblock %}
 
 
 {% block object_identifier %}
 {% block object_identifier %}
 {% endblock object_identifier %}
 {% endblock object_identifier %}
@@ -51,7 +51,7 @@
           <table class="table table-hover attr-table">
           <table class="table table-hover attr-table">
             <tr>
             <tr>
               <th scope="row">{% trans "Name" %}</th>
               <th scope="row">{% trans "Name" %}</th>
-              <td>{{ plugin.title_short }}</td>
+              <td>{{ plugin.title_long }}</td>
             </tr>
             </tr>
             <tr>
             <tr>
               <th scope="row">{% trans "Summary" %}</th>
               <th scope="row">{% trans "Summary" %}</th>