From 59d6c7d5ec82e83b2c3d33e78a363a4c13b9949c Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Wed, 29 Mar 2023 19:51:52 +0200 Subject: [PATCH] fix(core): update --- package.json | 2 +- pnpm-lock.yaml | 18 ++++++++---------- ts/00_commitinfo_data.ts | 2 +- ts_web/00_commitinfo_data.ts | 2 +- ts_web/index.ts | 12 +++++++++++- ts_web/typedserver_web.infoscreen.ts | 17 ++++++++++++----- 6 files changed, 34 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index 302e500..9e1f37a 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "dependencies": { "@apiglobal/typedrequest": "^2.0.12", "@apiglobal/typedrequest-interfaces": "^2.0.1", - "@apiglobal/typedsocket": "^2.0.22", + "@apiglobal/typedsocket": "^2.0.23", "@pushrocks/smartchok": "^1.0.23", "@pushrocks/smartdelay": "^2.0.13", "@pushrocks/smartexpress": "^4.0.34", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 927d759..d31c038 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,8 +8,8 @@ dependencies: specifier: ^2.0.1 version: 2.0.1 '@apiglobal/typedsocket': - specifier: ^2.0.22 - version: 2.0.22 + specifier: ^2.0.23 + version: 2.0.23 '@pushrocks/smartchok': specifier: ^1.0.23 version: 1.0.23 @@ -97,14 +97,14 @@ packages: transitivePeerDependencies: - supports-color - /@apiglobal/typedsocket@2.0.22: - resolution: {integrity: sha512-HivYmN0nUCyj9ZpCSpFe1tr5brTDGfNLRP5FFC+0oK+ZvFgIDD6JiFzHkQfbaDSelA+4I3JTiTdrJ5iyvroS9w==} + /@apiglobal/typedsocket@2.0.23: + resolution: {integrity: sha512-DDekwm0XYOhJsHSVXuOoMy2/qSaJLh8SgMuq7F5OiIMO2HCv73Dwlo8m8iLw0x+t94LS339c57OvhIcFYX1Usg==} dependencies: '@apiglobal/typedrequest': 2.0.12 '@apiglobal/typedrequest-interfaces': 2.0.1 '@pushrocks/isohash': 2.0.0 '@pushrocks/smartjson': 5.0.5 - '@pushrocks/smartsocket': 2.0.16 + '@pushrocks/smartsocket': 2.0.18 '@pushrocks/smartstring': 4.0.5 '@pushrocks/smarturl': 3.0.5 transitivePeerDependencies: @@ -505,7 +505,7 @@ packages: resolution: {integrity: sha512-0ndTf7ufPAP86TwUoggXAUMqlXx8K77b3D1wJSEDEMs5UqL94khCYz0h/FnGM8eTkLGcgDMwiyahDehcuWWM1g==} dependencies: '@apiglobal/typedrequest': 2.0.12 - '@apiglobal/typedsocket': 2.0.22 + '@apiglobal/typedsocket': 2.0.23 '@pushrocks/lik': 6.0.2 '@pushrocks/smartdelay': 2.0.13 '@pushrocks/smartenv': 5.0.5 @@ -528,9 +528,7 @@ packages: express: 4.18.2 express-force-ssl: 0.3.2 transitivePeerDependencies: - - bufferutil - supports-color - - utf-8-validate /@pushrocks/smartfeed@1.0.11: resolution: {integrity: sha512-PcsiQ4tkwTpGxOdLiEpAR5vfFpn8Utnlind4mmX+FLIZVuuONaApefWMvaYv5ysmfnWQuCE2qkFq1J5ulDcBbQ==} @@ -769,8 +767,8 @@ packages: transitivePeerDependencies: - supports-color - /@pushrocks/smartsocket@2.0.16: - resolution: {integrity: sha512-iFcfBmLrlDw+npCEq2dVJA3GLV8gGJwzaGaaCTHsth864lcE8xhWz9aMxXJvfzYd3HH37R2upYIuXyfIeWllUw==} + /@pushrocks/smartsocket@2.0.18: + resolution: {integrity: sha512-6ehWK4QjqCn2Vq7x7HSNAWaddnc966HaDGeiRBt+5hg05vdzuNhLroqleVrkkTa9CO5lM08aISis1aZSD3/8AA==} dependencies: '@apiglobal/typedrequest-interfaces': 2.0.1 '@pushrocks/isohash': 2.0.0 diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 2bbdbab..85a2a6d 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@apiglobal/typedserver', - version: '2.0.35', + version: '2.0.36', description: 'easy serving of static files' } diff --git a/ts_web/00_commitinfo_data.ts b/ts_web/00_commitinfo_data.ts index 2bbdbab..85a2a6d 100644 --- a/ts_web/00_commitinfo_data.ts +++ b/ts_web/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@apiglobal/typedserver', - version: '2.0.35', + version: '2.0.36', description: 'easy serving of static files' } diff --git a/ts_web/index.ts b/ts_web/index.ts index fe7d26d..9cf8bac 100644 --- a/ts_web/index.ts +++ b/ts_web/index.ts @@ -98,7 +98,17 @@ export class ReloadChecker { this.typedrouter, plugins.typedsocket.TypedSocket.useWindowLocationOriginUrl() ); - this.typedsocket; + this.typedsocket.eventSubject.subscribe(eventArg => { + console.log(`typedsocket event subscription: ${eventArg}`); + if (eventArg === 'disconnected' || eventArg === 'disconnecting' || eventArg === 'timedOut') { + this.backendConnectionLost = true; + this.infoscreen.setText(`typedsocket ${eventArg}!`) + } else if (eventArg === 'connected' && this.backendConnectionLost) { + this.backendConnectionLost = false; + this.infoscreen.setSuccess('typedsocket connected!') + } + + }); logger.log('success', `ReloadChecker connected through typedsocket!`) } } diff --git a/ts_web/typedserver_web.infoscreen.ts b/ts_web/typedserver_web.infoscreen.ts index 9d3458f..8f0ae79 100644 --- a/ts_web/typedserver_web.infoscreen.ts +++ b/ts_web/typedserver_web.infoscreen.ts @@ -71,6 +71,7 @@ export class TypedserverInfoscreen extends LitElement { ]; public setText(textArg: string) { + this.success = false; this.text = textArg; this.show(); this.success = false; @@ -80,17 +81,23 @@ export class TypedserverInfoscreen extends LitElement { this.text = textArg; this.show(); this.success = true; + setTimeout(() => this.hide(), 1000); } private appended = false; - public show () { - this.appended = true; + public async show () { document.body.append(this); + this.appended = true; + await plugins.smartdelay.delayFor(0); + const mainbox = this.shadowRoot.querySelector('.mainbox'); + mainbox.classList.add('show'); } - public hide() { - this.success = false; + public async hide() { this.text = ''; + const mainbox = this.shadowRoot.querySelector('.mainbox'); + mainbox.classList.add('show'); + await plugins.smartdelay.delayFor(300); if (this.appended) { document.body.removeChild(this); } @@ -99,7 +106,7 @@ export class TypedserverInfoscreen extends LitElement { public render () { return html` -
${this.text}
+
${this.text}
` }