Navigation reflects plugin enable/disable immediately
The nav endpoint now skips disabled plugins (checks the registry), so disabling a plugin removes it from the menu right away without a restart. Its API routes remain registered until the next restart (Flask cannot unregister a blueprint at runtime), but users no longer see links to it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -120,9 +120,14 @@ def get_navigation():
|
||||
{'name': 'Map', 'icon': 'map', 'route': '/map', 'position': 4},
|
||||
])
|
||||
|
||||
# Collect navigation items from all plugins
|
||||
# Collect navigation items from enabled plugins. Disabling persists to the
|
||||
# registry immediately, so a disabled plugin drops out of the menu right
|
||||
# away (its routes stay registered until the next restart - Flask cannot
|
||||
# unregister a blueprint at runtime).
|
||||
for name, plugin in pm.get_all_plugins().items():
|
||||
try:
|
||||
if not pm.registry.is_enabled(name):
|
||||
continue
|
||||
items = plugin.get_navigation_items()
|
||||
for item in items:
|
||||
item['plugin'] = name
|
||||
|
||||
Reference in New Issue
Block a user