add http-client
This commit is contained in:
parent
ac2904588c
commit
8bcd555d71
36 changed files with 1978 additions and 49 deletions
34
http-client/dist/index.html
vendored
Normal file
34
http-client/dist/index.html
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html><html lang="en"><head>
|
||||
<meta charset="utf-8">
|
||||
<title>Vesys Bank</title>
|
||||
<link rel="stylesheet" href="/styles-3143ec7e42adb2c6.css">
|
||||
|
||||
<link rel="preload" href="/index-57ce73b23c43b0f5_bg.wasm" as="fetch" type="application/wasm" crossorigin="">
|
||||
<link rel="modulepreload" href="/index-57ce73b23c43b0f5.js"></head>
|
||||
<body><script type="module">import init from '/index-57ce73b23c43b0f5.js';init('/index-57ce73b23c43b0f5_bg.wasm');</script><script>(function () {
|
||||
var url = 'ws://' + 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>
|
Loading…
Add table
Add a link
Reference in a new issue