chore: simplify by removing useless ajax call
This commit is contained in:
parent
b7ff461da2
commit
bdfecd5066
@ -191,14 +191,8 @@ def run(root: str, **app_kwargs: t.Any) -> None:
|
|||||||
|
|
||||||
@app.get("/")
|
@app.get("/")
|
||||||
async def home() -> str:
|
async def home() -> str:
|
||||||
return await render_template("index.html")
|
|
||||||
|
|
||||||
|
|
||||||
@app.get("/sidebar/plugins")
|
|
||||||
async def sidebar_plugins() -> str:
|
|
||||||
# TODO get rid of this view and render from home()
|
|
||||||
return await render_template(
|
return await render_template(
|
||||||
"sidebar/_plugins.html",
|
"index.html",
|
||||||
installed_plugins=sorted(set(hooks.Filters.PLUGINS_INSTALLED.iterate())),
|
installed_plugins=sorted(set(hooks.Filters.PLUGINS_INSTALLED.iterate())),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -40,7 +40,18 @@
|
|||||||
<div class="header">
|
<div class="header">
|
||||||
Plugins
|
Plugins
|
||||||
</div>
|
</div>
|
||||||
<div class="content" hx-get="{{ url_for('sidebar_plugins') }}" hx-trigger="revealed"></div>
|
<div class="content">
|
||||||
|
<ul>
|
||||||
|
{% for plugin in installed_plugins %}
|
||||||
|
<li><a href="{{ url_for('plugin', name=plugin) }}">{{ plugin }}</a></li>
|
||||||
|
{% endfor %}
|
||||||
|
<form action="{{ url_for('tutor_cli') }}" method="POST">
|
||||||
|
<input type="hidden" name="args[]" value="local">
|
||||||
|
<input type="hidden" name="args[]" value="launch">
|
||||||
|
<button type="submit">Apply changes</button>
|
||||||
|
</form>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
|
|
||||||
<ul>
|
|
||||||
{% for plugin in installed_plugins %}
|
|
||||||
<li><a href="{{ url_for('plugin', name=plugin) }}">{{ plugin }}</a></li>
|
|
||||||
{% endfor %}
|
|
||||||
<form action="{{ url_for('tutor_cli') }}" method="POST">
|
|
||||||
<input type="hidden" name="args[]" value="local">
|
|
||||||
<input type="hidden" name="args[]" value="launch">
|
|
||||||
<button type="submit">Apply changes</button>
|
|
||||||
</form>
|
|
||||||
</ul>
|
|
||||||
Loading…
x
Reference in New Issue
Block a user