Repository navigation
Troubleshooting
Install from lcars-ui/:
cd LCARS-WebUI/lcars-ui
pip install -e ".[dev]"Or run source examples with:
PYTHONPATH=src python examples/dashboard.pylcars.run(ui, port=8010)For examples:
LCARS_PORT=8010 PYTHONPATH=src python examples/dashboard.pyUse a stable explicit id:
if lcars.button("Refresh", id="refresh"):
lcars.notify("Refresh clicked.")Check that custom clients send the same action id.
Likely cause: the widget id changed between runs.
gain = lcars.number_input("Sensor Gain", value=5.0, id="sensor-gain")Every widget id must be unique in one ui() call.
lcars.metric("Core", "OK", id="core-status")
lcars.progress("Core Load", 72, id="core-load")Check that:
- The target widget exists in the current manifest.
- The target has an explicit id.
- The update is inside a button branch or live callback.
- The field name matches the widget model.
lcars.metric("Core Output", "87%", id="core-output")
if lcars.button("Refresh", id="refresh"):
lcars.update("core-output", value="91%")Move effects under the relevant action branch:
if lcars.button("Acknowledge", id="ack"):
lcars.notify("Acknowledged.")Forms can contain input widgets only. Move display widgets outside.
lcars.text("Configure warp parameters")
with lcars.form("Warp", action_id="warp-submit", id="warp-form"):
lcars.number_input("Warp Factor", id="warp-factor")lcars.form() does not currently return a submit flag. Use inputs and a button.
warp = lcars.number_input("Warp Factor", value=5.0, id="warp-factor")
if lcars.button("Commit Warp", id="commit-warp"):
lcars.append_log("ops-log", f"warp={warp:.2f}")Valid:
lcars.chart([1, 2, 3], title="Valid")
lcars.chart({"A": [1, 2], "B": [2, 3]}, title="Also Valid")Chart lists must be numeric.
For list[dict], table headers come from the first row. Put every desired column in the
first row.
rows = [
{"System": "Warp Core", "State": "Nominal", "Load": "87%"},
{"System": "Computer", "State": "Synced", "Load": "42%"},
]Only one live callback is supported. Combine periodic work.
@lcars.live(interval=5.0)
def poll() -> None:
update_core()
update_log()Catch unreliable sources yourself:
@lcars.live(interval=5.0)
def poll() -> None:
try:
value = read_sensor()
except Exception as exc:
lcars.append_log("ops-log", f"sensor read failed: {exc}")
return
lcars.update("sensor", value=str(value))Microphone access requires HTTPS except on localhost. Make sure /lcars/upload/audio is
allowed by your proxy.
Verify the reverse proxy forwards upgrades for /lcars/ws. SSE and HTTP fallbacks can
keep the app usable, but WebSocket should be available.
GitHub Wikis are separate git repositories. Updating a checked-in wiki/ directory in
the main repo does not update the live Wiki tab. Push to:
https://github.com/darsrc/LCARS-WebUI.wiki.gitSee Also: Getting Started · Deployment · Reference