From fb6c7d7619323b986761032bd2d6bc28c48bdf88 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Date: Mon, 19 Aug 2024 23:01:54 +0700 Subject: [PATCH] 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 --- netbox/core/plugins.py | 1 + netbox/core/tables/plugins.py | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/netbox/core/plugins.py b/netbox/core/plugins.py index 98801d7e9..1fcb37f2b 100644 --- a/netbox/core/plugins.py +++ b/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 diff --git a/netbox/core/tables/plugins.py b/netbox/core/tables/plugins.py index 30c7ad408..96c612366 100644 --- a/netbox/core/tables/plugins.py +++ b/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)