mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-28 03:16:25 -06:00
Add failed_to_load logic
This commit is contained in:
parent
d802f93717
commit
26bac97db2
@ -66,6 +66,7 @@ class Plugin:
|
|||||||
release_recent_history: list[PluginVersion] = field(default_factory=list)
|
release_recent_history: list[PluginVersion] = field(default_factory=list)
|
||||||
is_local: bool = False # extra field for locally installed plugins
|
is_local: bool = False # extra field for locally installed plugins
|
||||||
is_installed: bool = False
|
is_installed: bool = False
|
||||||
|
failed_to_load: bool = False
|
||||||
installed_version: str = ''
|
installed_version: str = ''
|
||||||
netbox_min_version: str = ''
|
netbox_min_version: str = ''
|
||||||
netbox_max_version: str = ''
|
netbox_max_version: str = ''
|
||||||
@ -93,7 +94,8 @@ def get_local_plugins(plugins=None):
|
|||||||
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,
|
||||||
is_installed=plugin_name in registry['plugins']['installed'],
|
is_installed=True,
|
||||||
|
failed_to_load=plugin_name not in registry['plugins']['installed'],
|
||||||
installed_version=installed_version,
|
installed_version=installed_version,
|
||||||
netbox_min_version=plugin_config.min_version,
|
netbox_min_version=plugin_config.min_version,
|
||||||
netbox_max_version=plugin_config.max_version,
|
netbox_max_version=plugin_config.max_version,
|
||||||
|
@ -719,7 +719,7 @@ class PluginActiveColumn(BooleanColumn):
|
|||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
def render(self, value, record, table, **kwargs):
|
def render(self, value, record, table, **kwargs):
|
||||||
if not value and self.false_mark:
|
if record.failed_to_load:
|
||||||
tooltip = (
|
tooltip = (
|
||||||
f'Could not load due to NetBox version incompatibility. '
|
f'Could not load due to NetBox version incompatibility. '
|
||||||
f'Min version: {record.netbox_min_version}, max version: {record.netbox_max_version}'
|
f'Min version: {record.netbox_min_version}, max version: {record.netbox_max_version}'
|
||||||
|
Loading…
Reference in New Issue
Block a user