Plugin Configuration
Web UI for runtime plugin management. A private section of the
ServerApplication, attached under plugins when the config recipe declares
server(plugins=True), so its endpoints live under /_server/plugins/.
Note: /_server/plugins is this configurator URL section, not
genro_asgi.plugins (the genro-routes plugin package).
Section
Plugin Configuration UI - a section of the ServerApplication.
Provides a Swagger-like interface to navigate the routing tree and configure plugins at router-level (_all_) and entry-level.
This is a private section of the server, not a separately mounted app.
When the config recipe declares root.server(plugins=True) the server
attaches this section to its already-mounted ServerApplication under the
plugins alias, so the endpoints live under /_server/plugins/.
Terminology: /_server/plugins (this configurator UI section) is NOT
src/genro_asgi/plugins/ (the package of genro-routes plugins). The
former is a URL section; the latter is Python code.
- Endpoints (relative to
/_server/plugins/): /: Index page with plugin configuration UI. /static: Static resource serving (JS files). /tree: JSON routing tree with plugin_info. /plugins: Available plugins with configure() signatures. /config: Read plugin configuration for a node. /apply: Apply a config change at runtime (no persistence). /save: Persist current runtime config to plugin_config.json. /revert: Reload config from plugin_config.json, discarding runtime changes. /logs: Read captured log entries. /clear_logs: Clear the captured log buffer.
- class genro_asgi.server.server_applications.plugin_config.plugin_config.PluginConfigSection(application)[source]
Bases:
RoutingClassPlugin configuration web UI, a section of the ServerApplication.
Attached under
pluginson the ServerApplication, so its endpoints live under/_server/plugins/. Persistence logic (load/save/apply plugin_config.json) lives on AsgiServer; this section is a thin GUI layer that delegates to server methods.Note
Parent (dual relationship): the ServerApplication, stored as
self.application. The AsgiServer is reached viaself.application.server.- __init__(application)[source]
Initialize the section and bind it to its ServerApplication.
- Parameters:
application (
ServerApplication) – The ServerApplication this section belongs to (dual relationship). The AsgiServer isapplication.server.
- apply(router_path='', plugin_name='', target='_all_', **config_values)[source]
Apply a plugin config change at runtime without persisting.
- Parameters:
- Returns:
True on success, or “error” key on failure.
- Return type:
- logs(entry='', since='0', limit=100)[source]
Return captured log entries, optionally filtered by entry name.
- static(file='')[source]
Serve a static JS resource from this section’s resources directory.
- Parameters:
file (
str) – Resource filename (e.g. “tree.js”). Must be a plain name withinresources/— path traversal is rejected.- Raises:
HTTPNotFound – If the file name is unsafe or the file is missing.
- Return type: