add workspace for installed apps
This commit is contained in:
parent
3b464fc1af
commit
930ef8e4c6
@ -72,9 +72,21 @@ async def plugin_store() -> str:
|
||||
|
||||
@app.get("/plugin/installed")
|
||||
async def installed_plugins() -> str:
|
||||
installed_plugins = tutorclient.Client.installed_plugins()
|
||||
enabled_plugins = tutorclient.Client.enabled_plugins()
|
||||
plugins: list[dict[str, str]] = [
|
||||
{
|
||||
"name": p.name,
|
||||
"url": p.url,
|
||||
"index": p.index,
|
||||
"description": markdown(p.description),
|
||||
"is_enabled": p.name in enabled_plugins,
|
||||
}
|
||||
for p in tutorclient.Client.plugins_in_store() if p.name in installed_plugins
|
||||
]
|
||||
return await render_template(
|
||||
"installed_plugins.html",
|
||||
# plugins=plugins,
|
||||
plugins=plugins,
|
||||
**shared_template_context(),
|
||||
)
|
||||
|
||||
|
||||
@ -1,33 +1,23 @@
|
||||
{% extends "index.html" %}
|
||||
{% extends "workspace_header_general.html" %}
|
||||
|
||||
{% block workspace_header %}
|
||||
<div>
|
||||
<div class="title">My Plugins</div>
|
||||
<div class="description">View all your installed plugins in one place.</div>
|
||||
</div>
|
||||
<div class="local-launch-button">
|
||||
<form action="{{ url_for('plugins_update') }}" method="POST">
|
||||
<button type="submit">Local Launch</button>
|
||||
</form>
|
||||
</div>
|
||||
{% block page_title %}Plugin Marketplace{% endblock %}
|
||||
{% block page_description %}View and install available plugins.{% endblock %}
|
||||
{% block page_button %}
|
||||
<form action="{{ url_for('plugins_update') }}" method="POST">
|
||||
<button class="btn btn-primary" type="submit">Local Launch</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
{% block workspace_content %}
|
||||
<div class="search-row">
|
||||
<div class="search-container">
|
||||
<input type="text" class="form-control search-input" placeholder="Search">
|
||||
<i class="fas fa-search search-icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <form action="{{ url_for('plugins_update') }}" method="POST">
|
||||
<button type="submit">Refresh</button>
|
||||
</form> -->
|
||||
|
||||
<div class="my-plugins-list">
|
||||
{% for plugin in installed_plugins %}
|
||||
<div class="installed-plugins-list">
|
||||
{% for plugin in plugins %}
|
||||
<div class="installed-plugin">
|
||||
<div>
|
||||
<div><a href="{{ url_for('plugin', name=plugin) }}">{{ plugin.name }}</a></div>
|
||||
<div>Edly</div>
|
||||
<div>{{ plugin.description|safe }}</div>
|
||||
</div>
|
||||
<div>
|
||||
<li>
|
||||
<a href="{{ url_for('plugin', name=plugin) }}">{{ plugin }}</a>
|
||||
<form method="POST" action="{{ url_for('plugin_toggle', name=plugin_name) }}">
|
||||
{% if plugin in enabled_plugins %}
|
||||
<input class="form-check-input" id="flexSwitchCheckChecked" type="checkbox" onchange="this.form.submit()" checked {% if is_enabled %}checked{% endif %} />
|
||||
@ -36,7 +26,7 @@
|
||||
<!-- <input class="form-check-input" id="flexSwitchCheckChecked" type="checkbox" onchange="this.form.submit()" checked /> -->
|
||||
{% endif %}
|
||||
</form>
|
||||
</li>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
@ -6,8 +6,8 @@
|
||||
<div class="page-title">{% block page_title %}{% endblock %}</div>
|
||||
<div class="page-description">{% block page_description %}{% endblock %}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div>{% block page_button %}{% endblock %}</div>
|
||||
<div class="launch-button">
|
||||
{% block page_button %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-container">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user