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

17174 add version to plugin catalog (#17192)

* 17174 add version to plugin catalog

* Retain the created & updated columns for optional use

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
Arthur Hanson 1 год назад
Родитель
Сommit
fb6c7d7619
2 измененных файлов с 8 добавлено и 3 удалено
  1. 1 0
      netbox/core/plugins.py
  2. 7 3
      netbox/core/tables/plugins.py

+ 1 - 0
netbox/core/plugins.py

@@ -96,6 +96,7 @@ def get_local_plugins(plugins=None):
         if k in plugins:
             plugins[k].is_local = True
             plugins[k].is_installed = True
+            plugins[k].installed_version = v.installed_version
         else:
             plugins[k] = v
 

+ 7 - 3
netbox/core/tables/plugins.py

@@ -63,17 +63,21 @@ class CatalogPluginTable(BaseTable):
         verbose_name=_('Updated')
     )
     installed_version = tables.Column(
-        verbose_name=_('Installed version')
+        verbose_name=_('Installed Version')
+    )
+    latest_version = tables.Column(
+        accessor=tables.A('release_latest__version'),
+        verbose_name=_('Latest Version')
     )
 
     class Meta(BaseTable.Meta):
         empty_text = _('No plugin data found')
         fields = (
             'title_long', 'author', 'is_local', 'is_installed', 'is_certified', 'created_at', 'updated_at',
-            'installed_version',
+            'installed_version', 'latest_version',
         )
         default_columns = (
-            'title_long', 'author', 'is_local', 'is_installed', 'is_certified', 'created_at', 'updated_at',
+            'title_long', 'author', 'is_local', 'is_installed', 'is_certified', 'installed_version', 'latest_version',
         )
         # List installed plugins first, then certified plugins, then
         # everything else (with each tranche ordered alphabetically)