| 12345678910111213141516171819202122 |
- export default {
- isRendered: false,
- async display(){
- if(!this.isRendered){
- document.getElementById("dashboardLogout").addEventListener("click", ()=>{
- localStorage.setItem("loggedIn", "false");
- openPage("login");
- fetch("/logout", {
- method: "GET",
- headers: {"Content-Type": "application/json"}
- });
- });
- console.log(location.protocol);
- window.ws = new WebSocket(`${location.protocol === "https:" ? "wss" : "ws"}://${location.host}/ws`);
- ws.addEventListener("open", ()=>{
- ws.send("hello");
- });
- }
- }
- }
|