webapi-eca/webpages/public/push_event.html
Dominic Bosch 1342d0b2de Events can now be pushed into the engine via webpage.
The events are now queued through the DB.
2013-11-28 19:14:05 +01:00

41 lines
No EOL
982 B
HTML

<!DOCTYPE HTML>
<html>
<head>
<title>Invoke an event</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script src='//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js' type='text/javascript'></script>
</head>
<body>
<div id="mainbody">
<div id="pagetitle">Invoke an Event</div>
<p>
<textarea id="textarea_event" rows="20" cols="50">
{
"event": "mail",
"eventid": "mail_0",
"payload": {
"subject": "hello"
}
}
</textarea>
</p>
<p>
<button id="but_submit">invoke</button>
</p>
</div>
<script>
//{ \"event\": \"mail\", \"eventid\": \"0\",... }"
$('#but_submit').click(function() {
$.post('../event', JSON.parse($('#textarea_event').val()))
.done(function(data) {
alert(data);
})
.fail(function(err) {
console.log(err);
alert('Posting of event failed: ' + err);
});
});
</script>
</body>
</html>