From: Jérôme Benoit Date: Fri, 16 Feb 2024 15:21:47 +0000 (+0100) Subject: feat(ui): enhance charging stations list structure X-Git-Tag: v1.2.37~37 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=9dc8b66f4d1fa4e298e260a33f08debb69b1d944;p=e-mobility-charging-stations-simulator.git feat(ui): enhance charging stations list structure closes #977 Signed-off-by: Jérôme Benoit --- diff --git a/ui/web/src/App.vue b/ui/web/src/App.vue index 87c7aa45..203fb47f 100644 --- a/ui/web/src/App.vue +++ b/ui/web/src/App.vue @@ -9,14 +9,14 @@ font-family: Avenir, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; - color: #2c3e50; + color: black; + background-color: white; } body { height: fit-content; width: fit-content; - margin: 0.05%; - padding: 0.05%; - background-color: rgb(233, 227, 227); + margin: 0.001%; + padding: 0.001%; } diff --git a/ui/web/src/components/Modal.vue b/ui/web/src/components/Modal.vue index 13a4c0b2..74630868 100644 --- a/ui/web/src/components/Modal.vue +++ b/ui/web/src/components/Modal.vue @@ -25,6 +25,6 @@ function close() { justify-content: center; align-items: center; inset: 0; - background-color: rgba(0, 0, 0, 0.2); + background-color: black; } diff --git a/ui/web/src/components/charging-stations/CSConnector.vue b/ui/web/src/components/charging-stations/CSConnector.vue index 08852683..f6cda45a 100644 --- a/ui/web/src/components/charging-stations/CSConnector.vue +++ b/ui/web/src/components/charging-stations/CSConnector.vue @@ -1,39 +1,43 @@ + + diff --git a/ui/web/src/components/charging-stations/CSInfoModal.vue b/ui/web/src/components/charging-stations/CSInfoModal.vue index 05b4b6bd..9e0d1cd8 100644 --- a/ui/web/src/components/charging-stations/CSInfoModal.vue +++ b/ui/web/src/components/charging-stations/CSInfoModal.vue @@ -1,6 +1,6 @@ @@ -13,9 +13,3 @@ const props = defineProps<{ isVisible: boolean }>() - - diff --git a/ui/web/src/components/charging-stations/CSTable.vue b/ui/web/src/components/charging-stations/CSTable.vue index 30f469d9..3d9efbbf 100644 --- a/ui/web/src/components/charging-stations/CSTable.vue +++ b/ui/web/src/components/charging-stations/CSTable.vue @@ -5,10 +5,6 @@ - Action - Connector - Status - Transaction Name Started Supervision Url @@ -17,7 +13,9 @@ Template Vendor Model - Firmware Version + Firmware + Actions + Connector(s) @@ -61,11 +59,9 @@ const props = defineProps<{ flex-direction: column; } -#cs-table__body { - overflow: visible overlay; -} - #cs-table__caption { + color: white; + background-color: black; font-size: 1.5rem; font-weight: bold; padding: 0.5rem; @@ -80,16 +76,22 @@ const props = defineProps<{ } #cs-table__head .cs-table__row { - background-color: rgb(194, 188, 188); + background-color: lightgrey; } .cs-table__row:nth-of-type(even) { - background-color: rgb(223, 217, 217); + background-color: whitesmoke; } .cs-table__column { height: fit-content; - width: calc(100% / 13); + width: calc(65% / 10); + text-align: center; +} + +.cs-table__connectors-column { + height: fit-content; + width: 35%; text-align: center; } diff --git a/ui/web/src/types/ChargingStationType.ts b/ui/web/src/types/ChargingStationType.ts index 8164bce8..a0c1b4c7 100644 --- a/ui/web/src/types/ChargingStationType.ts +++ b/ui/web/src/types/ChargingStationType.ts @@ -1,5 +1,29 @@ import type { JsonObject } from './JsonType' +export enum IdTagDistribution { + RANDOM = 'random', + ROUND_ROBIN = 'round-robin', + CONNECTOR_AFFINITY = 'connector-affinity' +} + +export interface AutomaticTransactionGeneratorConfiguration { + enable: boolean + minDuration: number + maxDuration: number + minDelayBetweenTwoTransactions: number + maxDelayBetweenTwoTransactions: number + probabilityOfStart: number + stopAfterHours: number + stopAbsoluteDuration: boolean + requireAuthorize?: boolean + idTagDistribution?: IdTagDistribution +} + +export interface ChargingStationAutomaticTransactionGeneratorConfiguration { + automaticTransactionGenerator?: AutomaticTransactionGeneratorConfiguration + automaticTransactionGeneratorStatuses?: Status[] +} + export type ChargingStationData = { started: boolean stationInfo: ChargingStationInfo @@ -13,7 +37,7 @@ export type ChargingStationData = { | typeof WebSocket.CLOSING | typeof WebSocket.CLOSED bootNotificationResponse?: BootNotificationResponse - automaticTransactionGenerator?: Status[] + automaticTransactionGenerator?: ChargingStationAutomaticTransactionGeneratorConfiguration } export enum OCPP16FirmwareStatus { diff --git a/ui/web/src/types/index.ts b/ui/web/src/types/index.ts index 85709be3..3e38d5c2 100644 --- a/ui/web/src/types/index.ts +++ b/ui/web/src/types/index.ts @@ -1,7 +1,8 @@ export type { ChargingStationData, ChargingStationInfo, - ConnectorStatus + ConnectorStatus, + Status } from './ChargingStationType' export type { ConfigurationData } from './ConfigurationType' export { diff --git a/ui/web/src/views/ChargingStationsView.vue b/ui/web/src/views/ChargingStationsView.vue index 9243b98f..15564785 100644 --- a/ui/web/src/views/ChargingStationsView.vue +++ b/ui/web/src/views/ChargingStationsView.vue @@ -62,7 +62,6 @@ function stopSimulator(): void { #charging-stations { height: fit-content; width: 100%; - background-color: rgb(233, 227, 227); display: flex; flex-direction: column; } @@ -74,18 +73,18 @@ function stopSimulator(): void { #reload-button { flex: auto; - background-color: rgb(25, 118, 210); color: white; + background-color: blue; font-size: 35px; font-weight: bold; } #reload-button:hover { - background-color: rgb(10, 113, 195); + background-color: rgb(0, 0, 225); } #reload-button:active { - background-color: rgb(255, 113, 195); + background-color: red; } #simulator-button { diff --git a/ui/web/tests/unit/CSTable.spec.ts b/ui/web/tests/unit/CSTable.spec.ts index a756a6e5..0a364a6c 100644 --- a/ui/web/tests/unit/CSTable.spec.ts +++ b/ui/web/tests/unit/CSTable.spec.ts @@ -8,10 +8,6 @@ test('renders CS table columns name', () => { const wrapper = shallowMount(CSTable, { props: { chargingStations, idTag: '0' } }) - expect(wrapper.text()).to.include('Action') - expect(wrapper.text()).to.include('Connector') - expect(wrapper.text()).to.include('Status') - expect(wrapper.text()).to.include('Transaction') expect(wrapper.text()).to.include('Name') expect(wrapper.text()).to.include('Started') expect(wrapper.text()).to.include('Supervision Url') @@ -20,5 +16,7 @@ test('renders CS table columns name', () => { expect(wrapper.text()).to.include('Template') expect(wrapper.text()).to.include('Vendor') expect(wrapper.text()).to.include('Model') - expect(wrapper.text()).to.include('Firmware Version') + expect(wrapper.text()).to.include('Firmware') + expect(wrapper.text()).to.include('Actions') + expect(wrapper.text()).to.include('Connector(s)') })