mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-26 18:38:38 -06:00
19073 review changes
This commit is contained in:
parent
4b481cbacf
commit
c0b889ceee
@ -37,16 +37,12 @@ Note that a plugin must be listed in `PLUGINS` for its configuration to take eff
|
||||
|
||||
Default: Empty
|
||||
|
||||
This parameter holds configuration settings for how the individual plugins are displayed in the plugins table under Admin->System->Plugins. Declaring `hidden` as True will make it so the plugin is not shown in the table. Declaring `disabled` 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 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:
|
||||
|
||||
```python
|
||||
PLUGINS_TABLE_CONFIG = {
|
||||
'plugin1': {
|
||||
'hidden': True,
|
||||
},
|
||||
'plugin2': {
|
||||
'disabled': True,
|
||||
},
|
||||
PLUGINS_CATALOG_CONFIG = {
|
||||
'hidden': ['plugin1'],
|
||||
'unlinked': ['plugin2'],
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -110,14 +110,11 @@ def get_local_plugins(plugins=None):
|
||||
plugins[k] = v
|
||||
|
||||
# Update plugin table config for hidden and disabled plugins
|
||||
hidden = settings.PLUGINS_CATALOG_CONFIG.get('hidden', [])
|
||||
unlinked = settings.PLUGINS_CATALOG_CONFIG.get('unlinked', [])
|
||||
for k, v in plugins.items():
|
||||
v.hidden = False
|
||||
v.disabled = False
|
||||
if k in settings.PLUGINS_TABLE_CONFIG:
|
||||
if 'hidden' in settings.PLUGINS_TABLE_CONFIG[k]:
|
||||
v.hidden = settings.PLUGINS_TABLE_CONFIG[k]['hidden']
|
||||
if 'disabled' in settings.PLUGINS_TABLE_CONFIG[k]:
|
||||
v.disabled = settings.PLUGINS_TABLE_CONFIG[k]['disabled']
|
||||
v.hidden = k in hidden
|
||||
v.disabled = k in unlinked
|
||||
|
||||
return plugins
|
||||
|
||||
|
@ -43,7 +43,7 @@ class PluginVersionTable(BaseTable):
|
||||
|
||||
class CatalogPluginTable(BaseTable):
|
||||
title_long = tables.Column(
|
||||
verbose_name=_('Name')
|
||||
verbose_name=_('Name'),
|
||||
)
|
||||
author = tables.Column(
|
||||
accessor=tables.A('author__name'),
|
||||
|
@ -141,7 +141,7 @@ MEDIA_ROOT = getattr(configuration, 'MEDIA_ROOT', os.path.join(BASE_DIR, 'media'
|
||||
METRICS_ENABLED = getattr(configuration, 'METRICS_ENABLED', False)
|
||||
PLUGINS = getattr(configuration, 'PLUGINS', [])
|
||||
PLUGINS_CONFIG = getattr(configuration, 'PLUGINS_CONFIG', {})
|
||||
PLUGINS_TABLE_CONFIG = getattr(configuration, 'PLUGINS_TABLE_CONFIG', {})
|
||||
PLUGINS_CATALOG_CONFIG = getattr(configuration, 'PLUGINS_CATALOG_CONFIG', {})
|
||||
PROXY_ROUTERS = getattr(configuration, 'PROXY_ROUTERS', ['utilities.proxy.DefaultProxyRouter'])
|
||||
QUEUE_MAPPINGS = getattr(configuration, 'QUEUE_MAPPINGS', {})
|
||||
REDIS = getattr(configuration, 'REDIS') # Required
|
||||
|
Loading…
Reference in New Issue
Block a user