19073 review changes

This commit is contained in:
Arthur 2025-04-07 09:00:44 -07:00
parent 4b481cbacf
commit c0b889ceee
4 changed files with 10 additions and 17 deletions

View File

@ -37,16 +37,12 @@ Note that a plugin must be listed in `PLUGINS` for its configuration to take eff
Default: Empty 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 ```python
PLUGINS_TABLE_CONFIG = { PLUGINS_CATALOG_CONFIG = {
'plugin1': { 'hidden': ['plugin1'],
'hidden': True, 'unlinked': ['plugin2'],
},
'plugin2': {
'disabled': True,
},
} }
``` ```

View File

@ -110,14 +110,11 @@ def get_local_plugins(plugins=None):
plugins[k] = v plugins[k] = v
# Update plugin table config for hidden and disabled plugins # 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(): for k, v in plugins.items():
v.hidden = False v.hidden = k in hidden
v.disabled = False v.disabled = k in unlinked
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']
return plugins return plugins

View File

@ -43,7 +43,7 @@ class PluginVersionTable(BaseTable):
class CatalogPluginTable(BaseTable): class CatalogPluginTable(BaseTable):
title_long = tables.Column( title_long = tables.Column(
verbose_name=_('Name') verbose_name=_('Name'),
) )
author = tables.Column( author = tables.Column(
accessor=tables.A('author__name'), accessor=tables.A('author__name'),

View File

@ -141,7 +141,7 @@ MEDIA_ROOT = getattr(configuration, 'MEDIA_ROOT', os.path.join(BASE_DIR, 'media'
METRICS_ENABLED = getattr(configuration, 'METRICS_ENABLED', False) METRICS_ENABLED = getattr(configuration, 'METRICS_ENABLED', False)
PLUGINS = getattr(configuration, 'PLUGINS', []) PLUGINS = getattr(configuration, 'PLUGINS', [])
PLUGINS_CONFIG = getattr(configuration, 'PLUGINS_CONFIG', {}) 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']) PROXY_ROUTERS = getattr(configuration, 'PROXY_ROUTERS', ['utilities.proxy.DefaultProxyRouter'])
QUEUE_MAPPINGS = getattr(configuration, 'QUEUE_MAPPINGS', {}) QUEUE_MAPPINGS = getattr(configuration, 'QUEUE_MAPPINGS', {})
REDIS = getattr(configuration, 'REDIS') # Required REDIS = getattr(configuration, 'REDIS') # Required