| 1 | # Web UI |
| 2 | |
| 3 | ## Project setup |
| 4 | |
| 5 | ```shell |
| 6 | corepack enable |
| 7 | corepack prepare pnpm@latest --activate |
| 8 | pnpm install |
| 9 | ``` |
| 10 | |
| 11 | The simulator UI server must be enabled, use WebSocket and disable authentication. The simulator main configuration file should have a `uiServer` section like this: |
| 12 | |
| 13 | ```json |
| 14 | "uiServer": { |
| 15 | "enabled": true, |
| 16 | "type": "ws", |
| 17 | "authentication": { |
| 18 | "enabled": false, |
| 19 | "type": "basic-auth", |
| 20 | "username": "admin", |
| 21 | "password": "admin" |
| 22 | } |
| 23 | }, |
| 24 | ``` |
| 25 | |
| 26 | See [here](../../README.md#charging-stations-simulator-configuration) for more details. |
| 27 | |
| 28 | ### Run |
| 29 | |
| 30 | #### Compiles and run for production |
| 31 | |
| 32 | ```shell |
| 33 | pnpm start |
| 34 | ``` |
| 35 | |
| 36 | #### Compiles and run for development |
| 37 | |
| 38 | ```shell |
| 39 | pnpm serve |
| 40 | ``` |
| 41 | |
| 42 | #### Try it out |
| 43 | |
| 44 | For both options above you can then follow the link displayed in the terminal at the end of compilation. The Web UI looks like the following |
| 45 | |
| 46 | ![webui](./assets/webui.png) |
| 47 | |
| 48 | 1. With the top 2 buttons you can now stop and afterwards start the simulator and inspect the server console for the number of charging stations, e.g. with the default configuration: `Charging stations simulator ... started with 10 charging station(s)` |
| 49 | 2. Each charging station is a row in the table below, try "Stop Charging Station" and refresh with the large blue button and see the status Started turns from Yes into No. |
| 50 | |
| 51 | ### Compiles and minifies for production |
| 52 | |
| 53 | ```shell |
| 54 | pnpm build |
| 55 | ``` |
| 56 | |
| 57 | ### Lints files |
| 58 | |
| 59 | ```shell |
| 60 | pnpm lint |
| 61 | ``` |