web: separate websocket connection from messages

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-07-22 13:47:27 +02:00
parent 285a9b8b1d
commit cbeb6e58ac
5 changed files with 85 additions and 46 deletions

View File

@ -33,6 +33,7 @@ import { until } from "lit-html/directives/until";
import { PFSize } from "../elements/Spinner";
import { TITLE_DEFAULT } from "../constants";
import { configureSentry } from "../api/Sentry";
import { WebsocketClient } from "../common/ws";
@customElement("ak-flow-executor")
export class FlowExecutor extends LitElement implements StageHost {
@ -48,6 +49,8 @@ export class FlowExecutor extends LitElement implements StageHost {
@property({ attribute: false })
tenant?: CurrentTenant;
ws: WebsocketClient;
static get styles(): CSSResult[] {
return [PFBase, PFLogin, PFButton, PFTitle, PFList, PFBackgroundImage, AKGlobal].concat(css`
.ak-loading {
@ -75,6 +78,8 @@ export class FlowExecutor extends LitElement implements StageHost {
constructor() {
super();
this.ws = new WebsocketClient();
this.ws.connect();
this.flowSlug = window.location.pathname.split("/")[3];
}