You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kmftools/delfland/webhooktest/app/templates/trace.html

29 lines
691 B

<!DOCTYPE html>
<html>
<head>
<title>Live Webhook Trace</title>
<style>
pre { background: #eee; padding: 8px; border-radius: 5px; }
</style>
</head>
<body>
<h2>Ontvangen Webhookberichten (live)</h2>
<ul id="messages">
{% for msg in messages %}
<li><pre>{{ msg }}</pre></li>
{% endfor %}
</ul>
<script>
const ws = new WebSocket("ws://" + location.host + "/ws/trace");
ws.onmessage = function(event) {
const msg = document.createElement("li");
const pre = document.createElement("pre");
pre.innerText = event.data;
msg.appendChild(pre);
document.getElementById("messages").prepend(msg);
};
</script>
</body>
</html>