repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix: ensure daily recurring charging profiles are adjusted on a day
[e-mobility-charging-stations-simulator.git]
/
src
/
charging-station
/
ui-server
/
UIServerFactory.ts
diff --git
a/src/charging-station/ui-server/UIServerFactory.ts
b/src/charging-station/ui-server/UIServerFactory.ts
index 2a125af07971fe9b724a06f45cf8c04b5e03c040..c4006b0396d96c8d5ad50e902bfedf8ea2743c65 100644
(file)
--- a/
src/charging-station/ui-server/UIServerFactory.ts
+++ b/
src/charging-station/ui-server/UIServerFactory.ts
@@
-1,33
+1,31
@@
import chalk from 'chalk';
import chalk from 'chalk';
-import type { UIServerConfiguration } from '../../types/ConfigurationData';
-import { ApplicationProtocol } from '../../types/UIProtocol';
-import Configuration from '../../utils/Configuration';
import type { AbstractUIServer } from './AbstractUIServer';
import type { AbstractUIServer } from './AbstractUIServer';
-import
UIHttpServer
from './UIHttpServer';
+import
{ UIHttpServer }
from './UIHttpServer';
import { UIServerUtils } from './UIServerUtils';
import { UIServerUtils } from './UIServerUtils';
-import UIWebSocketServer from './UIWebSocketServer';
+import { UIWebSocketServer } from './UIWebSocketServer';
+import { ApplicationProtocol, type UIServerConfiguration } from '../../types';
-export
default
class UIServerFactory {
+export class UIServerFactory {
private constructor() {
// This is intentional
}
public static getUIServerImplementation(
private constructor() {
// This is intentional
}
public static getUIServerImplementation(
- uiServerConfiguration
?: UIServerConfiguration
+ uiServerConfiguration
: UIServerConfiguration,
): AbstractUIServer | null {
): AbstractUIServer | null {
- if (UIServerUtils.isLoopback(uiServerConfiguration.options
?.host
) === false) {
+ if (UIServerUtils.isLoopback(uiServerConfiguration.options
!.host!
) === false) {
console.warn(
chalk.yellow(
console.warn(
chalk.yellow(
- 'Loopback address not detected in UI server configuration. This is not recommended.'
- )
+ 'Loopback address not detected in UI server configuration. This is not recommended.'
,
+ )
,
);
}
);
}
- switch (uiServerConfiguration
?.type ?? Configuration.getUIServer()
.type) {
+ switch (uiServerConfiguration.type) {
case ApplicationProtocol.WS:
case ApplicationProtocol.WS:
- return new UIWebSocketServer(uiServerConfiguration
?? Configuration.getUIServer()
);
+ return new UIWebSocketServer(uiServerConfiguration);
case ApplicationProtocol.HTTP:
case ApplicationProtocol.HTTP:
- return new UIHttpServer(uiServerConfiguration
?? Configuration.getUIServer()
);
+ return new UIHttpServer(uiServerConfiguration);
default:
return null;
}
default:
return null;
}