Plugin Configuration

Web UI for runtime plugin management, mounted as sys_app at /_sys/plugin_config/.

Application

Plugin Configuration UI - web interface for viewing and editing plugin config.

Provides a Swagger-like interface to navigate the routing tree and configure plugins at router-level (_all_) and entry-level.

Mountable as sys_app via config:
sys_apps:
plugin_config:

module: “genro_asgi.sys_applications.plugin_config.plugin_config_app:Application”

Endpoints:

/: Index page with plugin configuration UI. /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. /static: Static resource serving (JS, CSS).

class genro_asgi.sys_applications.plugin_config.plugin_config_app.Application(**kwargs)[source]

Bases: AsgiApplication

Plugin configuration web UI. Mountable as sys_app at /_sys/plugin_config/.

Persistence logic (load/save/apply plugin_config.json) lives on AsgiServer. This app is a thin GUI layer that delegates to server methods.

apply(router_path='', plugin_name='', target='_all_', **config_values)[source]

Apply a plugin config change at runtime without persisting.

Parameters:
  • router_path (str) – Dotted path to the router (empty = root).

  • plugin_name (str) – Name of the plugin to configure.

  • target (str) – Target slot (“_all_” or specific entry name).

  • **config_values (Any) – Plugin configuration key-value pairs.

Returns:

True on success, or “error” key on failure.

Return type:

dict[str, Any]

clear_logs()[source]

Clear the log buffer.

Returns:

True.

Return type:

dict[str, Any]

config(router_path='', entry='')[source]

Read plugin configuration for a specific router/entry.

Parameters:
  • router_path (str) – Dotted path to the router (empty = root).

  • entry (str) – Specific entry/handler name to filter (empty = all).

Return type:

dict[str, Any]

Returns:

Dict with router_path, plugin_info. Error dict if router not found.

index()[source]

Serve the plugin configuration page.

Return type:

str

logs(entry='', since='0', limit=100)[source]

Return captured log entries, optionally filtered by entry name.

Parameters:
  • entry (str) – Filter by entry/handler name (empty = all).

  • since (str) – Timestamp filter - only logs after this time.

  • limit (int) – Max entries to return.

Return type:

dict[str, Any]

Returns:

Dict with “logs” list and “server_time” timestamp.

on_init(**kwargs)[source]

Initialize log capture handler.

Parameters:

**kwargs (Any) – Parameters from config.yaml app definition.

Return type:

None

openapi_info: ClassVar[dict[str, Any]] = {'description': 'Web UI for viewing and editing plugin configuration at runtime.', 'title': 'Plugin Configuration', 'version': '1.0.0'}
plugins()[source]

Return available plugins with their configure() signatures.

Return type:

dict[str, Any]

Returns:

Dict with “plugins” key mapping plugin names to description and params.

revert()[source]

Revert runtime config to what is saved in plugin_config.json.

Returns:

True. Includes “message” if no saved config exists.

Return type:

dict[str, Any]

save()[source]

Persist current runtime plugin config to plugin_config.json.

Returns:

True and “file” path on success.

Return type:

dict[str, Any]

static(file='')[source]

Serve static resources from resources folder.

Parameters:

file (str) – Filename to serve (e.g., “config_panel.js”).

Return type:

Path

Returns:

Path to the resource file.

Raises:
tree()[source]

Return the routing tree with plugin_info for each router.

Return type:

dict[str, Any]

Returns:

Serialized routing tree dict with entries, routers, plugin_info.