mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-27 02:48:38 -06:00
Rename 'unlinked' to 'static' & update docs
This commit is contained in:
parent
c0b889ceee
commit
472688eb50
@ -33,17 +33,21 @@ Note that a plugin must be listed in `PLUGINS` for its configuration to take eff
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## PLUGINS_CONFIG
|
## PLUGINS_CATALOG_CONFIG
|
||||||
|
|
||||||
Default: Empty
|
Default: Empty
|
||||||
|
|
||||||
This parameter holds configuration settings for how the individual plugins are displayed in the plugins table under Admin->System->Plugins. Adding a plugin to `hidden` will make it so the plugin is not shown in the table. Adding a plugin to `unlinked` will make it show the plugin in the table, but it won't be linked to the details and installation page for the plugin. An example configuration is shown below:
|
This parameter controls how individual plugins are displayed in the plugins catalog under Admin > System > Plugins. Adding a plugin to the `hidden` list will omit that plugin from the catalog. Adding a plugin to the `static` list will display the plugin, but not link to the plugin details or upgrade instructions.
|
||||||
|
|
||||||
|
An example configuration is shown below:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
PLUGINS_CATALOG_CONFIG = {
|
PLUGINS_CATALOG_CONFIG = {
|
||||||
'hidden': ['plugin1'],
|
'hidden': [
|
||||||
'unlinked': ['plugin2'],
|
'plugin1',
|
||||||
|
],
|
||||||
|
'static': [
|
||||||
|
'plugin2',
|
||||||
|
],
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
|
||||||
|
@ -109,12 +109,12 @@ def get_local_plugins(plugins=None):
|
|||||||
else:
|
else:
|
||||||
plugins[k] = v
|
plugins[k] = v
|
||||||
|
|
||||||
# Update plugin table config for hidden and disabled plugins
|
# Update plugin table config for hidden and static plugins
|
||||||
hidden = settings.PLUGINS_CATALOG_CONFIG.get('hidden', [])
|
hidden = settings.PLUGINS_CATALOG_CONFIG.get('hidden', [])
|
||||||
unlinked = settings.PLUGINS_CATALOG_CONFIG.get('unlinked', [])
|
static = settings.PLUGINS_CATALOG_CONFIG.get('static', [])
|
||||||
for k, v in plugins.items():
|
for k, v in plugins.items():
|
||||||
v.hidden = k in hidden
|
v.hidden = k in hidden
|
||||||
v.disabled = k in unlinked
|
v.static = k in static
|
||||||
|
|
||||||
return plugins
|
return plugins
|
||||||
|
|
||||||
|
@ -89,8 +89,7 @@ class CatalogPluginTable(BaseTable):
|
|||||||
order_by = ('-is_installed', '-is_certified', 'name')
|
order_by = ('-is_installed', '-is_certified', 'name')
|
||||||
|
|
||||||
def render_title_long(self, value, record):
|
def render_title_long(self, value, record):
|
||||||
if record.disabled:
|
if record.static:
|
||||||
return f"{value}"
|
return value
|
||||||
|
|
||||||
url = reverse('core:plugin', args=[record.config_name])
|
url = reverse('core:plugin', args=[record.config_name])
|
||||||
return mark_safe(f"<a href='{url}'>{value}</a>")
|
return mark_safe(f"<a href='{url}'>{value}</a>")
|
||||||
|
Loading…
Reference in New Issue
Block a user