mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
add plugin install button
This commit is contained in:
parent
5aa146127c
commit
5dbc5d141a
@ -118,6 +118,7 @@ translated_javascript_urls = [
|
||||
url(r'^part.js', DynamicJsView.as_view(template_name='js/translated/part.js'), name='part.js'),
|
||||
url(r'^report.js', DynamicJsView.as_view(template_name='js/translated/report.js'), name='report.js'),
|
||||
url(r'^stock.js', DynamicJsView.as_view(template_name='js/translated/stock.js'), name='stock.js'),
|
||||
url(r'^plugin.js', DynamicJsView.as_view(template_name='js/translated/plugin.js'), name='plugin.js'),
|
||||
url(r'^tables.js', DynamicJsView.as_view(template_name='js/translated/tables.js'), name='tables.js'),
|
||||
url(r'^table_filters.js', DynamicJsView.as_view(template_name='js/translated/table_filters.js'), name='table_filters.js'),
|
||||
]
|
||||
|
@ -28,8 +28,11 @@
|
||||
</div>
|
||||
|
||||
<h4>{% trans "Plugin list" %}
|
||||
<div id="page-actions" class="btn-group" role="group">
|
||||
{% url 'admin:plugin_pluginconfig_changelist' as url %}
|
||||
{% include "admin_button.html" with url=url %}
|
||||
<button class="btn btn-success" id="install-plugin" title="{% trans 'Install Plugin' %}"><span class='fas fa-plus-circle'></span> {% trans "Install Plugin" %}</button>
|
||||
</div>
|
||||
</h4>
|
||||
|
||||
<div class='table-responsive'>
|
||||
|
@ -322,6 +322,10 @@ $("#import-part").click(function() {
|
||||
launchModalForm("{% url 'api-part-import' %}?reset", {});
|
||||
});
|
||||
|
||||
$("#install-plugin").click(function() {
|
||||
installPlugin();
|
||||
});
|
||||
|
||||
enableSidebar('settings');
|
||||
|
||||
{% endblock %}
|
||||
|
@ -177,6 +177,7 @@
|
||||
<script type='text/javascript' src="{% i18n_static 'part.js' %}"></script>
|
||||
<script type='text/javascript' src="{% i18n_static 'report.js' %}"></script>
|
||||
<script type='text/javascript' src="{% i18n_static 'stock.js' %}"></script>
|
||||
<script type='text/javascript' src="{% i18n_static 'plugin.js' %}"></script>
|
||||
<script type='text/javascript' src="{% i18n_static 'tables.js' %}"></script>
|
||||
<script type='text/javascript' src="{% i18n_static 'table_filters.js' %}"></script>
|
||||
|
||||
|
26
InvenTree/templates/js/translated/plugin.js
Normal file
26
InvenTree/templates/js/translated/plugin.js
Normal file
@ -0,0 +1,26 @@
|
||||
{% load i18n %}
|
||||
{% load inventree_extras %}
|
||||
|
||||
/* globals
|
||||
constructForm,
|
||||
*/
|
||||
|
||||
/* exported
|
||||
installPlugin,
|
||||
*/
|
||||
|
||||
function installPlugin() {
|
||||
constructForm(`/api/plugin/install/`, {
|
||||
method: 'POST',
|
||||
title: '{% trans "Install Plugin" %}',
|
||||
fields: {
|
||||
url: {},
|
||||
packagename: {},
|
||||
confirm: {},
|
||||
},
|
||||
onSuccess: function(data) {
|
||||
msg = '{% trans "The Plugin was installed" %}';
|
||||
showMessage(msg, {style: 'success', details: data.result, timeout: 30000});
|
||||
}
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue
Block a user