2020-04-06 08:38:08 +02:00
|
|
|
const getWsHostName = () => process.env.JIRS_SERVER_BIND === "0.0.0.0" ? 'localhost' : process.env.JIRS_SERVER_BIND;
|
|
|
|
const getProtocol = () => window.location.protocol.replace(/^http/, 'ws');
|
2020-06-10 22:11:51 +02:00
|
|
|
const wsUrl = () => `${getProtocol()}//${getWsHostName()}:${process.env.JIRS_SERVER_PORT}/ws/`;
|
2020-04-06 08:38:08 +02:00
|
|
|
|
2020-05-19 11:55:55 +02:00
|
|
|
import("/jirs.js").then(async module => {
|
2020-10-18 10:35:41 +02:00
|
|
|
// window.module = module;
|
2020-05-19 11:55:55 +02:00
|
|
|
await module.default();
|
2021-01-06 18:47:54 +01:00
|
|
|
const host_url = `${ location.protocol }//${ process.env.JIRS_SERVER_BIND }:${ process.env.JIRS_SERVER_PORT }`;
|
2020-05-19 11:55:55 +02:00
|
|
|
module.render(host_url, wsUrl());
|
2020-10-18 10:35:41 +02:00
|
|
|
document.querySelector('main').className = '';
|
2021-01-06 18:47:54 +01:00
|
|
|
const spinner = document.querySelector('.spinner');
|
|
|
|
spinner && spinner.remove();
|
2020-03-30 08:16:26 +02:00
|
|
|
});
|