54 lines
1.8 KiB
HTML
54 lines
1.8 KiB
HTML
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Javascript Spaghetti Profiler</title>
|
|
<link rel="stylesheet" type="text/css" href="/public/styles/main.css">
|
|
<link rel="stylesheet" type="text/css" href="/public/styles/launchTest.css">
|
|
<script src="/socket.io/socket.io.js"></script>
|
|
</head>
|
|
<body>
|
|
<h1>Yellow Lab <span class="icon-lab"></span> Tools</h1>
|
|
|
|
<div id="status"></div>
|
|
|
|
<div>%%TEST_URL%%</div>
|
|
|
|
<div class="footer">
|
|
<p><b>Yellow Lab Tools</b> is an open source project by <a href="http://www.gaelmetais.com" target="_blank">Gaël Métais</a>, based on <a href="https://github.com/macbre/phantomas" target="_blank">Phantomas</a>.<br>If you like it, <a href="https://github.com/gmetais/YellowLabTools" target="_blank" class="star">give it a <span>★</span> on GitHub</a>!</p>
|
|
</div>
|
|
|
|
<script>
|
|
var testId = '%%TEST_ID%%';
|
|
var statusElement = document.getElementById('status');
|
|
var socket = io();
|
|
|
|
function askStatus() {
|
|
socket.emit('waiting', testId);
|
|
}
|
|
|
|
socket.on('position', function(position) {
|
|
if (position === 0) {
|
|
statusElement.innerHTML = 'Test is running...';
|
|
} else {
|
|
statusElement.innerHTML = 'Waiting behind ' + (position) + ' other tests';
|
|
}
|
|
});
|
|
|
|
socket.on('complete', function() {
|
|
statusElement.innerHTML = 'Test complete';
|
|
window.location.replace('/results/' + testId);
|
|
});
|
|
|
|
socket.on('failed', function() {
|
|
statusElement.innerHTML = 'Test failed';
|
|
window.location.replace('/results/' + testId);
|
|
});
|
|
|
|
socket.on('404', function() {
|
|
statusElement.innerHTML = 'Test not found';
|
|
});
|
|
|
|
askStatus();
|
|
</script>
|
|
</body>
|
|
</html> |