X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Fui-server%2FAbstractUIServer.ts;h=a1375cea3786d131013685e39786032e7f1e4d6f;hb=a474cbe107fedbe17398e5d21f852f0ce0d5ca2f;hp=78f0468322bf35b02ef28c25c16400ec72753803;hpb=66a7748ddeda8c94d7562a1ce58d440319654a4c;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ui-server/AbstractUIServer.ts b/src/charging-station/ui-server/AbstractUIServer.ts index 78f04683..a1375cea 100644 --- a/src/charging-station/ui-server/AbstractUIServer.ts +++ b/src/charging-station/ui-server/AbstractUIServer.ts @@ -21,12 +21,14 @@ import { export abstract class AbstractUIServer { public readonly chargingStations: Map + public readonly chargingStationTemplates: Set protected readonly httpServer: Server | Http2Server protected readonly responseHandlers: Map protected readonly uiServices: Map public constructor (protected readonly uiServerConfiguration: UIServerConfiguration) { this.chargingStations = new Map() + this.chargingStationTemplates = new Set() switch (this.uiServerConfiguration.version) { case ApplicationProtocolVersion.VERSION_11: this.httpServer = new Server() @@ -57,7 +59,11 @@ export abstract class AbstractUIServer { public stop (): void { this.stopHttpServer() + for (const uiService of this.uiServices.values()) { + uiService.stop() + } this.chargingStations.clear() + this.chargingStationTemplates.clear() } public async sendInternalRequest (request: ProtocolRequest): Promise { @@ -103,7 +109,8 @@ export abstract class AbstractUIServer { private isBasicAuthEnabled (): boolean { return ( this.uiServerConfiguration.authentication?.enabled === true && - this.uiServerConfiguration.authentication?.type === AuthenticationType.BASIC_AUTH + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + this.uiServerConfiguration.authentication.type === AuthenticationType.BASIC_AUTH ) }