mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-10-07 07:36:37 +00:00
Merge remote-tracking branch 'origin/main' into claude/ponytail-audit-e181d9
# Conflicts: # CHANGELOG.md # src/plugin_system/plugin_catalog.py # web_interface/app.py
This commit is contained in:
+11
-1
@@ -159,7 +159,17 @@ schema_manager = SchemaManager(
|
||||
# saves reach the running plugins through the display's config watcher; what
|
||||
# the display knows at run time (health, metrics, errors, current mode) it
|
||||
# publishes to the shared cache. See docs/ARCHITECTURE.md.
|
||||
plugin_catalog = PluginCatalog(plugins_dir=plugins_dir)
|
||||
def _catalog_runtime_view():
|
||||
"""The display's runtime view, for the catalog's mode lookups. Imported
|
||||
on call, as the startup reconciliation below imports it."""
|
||||
from web_interface.blueprints.api_v3 import _plugin_runtime_view
|
||||
return _plugin_runtime_view()
|
||||
|
||||
|
||||
plugin_catalog = PluginCatalog(
|
||||
plugins_dir=plugins_dir,
|
||||
runtime_source=_catalog_runtime_view,
|
||||
)
|
||||
|
||||
# Initialize operation queue for plugin operations
|
||||
operation_queue = PluginOperationQueue(max_history=500)
|
||||
|
||||
@@ -153,10 +153,12 @@ def get_display_modes():
|
||||
same list the force-display dialog offers, from the source that owns it.
|
||||
|
||||
Knowing each mode's plugin_id also matters because /display/on-demand/start
|
||||
falls back to find_plugin_for_mode when plugin_id is omitted, and that
|
||||
lookup only sees modes declared in a static manifest -- a plugin whose
|
||||
modes are generated (each installed Starlark app is one) 404s there.
|
||||
Sending the plugin_id from this list skips the lookup entirely.
|
||||
falls back to find_plugin_for_mode when plugin_id is omitted. While the
|
||||
display is running, both that lookup and this list use the modes it
|
||||
registered, so modes a plugin generates from its config (each installed
|
||||
Starlark app, each soccer custom league) are found (#668); with the
|
||||
display stopped they see only what manifests declare. Sending the
|
||||
plugin_id from this list skips the lookup entirely.
|
||||
|
||||
Query params:
|
||||
include_disabled: '1' to list modes of disabled plugins too. They can
|
||||
@@ -277,6 +279,15 @@ def start_on_demand_display():
|
||||
if not resolved_plugin:
|
||||
return jsonify({'status': 'error', 'message': f'Mode {resolved_mode} not found'}), 404
|
||||
|
||||
# The display matches mode names exactly: pass the registered spelling
|
||||
# when the caller's differs only in case.
|
||||
if api_v3.plugin_catalog and resolved_plugin and resolved_mode:
|
||||
wanted = resolved_mode.strip().lower()
|
||||
for registered in api_v3.plugin_catalog.get_plugin_display_modes(resolved_plugin):
|
||||
if isinstance(registered, str) and registered.lower() == wanted:
|
||||
resolved_mode = registered
|
||||
break
|
||||
|
||||
# On-demand works with disabled plugins: the running display loads one
|
||||
# for the session and unloads it afterwards, leaving config.json alone
|
||||
# (DisplayController._load_plugin_for_on_demand). Logged for debugging.
|
||||
|
||||
@@ -530,11 +530,13 @@ def install_plugin():
|
||||
)
|
||||
|
||||
branch_msg = f" (branch: {branch})" if branch else ""
|
||||
# plugin_id: the id to enable it by (see _installed_plugin_id).
|
||||
# plugin_id: the id to enable it by, and the id its config
|
||||
# section is under (see _installed_plugin_id).
|
||||
installed_id = _installed_plugin_id(plugin_id)
|
||||
return {'success': True,
|
||||
'message': f'Plugin {plugin_id} installed successfully{branch_msg}',
|
||||
'plugin_id': _installed_plugin_id(plugin_id),
|
||||
**_store_restart_fields('install', _plugin_enabled_in_config(plugin_id))}
|
||||
'plugin_id': installed_id,
|
||||
**_store_restart_fields('install', _plugin_enabled_in_config(installed_id))}
|
||||
else:
|
||||
error_msg = f'Failed to install plugin {plugin_id}'
|
||||
if branch:
|
||||
@@ -588,10 +590,11 @@ def install_plugin():
|
||||
)
|
||||
|
||||
branch_msg = f" (branch: {branch})" if branch else ""
|
||||
installed_id = _installed_plugin_id(plugin_id)
|
||||
return success_response(
|
||||
message=f'Plugin installed successfully{branch_msg}',
|
||||
extra={'plugin_id': _installed_plugin_id(plugin_id),
|
||||
**_store_restart_fields('install', _plugin_enabled_in_config(plugin_id))})
|
||||
extra={'plugin_id': installed_id,
|
||||
**_store_restart_fields('install', _plugin_enabled_in_config(installed_id))})
|
||||
else:
|
||||
error_msg = f'Failed to install plugin {plugin_id}'
|
||||
if branch:
|
||||
|
||||
@@ -150,8 +150,9 @@ def get_installed_plugins():
|
||||
vegas_participation, vegas_participation_source = _vegas_participation(
|
||||
plugin_id, plugin_config, plugin_info)
|
||||
|
||||
# The modes the manifest declares, from the catalog as /display/modes
|
||||
# and on-demand/start read them. The on-demand modal offers these;
|
||||
# The plugin's modes, from the catalog as /display/modes and
|
||||
# on-demand/start read them: what the running display registered,
|
||||
# else what the manifest declares. The on-demand modal offers these;
|
||||
# without them it offered only the plugin id, which the display
|
||||
# turns into the first mode. Strings only: a manifest is hand-edited.
|
||||
declared_modes = api_v3.plugin_catalog.get_plugin_display_modes(plugin_id)
|
||||
|
||||
Reference in New Issue
Block a user