Skip to content

Commit

Permalink
Merge pull request #672 from dadav/feature/plugins_urls
Browse files Browse the repository at this point in the history
Add urls to plugins
  • Loading branch information
evilsocket authored Nov 29, 2019
2 parents e44ebac + f5a94fd commit ad51042
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pwnagotchi/ui/web/templates/plugins.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

{% block script %}
$(function(){
$("input[type=checkbox]").change(function(e) {
$('input[type=checkbox]').change(function(e) {
var checkbox = $(this);
var form = checkbox.closest("form");
var form = checkbox.closest('form');
var url = form.attr('action');

$.ajax({
type: "POST",
type: 'POST',
url: url,
data: form.serialize(),
success: function(data) {
Expand All @@ -28,7 +28,9 @@
{% block content %}
<div style="padding: 1em">
{% for name in database.keys() %}
<h4>{{name}}</h4>
<h4>
<a {% if name in loaded and loaded[name].on_webhook is defined %} href="/plugins/{{name}}" {% endif %}>{{name}}</a>
</h4>
<form method="POST" action="/plugins/toggle">
<input type="checkbox" data-role="flipswitch" name="enabled" id="flip-checkbox-{{name}}" data-on-text="Enabled" data-off-text="Disabled" data-wrapper-class="custom-size-flipswitch" {% if name in loaded %} checked {% endif %}>
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
Expand Down

0 comments on commit ad51042

Please sign in to comment.