mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-01 19:20:55 +00:00
add plugin install button
This commit is contained in:
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});
|
||||
}
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user