mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 17:27:45 +01:00
Dashboard work around Hass.io bug (#575)
* Dashboard work around Hass.io bug Ref https://github.com/home-assistant/hassio/issues/1103 * Lint
This commit is contained in:
parent
25d04c759c
commit
4b8ecc7634
1 changed files with 6 additions and 5 deletions
|
@ -5,12 +5,13 @@
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
M.AutoInit(document.body);
|
M.AutoInit(document.body);
|
||||||
});
|
});
|
||||||
let wsProtocol = "ws:";
|
const loc = window.location;
|
||||||
if (window.location.protocol === "https:") {
|
const wsLoc = new URL("./",`${loc.protocol}//${loc.host}${loc.pathname}`);
|
||||||
wsProtocol = 'wss:';
|
wsLoc.protocol = 'ws:';
|
||||||
|
if (loc.protocol === "https:") {
|
||||||
|
wsLoc.protocol = 'wss:';
|
||||||
}
|
}
|
||||||
const wsUrl = `${wsProtocol}//${window.location.host}${window.location.pathname}`;
|
const wsUrl = wsLoc.href;
|
||||||
|
|
||||||
|
|
||||||
// ============================= Color Log Parsing =============================
|
// ============================= Color Log Parsing =============================
|
||||||
const initializeColorState = () => {
|
const initializeColorState = () => {
|
||||||
|
|
Loading…
Reference in a new issue