Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
37 lines (31 sloc) 816 Bytes
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset=utf-8 />
<title>remote</title>
</head>
<body>
<script src="/EventSource.js"></script>
<script>
var id = window.location.search.replace(/.*\?/, ''),
origin = null;
window.addEventListener('message', function (event) {
origin = event.origin;
if (event.data == '__init__') {
return;
}
var xhr = new XMLHttpRequest(),
params = 'data=' + encodeURIComponent(event.data);
xhr.open('POST', '/remote/' + id + '/log', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.send(params);
}, false);
setTimeout(function () {
var sse = new EventSource('/remote/' + id + '/run');
sse.onmessage = function (event) {
window.top.postMessage(event.data, origin);
};
}, 13);
</script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.