Skip to content

Commit

Permalink
Add button to send test notification
Browse files Browse the repository at this point in the history
  • Loading branch information
André Martins authored and tesladodger committed Oct 18, 2024
1 parent 6e2511b commit 585ee35
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions internal/web/public/js/notify.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
async function testNotifications() {

const url = '/api/test_notify'
await fetch(url, { method: 'post' })
}
4 changes: 3 additions & 1 deletion internal/web/templates/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
</tr>
<tr>
<td><button type="submit" class="btn btn-primary">Save</button></td>
<td><button type="button" style="float: right;" class="btn btn-success" onclick="testNotifications()">Test notifications</button></td>
<td></td>
</tr>
</form>
Expand Down Expand Up @@ -199,6 +200,7 @@
</div>
</div>
</div>
<script src="/fs/public/js/notify.js"></script>

{{ template "footer.html" }}
{{ end }}
{{ end }}

0 comments on commit 585ee35

Please sign in to comment.