mirror of
https://github.com/teslamate-org/teslamate.git
synced 2026-01-24 21:06:08 +08:00
30 lines
659 B
JavaScript
30 lines
659 B
JavaScript
import "../css/app.scss";
|
|
|
|
import "phoenix_html";
|
|
import { Socket } from "phoenix";
|
|
import { LiveSocket } from "phoenix_live_view";
|
|
|
|
import * as hooks from "./hooks";
|
|
|
|
const csrfToken = document
|
|
.querySelector("meta[name='csrf-token']")
|
|
.getAttribute("content");
|
|
|
|
const liveSocket = new LiveSocket("/live", Socket, {
|
|
hooks,
|
|
params: {
|
|
_csrf_token: csrfToken,
|
|
baseUrl: window.location.origin,
|
|
referrer: document.referrer,
|
|
tz: Intl && Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
},
|
|
});
|
|
|
|
liveSocket.connect();
|
|
|
|
// liveSocket.enableDebug();
|
|
// liveSocket.enableLatencySim(1000);
|
|
// window.liveSocket = liveSocket;
|
|
|
|
import "./main";
|