2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

Only load plugins if PLUGINS_ENABLED is true

- Hide plugin settings
- Add plugin support status to "stats" dialog
This commit is contained in:
Oliver
2022-01-11 13:39:47 +11:00
parent 31df4eae83
commit 8aec055e6c
7 changed files with 68 additions and 15 deletions

View File

@ -39,14 +39,16 @@
{% include "InvenTree/settings/build.html" %}
{% include "InvenTree/settings/po.html" %}
{% include "InvenTree/settings/so.html" %}
{% include "InvenTree/settings/plugin.html" %}
{% if plugins_enabled %}
{% include "InvenTree/settings/plugin.html" %}
{% plugin_list as pl_list %}
{% for plugin_key, plugin in pl_list.items %}
{% if plugin.registered_mixins %}
{% include "InvenTree/settings/plugin_settings.html" %}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
@ -333,9 +335,11 @@ $("#import-part").click(function() {
launchModalForm("{% url 'api-part-import' %}?reset", {});
});
{% if plugins_enabled %}
$("#install-plugin").click(function() {
installPlugin();
});
{% endif %}
enableSidebar('settings');

View File

@ -47,15 +47,16 @@
{% trans "Sales Orders" as text %}
{% include "sidebar_item.html" with label='sales-order' text=text icon="fa-truck" %}
{% if plugins_enabled %}
{% include "sidebar_header.html" with text="Plugin Settings" %}
{% include "sidebar_item.html" with label='plugin' text="Plugins" icon="fa-plug" %}
{% plugin_list as pl_list %}
{% for plugin_key, plugin in pl_list.items %}
{% if plugin.registered_mixins %}
{% include "sidebar_item.html" with label='plugin-'|add:plugin_key text=plugin.human_name %}
{% endif %}
{% if plugin.registered_mixins %}
{% include "sidebar_item.html" with label='plugin-'|add:plugin_key text=plugin.human_name %}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}

View File

@ -34,6 +34,18 @@
<td>{% trans "Server is deployed using docker" %}</td>
</tr>
{% endif %}
<tr>
<td><span class='fas fa-plug'></span></td>
<td>{% trans "Plugin Support" %}</td>
<td>
{% plugins_enabled as p_en %}
{% if p_en %}
<span class='badge rounded-pill bg-success'>{% trans "Plugin support enabled" %}</span>
{% else %}
<span class='badge rounded-pill bg-warning'>{% trans "Plugin support disabled" %}</span>
{% endif %}
</td>
</tr>
{% if user.is_staff %}
<tr>
<td><span class='fas fa-server'></span></td>