mirror of
https://github.com/adoyle0/thaw.git
synced 2025-02-12 20:02:47 -05:00
40 lines
No EOL
1.5 KiB
HTML
40 lines
No EOL
1.5 KiB
HTML
<!DOCTYPE html><html lang="en"><head>
|
|
<meta charset="UTF-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Document</title>
|
|
<link rel="stylesheet" href="/main-1badf442e0cd9f48.css">
|
|
|
|
<link rel="preload" href="/basic-cf736e213f6cf9ab_bg.wasm" as="fetch" type="application/wasm" crossorigin="">
|
|
<link rel="modulepreload" href="/basic-cf736e213f6cf9ab.js"></head>
|
|
<body>
|
|
|
|
|
|
<script type="module">import init from '/basic-cf736e213f6cf9ab.js';init('/basic-cf736e213f6cf9ab_bg.wasm');</script><script>(function () {
|
|
var protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
|
|
var url = protocol + '//' + window.location.host + '/_trunk/ws';
|
|
var poll_interval = 5000;
|
|
var reload_upon_connect = () => {
|
|
window.setTimeout(
|
|
() => {
|
|
// when we successfully reconnect, we'll force a
|
|
// reload (since we presumably lost connection to
|
|
// trunk due to it being killed, so it will have
|
|
// rebuilt on restart)
|
|
var ws = new WebSocket(url);
|
|
ws.onopen = () => window.location.reload();
|
|
ws.onclose = reload_upon_connect;
|
|
},
|
|
poll_interval);
|
|
};
|
|
|
|
var ws = new WebSocket(url);
|
|
ws.onmessage = (ev) => {
|
|
const msg = JSON.parse(ev.data);
|
|
if (msg.reload) {
|
|
window.location.reload();
|
|
}
|
|
};
|
|
ws.onclose = reload_upon_connect;
|
|
})()
|
|
</script></body></html> |