103 lines
2.5 KiB
HTML
103 lines
2.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Quarc E2E Pipes Test</title>
|
|
<style>
|
|
body {
|
|
font-family: monospace;
|
|
padding: 20px;
|
|
background: #1e1e1e;
|
|
color: #d4d4d4;
|
|
}
|
|
nav {
|
|
margin-bottom: 20px;
|
|
padding: 10px;
|
|
background: #252526;
|
|
border: 1px solid #444;
|
|
}
|
|
nav a {
|
|
color: #4ec9b0;
|
|
margin-right: 10px;
|
|
text-decoration: none;
|
|
}
|
|
nav a:hover {
|
|
text-decoration: underline;
|
|
}
|
|
.test {
|
|
margin: 15px 0;
|
|
padding: 15px;
|
|
border: 1px solid #444;
|
|
background: #252526;
|
|
}
|
|
.test h3 {
|
|
margin-top: 0;
|
|
color: #4ec9b0;
|
|
}
|
|
.result {
|
|
padding: 10px;
|
|
background: #1e1e1e;
|
|
border: 1px solid #555;
|
|
margin: 5px 0;
|
|
color: #ce9178;
|
|
}
|
|
.expected, .expected-pattern {
|
|
padding: 10px;
|
|
background: #1e1e1e;
|
|
border: 1px solid #555;
|
|
margin: 5px 0;
|
|
color: #6a9955;
|
|
}
|
|
pre {
|
|
margin: 0;
|
|
white-space: pre-wrap;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<app-root></app-root>
|
|
<script type="module" src="./main.js"></script>
|
|
|
|
<script>
|
|
(function() {
|
|
let ws;
|
|
let reconnectAttempts = 0;
|
|
const maxReconnectDelay = 5000;
|
|
|
|
function connect() {
|
|
ws = new WebSocket('ws://localhost:4200/qu-ws/');
|
|
|
|
ws.onopen = () => {
|
|
console.log('[Live Reload] Connected');
|
|
reconnectAttempts = 0;
|
|
};
|
|
|
|
ws.onmessage = (event) => {
|
|
try {
|
|
const message = JSON.parse(event.data);
|
|
if (message.type === 'reload') {
|
|
console.log('[Live Reload] Reloading page...');
|
|
window.location.reload();
|
|
}
|
|
} catch {}
|
|
};
|
|
|
|
ws.onclose = () => {
|
|
console.warn('[Live Reload] Connection lost, attempting to reconnect...');
|
|
reconnectAttempts++;
|
|
const delay = Math.min(1000 * reconnectAttempts, maxReconnectDelay);
|
|
setTimeout(connect, delay);
|
|
};
|
|
|
|
ws.onerror = () => {
|
|
ws.close();
|
|
};
|
|
}
|
|
|
|
connect();
|
|
})();
|
|
</script>
|
|
</body>
|
|
</html>
|