diff --git a/pwnagotchi/ui/web/handler.py b/pwnagotchi/ui/web/handler.py index 2f0af11b..6bd0ed14 100644 --- a/pwnagotchi/ui/web/handler.py +++ b/pwnagotchi/ui/web/handler.py @@ -188,6 +188,11 @@ class Handler: checked = True if 'enabled' in request.form else False return 'success' if plugins.toggle_plugin(request.form['plugin'], checked) else 'failed' + if name == 'upgrade' and request.method == 'POST': + logging.info(f"Upgrading plugin: {request.form['plugin']}") + os.system(f"pwnagotchi plugins update && pwnagotchi plugins upgrade {request.form['plugin']}") + return redirect("/plugins") + if name in plugins.loaded and plugins.loaded[name] is not None and hasattr(plugins.loaded[name], 'on_webhook'): try: return plugins.loaded[name].on_webhook(subpath, request) diff --git a/pwnagotchi/ui/web/templates/plugins.html b/pwnagotchi/ui/web/templates/plugins.html index 41970fbd..39bebbdc 100644 --- a/pwnagotchi/ui/web/templates/plugins.html +++ b/pwnagotchi/ui/web/templates/plugins.html @@ -76,6 +76,11 @@ $(function(){ +
{% endfor %}