export abstract class AbstractUIServer {
public readonly chargingStations: Map<string, ChargingStationData>
+ public readonly chargingStationTemplates: Set<string>
protected readonly httpServer: Server | Http2Server
protected readonly responseHandlers: Map<string, ServerResponse | WebSocket>
protected readonly uiServices: Map<ProtocolVersion, AbstractUIService>
public constructor (protected readonly uiServerConfiguration: UIServerConfiguration) {
this.chargingStations = new Map<string, ChargingStationData>()
+ this.chargingStationTemplates = new Set<string>()
switch (this.uiServerConfiguration.version) {
case ApplicationProtocolVersion.VERSION_11:
this.httpServer = new Server()
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<ProtocolResponse> {
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
)
}