Crude "local launch" button

This commit is contained in:
Régis Behmo 2025-01-09 18:49:49 +01:00
parent 8a6a54b04d
commit fa34d29a79
3 changed files with 9 additions and 1 deletions

View File

@ -100,6 +100,12 @@ async def config_unset(name: str) -> WerkzeugResponse:
# return redirect(url_for("cli_logs"))
@app.post("/cli/local/launch")
async def cli_local_launch() -> WerkzeugResponse:
tutorclient.CliPool.run_parallel(app, ["local", "launch", "--non-interactive"])
return redirect(url_for("cli_logs"))
@app.get("/cli/logs")
async def cli_logs() -> str:
return await render_template("cli_logs.html", **shared_template_context())

View File

@ -1,2 +1 @@
SHORT_SLEEP_SECONDS = 0.1

View File

@ -44,6 +44,9 @@
{% for plugin in installed_plugins %}
<li><a href="{{ url_for('plugin', name=plugin) }}">{{ plugin }} {% if plugin in enabled_plugins %} ✅{% endif %}</a></li>
{% endfor %}
<form action="{{ url_for('cli_local_launch') }}" method="POST">
<button type="submit">Launch (local)</button>
</form>
<form action="{{ url_for('cli_stop') }}" method="POST">
<button type="submit">Stop</button>
</form>