From d724d3043bf54faf434c14c5910a0ca9b068ea3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Val=C3=A9rio?= Date: Sun, 7 Apr 2019 22:17:19 +0100 Subject: [PATCH] added a button to quickly copy the callback url to the clipboard --- callbacks/static/js/viewer.js | 16 +++++++++++++++- callbacks/templates/callbacks/check.html | 19 ++++++++++++++++--- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/callbacks/static/js/viewer.js b/callbacks/static/js/viewer.js index 8951fda..be9b8c2 100644 --- a/callbacks/static/js/viewer.js +++ b/callbacks/static/js/viewer.js @@ -8,7 +8,7 @@ function getCallbackCode() { return urlParams.get("cb"); } -function setCallbackUrl(callbackCode) { +function setCallbackUrl() { let protocol = document.location.protocol; let host = document.location.host; let submitURL = `${protocol}//${host}/${getCallbackCode()}`; @@ -88,6 +88,20 @@ var requestList = new Vue({ } }); +var callbackDetails = new Vue({ + el: "#callback-details", + delimiters: ["[[", "]]"], + data: {}, + methods: { + copytoclipboard: function() { + var url = document.getElementById("callback-uuid-field"); + url.select(); + document.execCommand("copy"); + alert("The callback url was copied to your clipboard."); + } + } +}); + /* Prepare the page for action */ diff --git a/callbacks/templates/callbacks/check.html b/callbacks/templates/callbacks/check.html index f0c9023..6047714 100644 --- a/callbacks/templates/callbacks/check.html +++ b/callbacks/templates/callbacks/check.html @@ -8,13 +8,18 @@ rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.2/css/bulma.min.css" /> + Webhook Logger
-
+

Webhook Logger

@@ -22,8 +27,8 @@ webhooks

Use the following URL as your webhook callback:

-
-
+
+
+ + + +
+